sys-fs/udev-0.44 and above cannot be built with USE=static. I tried adapting the ebuild to work like udev-0.43.ebuild, but to no avail. There seems to have been some upstream change that broke it. Reproducible: Always Steps to Reproduce: 1. USE=static emerge -v --buildpkgonly =sys-fs/udev-045 Actual Results: root@cube:/usr/local/portage/sys-fs/udev# USE=static emerge -v --buildpkgonly =sys-fs/udev-045 Calculating dependencies ...done! >>> emerge (1 of 1) sys-fs/udev-045 to / static >>> md5 files ;-) udev-024-r1.ebuild [...] >>> md5 src_uri ;-) udev-045.tar.bz2 static static >>> Unpacking source... >>> Unpacking udev-045.tar.bz2 to /var/tmp/portage/portage/udev-045/work >>> Source unpacked. static make -C klibc SUBDIRS=klibc make[1]: Entering directory `/tmp/portage/portage/udev-045/work/udev-045/klibc' make[2]: Entering directory `/tmp/portage/portage/udev-045/work/udev-045/klibc/klibc' gcc -Wp,-MD,arch/i386/.crt0.d -mregparm=3 -DREGPARM=3 -march=i386 -Os -g -falign-functions=0 -falign-jumps=0 -falign-loops=0 -nostdinc -iwithprefix include -D__KLIBC__ -DBITSIZE=32 -I../include/arch/i386 -I../include/bits32 -I../include -I../linux/include -I../linux/include2 -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -D__ASSEMBLY__ -c -o arch/i386/crt0.o arch/i386/crt0.S cp arch/i386/crt0.o . gcc -Wp,-MD,./.__static_init.d -mregparm=3 -DREGPARM=3 -march=i386 -Os -g -falign-functions=0 -falign-jumps=0 -falign-loops=0 -nostdinc -iwithprefix include -D__KLIBC__ -DBITSIZE=32 -I../include/arch/i386 -I../include/bits32 -I../include -I../linux/include -I../linux/include2 -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -c -o __static_init.o __static_init.c gcc -Wp,-MD,./.vsnprintf.d -mregparm=3 -DREGPARM=3 -march=i386 -Os -g -falign-functions=0 -falign-jumps=0 -falign-loops=0 -nostdinc -iwithprefix include -D__KLIBC__ -DBITSIZE=32 -I../include/arch/i386 -I../include/bits32 -I../include -I../linux/include -I../linux/include2 -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -c -o vsnprintf.o vsnprintf.c In file included from vsnprintf.c:12: ../include/limits.h:38:26: linux/limits.h: No such file or directory In file included from ../include/unistd.h:11, from ../include/stdio.h:11, from vsnprintf.c:13: ../include/sys/types.h:15:31: linux/posix_types.h: No such file or directory ../include/sys/types.h:16:23: asm/types.h: No such file or directory In file included from ../include/unistd.h:11, from ../include/stdio.h:11, from vsnprintf.c:13: ../include/sys/types.h:21: error: syntax error before "fd_set" ../include/sys/types.h:21: warning: type defaults to `int' in declaration of `fd_set' ../include/sys/types.h:21: warning: data definition has no type or storage class ../include/sys/types.h:23: error: syntax error before "ino_t" ../include/sys/types.h:23: warning: type defaults to `int' in declaration of `ino_t' ../include/sys/types.h:23: warning: data definition has no type or storage class ../include/sys/types.h:24: error: syntax error before "mode_t" ../include/sys/types.h:24: warning: type defaults to `int' in declaration of `mode_t' ../include/sys/types.h:24: warning: data definition has no type or storage class ../include/sys/types.h:25: error: syntax error before "nlink_t" ../include/sys/types.h:25: warning: type defaults to `int' in declaration of `nlink_t' ../include/sys/types.h:25: warning: data definition has no type or storage class ../include/sys/types.h:26: error: syntax error before "off_t" ../include/sys/types.h:26: warning: type defaults to `int' in declaration of `off_t' ../include/sys/types.h:26: warning: data definition has no type or storage class ../include/sys/types.h:27: error: syntax error before "loff_t" ../include/sys/types.h:27: warning: type defaults to `int' in declaration of `loff_t' ../include/sys/types.h:27: warning: data definition has no type or storage class ../include/sys/types.h:28: error: syntax error before "pid_t" ../include/sys/types.h:28: warning: type defaults to `int' in declaration of `pid_t' ../include/sys/types.h:28: warning: data definition has no type or storage class ../include/sys/types.h:29: error: syntax error before "daddr_t" [...] Expected Results: Build a statically linked udev binary. :) Gentoo Base System version 1.4.16 Portage 2.0.51-r3 (default-linux/x86/2004.0, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.7-cube-3 i686) ================================================================= System uname: 2.6.7-cube-3 i686 AMD Athlon(tm) XP 1700+ distcc 2.16 i586-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] ccache version 2.3 [enabled] Autoconf: sys-devel/autoconf-2.59-r5 Automake: sys-devel/automake-1.8.5-r1 Binutils: sys-devel/binutils-2.15.90.0.1.1-r3 Headers: sys-kernel/linux-headers-2.4.21-r1 Libtools: sys-devel/libtool-1.5.2-r5 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium -mcpu=athlon-tbird -O3 -pipe" CHOST="i586-pc-linux-gnu" COMPILER="" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /usr/vice/etc /var/qmail/alias /var/qmail/control" CONFIG_PROTECT_MASK="/etc/afs/C /etc/afs/afsws /etc/afs/modload /etc/gconf /etc/make.globals /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium -mcpu=athlon-tbird -O3 -pipe" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs autoconfig ccache distlocks maketest sandbox sfperms strict userpriv usersandbox" GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ http://gentoo.inode.at/ ftp://gentoo.inode.at/source/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp/portage" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://hybrid.sascha.silbe.org/gentoo-portage" USE="3dnow X acl afs alsa apm avi berkdb bitmap-fonts blas bzlib cdr crypt doc dvd dvdr encode f77 fam flac foomaticdb fortran gdbm gif gimpprint gtk gtk2 gtkhtml guile hbci imagemagick imap imlib ipv6 j-noaim j-nomsn j-noyahoo jabber jpeg krb4 lapack lcms libg++ libwww lvm1 mad maildir makecheck mbox mikmod mmx monitor mpeg mysql nas ncurses nls oggvorbis opengl oss pam pdflib plotutils png postgres python qt qtmt quicktime readline samba scanner sdl skey spell sqlite sse ssl tetex tiff truetype unicode x86 xml xml2 xv xvid zlib linguas_en,de"
Where does /usr/src/linux point to? What version of the kernel is that symlink?
The symlink points to the (fully configured and built) sources of the currently running 2.6.7 kernel: sascha@cube:/usr/src$ ls -l /usr/src/linux lrwxrwxrwx 1 root root 18 Aug 9 20:55 /usr/src/linux -> linux-2.6.7-cube-3 sascha@cube:/usr/src$ uname -a Linux cube 2.6.7-cube-3 #1 Sun Aug 1 14:46:56 CEST 2004 i686 AMD Athlon(tm) XP 1700+ AuthenticAMD GNU/Linux It's vanilla 2.6.7 + minor patches: sascha@cube:/usr/src$ cat linux-2.6.7-cube-3/PATCHES ftp://ftp.silbe.org/linux/kernel/v2.4/linux-2.4.23-enable_caps.patch ftp://ftp.silbe.org/linux/kernel/v2.6/user-mode-linux/host-skas3-2.6.7-v1.patch sascha@cube:/usr/src$
Odd, this really looks like a kernel directory that has not been set up properly. Can you duplicate this with udev 049? And if so, can you try it with a 2.6.9 kernel?
Happens with a freshly built 2.6.9, too (even used genkernel this time). udev-049 makes no difference. I still got sys-kernel/linux-headers-2.4.21-r1 instead of sys-kernel/linux26-headers since I've still a 2.4 kernel floating around for testing purposes. Will try with linux26-headers now.
Installing linux26-headers did not help.
What is the output of the following two lines typed in on the command line: echo /lib/modules/`uname -r`/build ls /lib/modules/`uname -r`/build
sascha@cube:~$ echo /lib/modules/`uname -r`/build /lib/modules/2.6.7-cube-3/build sascha@cube:~$ ls /lib/modules/`uname -r`/build /lib/modules/2.6.7-cube-3/build sascha@cube:~$ ls -l /lib/modules/2.6.7-cube-3/build lrwxrwxrwx 1 root root 27 Aug 6 12:09 /lib/modules/2.6.7-cube-3/build -> /usr/src/linux-2.6.7-cube-4 That's weird. So I probably forgot to adjust EXTRAVERSION in the Makefile when compiling this kernel. If I link /usr/src/linux to a clean, but fully built (i.e. unpacked, patched, compiled and installed) 2.6.9 source tree, udev still does not build. I'll try booting that new kernel and compiling udev again, but it should work even when linking against a kernel that's not currently running.
OK, after I booted the kernel that /usr/src/linux links to, I could successfully build udev-045. So it appears udev cannot link statically against a kernel that's not currently running. :( BTW: udevstart is linked dynamically: root@cube:/tmp/x# ldd sbin/* sbin/scsi_id: not a dynamic executable sbin/udev: not a dynamic executable sbin/udevd: not a dynamic executable sbin/udevsend: not a dynamic executable sbin/udevstart: linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/libc.so.6 (0xb7ebc000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000) sbin/udev_volume_id: not a dynamic executable sbin/wait_for_sysfs: not a dynamic executable
Try 051 release of udev. udevstart is statically linked for me.
Statically linking udevstart still does not work for me: root@cube:/tmp/sascha_silbe/x# ACCEPT_KEYWORDS='~x86' USE=static emerge -v --buildpkgonly sys-fs/udev [...] >>> Completed installing udev-052 into /var/tmp/portage/portage/udev-052/image/ [...] root@cube:/tmp/sascha_silbe/x# tar -xjf /usr/portage/packages/All/udev-052.tbz2 bzip2: (stdin): trailing garbage after EOF ignored root@cube:/tmp/sascha_silbe/x# ldd sbin/* sbin/scsi_id: not a dynamic executable sbin/udev: not a dynamic executable sbin/udevd: not a dynamic executable sbin/udevsend: not a dynamic executable sbin/udevstart: linux-gate.so.1 => (0xffffe000) libc.so.6 => /lib/libc.so.6 (0xb7ebb000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000) sbin/udev_volume_id: not a dynamic executable root@cube:/tmp/sascha_silbe/x# PS: Should I file a new bug report about this?
Yes, please file a new bug and assign it to me. thanks.