Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

static sqlite makes the library way too big #5

Closed
i3roly opened this issue May 9, 2023 · 4 comments
Closed

static sqlite makes the library way too big #5

i3roly opened this issue May 9, 2023 · 4 comments

Comments

@i3roly
Copy link

i3roly commented May 9, 2023

hi,

since i use lastlog in my embedded firmware, i thought maybe looking ahead would be helpful.

however using sqlite is prohibitive as it adds another megabyte i cannot afford to my build.

when i try to link statically, as you'd imagine, the shared library blows up to ~1.1M since it needs a lot of the calls from sqlite.


GagansMacPro:router Gagan$ mips64el-none-linux-gnu-strip mipsel/install/lastlog2/usr/lib/*
mips64el-none-linux-gnu-strip: Warning: 'mipsel/install/lastlog2/usr/lib/pkgconfig' is a directory
mips64el-none-linux-gnu-strip: Warning: 'mipsel/install/lastlog2/usr/lib/systemd' is a directory
mips64el-none-linux-gnu-strip: Warning: 'mipsel/install/lastlog2/usr/lib/tmpfiles.d' is a directory
GagansMacPro:router Gagan$ ls -lh mipsel/install/lastlog2/usr/lib/
total 1.1M
lrwxr-xr-x 1 Gagan staff   16 May  9 15:02 liblastlog2.so -> liblastlog2.so.1
lrwxr-xr-x 1 Gagan staff   20 May  9 15:02 liblastlog2.so.1 -> liblastlog2.so.1.1.0
-rwxr-xr-x 1 Gagan staff 1.1M May  9 15:02 liblastlog2.so.1.1.0
drwxr-xr-x 2 Gagan staff  102 May  9 15:02 pkgconfig
drwxr-xr-x 3 Gagan staff  102 May  9 15:02 systemd
drwxr-xr-x 2 Gagan staff  102 May  9 15:02 tmpfiles.d

is there any way i can use lastlog2 while keeping the size down?

@thkukuk
Copy link
Owner

thkukuk commented May 10, 2023

is there any way i can use lastlog2 while keeping the size down?

Only if somebody comes up with support for another database, which is very robust, stable, well maintained, fits with the licenses, etc.
I haven't found an alternative and thus I have no plans to add support for other databases.

@i3roly
Copy link
Author

i3roly commented May 10, 2023 via email

@thkukuk
Copy link
Owner

thkukuk commented May 10, 2023

How does the original lastlog achieve this?

sparse files and direct seek access, which is one of the problems why this is not fixable for Y2038.

And what about utmpx or whatever? Same conundrum?

With glibc: utmp = utmpx
With other libc implementations: I don't know.
But: utmp/utmpx have nothing to do with lastlog. Two complete different things with different use cases and requirements.

@i3roly
Copy link
Author

i3roly commented May 10, 2023

thanks thorsten, i guess i'll just have to use regular lastlog for now.

@i3roly i3roly closed this as completed May 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants