[lokisetup] xsu

Timothee Besset ttimo at idsoftware.com
Mon Apr 1 03:29:54 EST 2002

On 01 Apr 2002 00:19:26 -0800
Stéphane Peter <megastep at megastep.org> wrote:

> > The other things I can think about: 
> > 
> > - Is this integrated with the build system? (I would say --enable-xsu or
> > --disable-xsu in the configure step?)
> Nope, right now it's always built and installed. That's probably a good
> idea, although I guess that if somebody doesn't want to have the ability
> to su, they could just remove the binaries from the image. The scripts
> shouldn't choke on this.

Yeah .. my initial approach was just to remove xsu from the package. But
it would be 'nice to have'.

> > - How is xsu compiled? Static, completely dynamic as the original is, partly
> > dynamic? In my version I just statically linked the tricky things and left
> > X and Gtk as dynamic linkage to save some file size..
> I kept it dynamic, although it can be built static. However for some
> reason, it completely refused to start up when built static (lots of
> very odd GTK+ errors before a segfault). But just depending on the core
> GTK libraries is acceptable, as we are already doing this for the
> setup.gtk binaries. So I think dynamic binaries are fine in that case.
> It also allows themes and that kind of thing...

Actually, setup.gtk is statically linking againt Gtk, that's why it gets
so big. But it's a safer solution than complete dynamic linking. I had
been looking for an intermediate linking that would be small enough, and
safe enough, here's what I ended up with:

cc src/gui/gui.c -o bin/xsu -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -L/usr/lib -L/usr/X11R6/lib -I/usr/include/gnome-1.0 -Wl,-Bstatic -rdynamic -lzvt -lutil -lgdk_imlib -Wl,-Bdynamic -lgtk -lgdk -lgmodule -lglib -ldl -lXi -lXext -lX11 -lm

timo at antares:~/icculus.org/loki_setup/xsu$ ldd bin/xsu 
        libgtk-1.2.so.0 => /usr/lib/libgtk-1.2.so.0 (0x40021000)
        libgdk-1.2.so.0 => /usr/lib/libgdk-1.2.so.0 (0x40146000)
        libgmodule-1.2.so.0 => /usr/lib/libgmodule-1.2.so.0 (0x4017a000)
        libglib-1.2.so.0 => /usr/lib/libglib-1.2.so.0 (0x4017d000)
        libdl.so.2 => /lib/libdl.so.2 (0x401a0000)
        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x401a4000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x401ac000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x401bb000)
        libm.so.6 => /lib/libm.so.6 (0x40296000)
        libc.so.6 => /lib/libc.so.6 (0x402b8000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)

214kb stripped .. the maximum static version skyrocketted to 1.6Mb ..


More information about the Lokisetup mailing list