Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58686 - genkernel-3.0.2e fails compiling 'udev' on non-udev system
Summary: genkernel-3.0.2e fails compiling 'udev' on non-udev system
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: AMD64 Linux
: High major (vote)
Assignee: Gentoo Genkernel Maintainers
URL:
Whiteboard:
Keywords: InVCS
: 59958 65985 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-07-28 11:34 UTC by Luke-Jr
Modified: 2005-02-18 10:46 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch (genkernel-udev-58686.patch,794 bytes, patch)
2004-07-29 13:56 UTC, Tim Yamin (RETIRED)
Details | Diff
Uses genkernel to compile a kernel in a sandbox (gentoo-dev-linux-2.6.7-r11.ebuild,1.09 KB, text/plain)
2004-08-04 16:28 UTC, Luke-Jr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke-Jr 2004-07-28 11:34:05 UTC
/usr/include/linux/posix_types.h etc *do* exist, so I'm not sure why it can't find them... The running kernel lacks udev, as should the target one since --udev was not used.


* udev: >> Compiling...
COMMAND: make -j2 USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/
udev/udev.conf
make -C klibc KERNEL_DIR=/lib/modules/2.6.7-gentoo-r11/build
make[1]: Entering directory `/var/tmp/portage/gentoo-dev-linux-2.6.7-r11/temp/ge
nkernel/udev-030/klibc'
sed -e "s:@udevdir@:/dev:" < udev.8.in > udev.8
gcc -O2 -pipe -fweb -ftracer -pipe -Os -fomit-frame-pointer -D_GNU_SOURCE -Wall
 -nostdinc -Os -fomit-frame-pointer -falign-functions=0 -falign-jumps=0 -falign-
loops=0 -D__KLIBC__ -fno-builtin-printf -I/var/tmp/portage/gentoo-dev-linux-2.6.
7-r11/temp/genkernel/udev-030/klibc/klibc/include -I/var/tmp/portage/gentoo-dev-
linux-2.6.7-r11/temp/genkernel/udev-030/klibc/klibc/arch/x86_64/include -I/var/t
mp/portage/gentoo-dev-linux-2.6.7-r11/temp/genkernel/udev-030/klibc/klibc/includ
e/bits64 -I/usr/lib/gcc/x86_64-pc-linux-gnu/3.4.1/include -I/lib/modules/2.6.7-g
entoo-r11/build/include -I/var/tmp/portage/gentoo-dev-linux-2.6.7-r11/temp/genke
rnel/udev-030/libsysfs   -c -o udevsend.o udevsend.c
In file included from udevsend.c:25:
/var/tmp/portage/gentoo-dev-linux-2.6.7-r11/temp/genkernel/udev-030/klibc/klibc/
include/sys/types.h:14:31: linux/posix_types.h: No such file or directory
/var/tmp/portage/gentoo-dev-linux-2.6.7-r11/temp/genkernel/udev-030/klibc/klibc/
include/sys/types.h:15:23: asm/types.h: No such file or directory
(and many more like these)
Comment 1 Tim Yamin (RETIRED) gentoo-dev 2004-07-28 12:45:01 UTC
If you look at the compiler message you see you have: -I/lib/modules/2.6.7-g
entoo-r11/build/include. Does that exist? You're building this in a temporary tree and you'll probably want to patch the udev Makefile / set a variable for it to look in the right place. That's why you're getting the errors. This has nothing to do with udev not being on the system.

To fix the udev getting compiled without it being requested issue though, change line 218 of the genkernel script to [ "${CMD_UDEV}" ] && compile_udev.
Comment 2 Luke-Jr 2004-07-28 16:15:12 UTC
genkernel's configuration options should do whatever patching is neccesary to the Makefile to make it compile properly...
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-07-29 13:56:27 UTC
Created attachment 36416 [details, diff]
Patch

Tell me if this patch solves the compile issue - thanks!
Comment 4 Luke-Jr 2004-07-29 16:21:18 UTC
Almost... Now the problem seems to be linking:

gcc --static --nostdlib -nostartfiles -nodefaultlibs -o udevd /var/tmp/portage/g
entoo-dev-linux-2.6.7-r11/temp/genkernel/udev-030/klibc/klibc/crt0.o udevd.o ude
v_lib.o klibc_fixups.o  /var/tmp/portage/gentoo-dev-linux-2.6.7-r11/temp/genkern
el/udev-030/klibc/klibc/libc.a
udevd.o(.text+0x2e3): In function `main':
: undefined reference to `__FD_ZERO'
udevd.o(.text+0x2f0): In function `main':
: undefined reference to `__FD_SET'
udevd.o(.text+0x300): In function `main':
: undefined reference to `__FD_SET'
udevd.o(.text+0x349): In function `main':
: undefined reference to `__FD_ISSET'
udevd.o(.text+0x362): In function `main':
: undefined reference to `__FD_ISSET'
collect2: ld returned 1 exit status
make: *** [udevd] Error 1
Comment 5 Luke-Jr 2004-08-04 16:28:30 UTC
Created attachment 36782 [details]
Uses genkernel to compile a kernel in a sandbox
Comment 6 Tim Yamin (RETIRED) gentoo-dev 2004-08-05 09:41:01 UTC
Works fine here...
Comment 7 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-08-10 14:55:29 UTC
*** Bug 59958 has been marked as a duplicate of this bug. ***
Comment 8 Pieter De Wit 2004-08-13 01:52:05 UTC
Hello Guys,

What does the genral public do to fix this ?

Thanks,

Pieter
Comment 9 Joe Millenbach 2004-08-17 03:15:30 UTC
First patch alone works great for me.  No need to sandbox or anything...

To use the fix just edit "/usr/share/genkernel/gen_compile.sh" and on line #482 change the single quotes to double quotes, and add "KERNEL_DIR=$KERNEL_DIR " to the beginning of the text that is surrounded by the quotes.  Or just "apply the diff" something I'm not sure how to do.

I'd call this one fixed guys (but I'll leave it for you to resolve :).
Comment 10 Mathias Gug 2004-08-17 13:07:14 UTC
The patch works for me also.
Comment 11 Luke-Jr 2004-08-18 07:50:33 UTC
Actually, it seems to be a udev/amd64 issue.
Comment 12 Ondrej Ivani&#269; 2004-10-22 08:07:25 UTC
I have installed genkernel-3.1.0, udev-030 and gentoo-dev-sources-2.6.9-r1 on amd64. I think the patch (in a attachment #1 [details]) is included in genkernel-3.1.0, but I can't compile initrd with udev support (like comment #4).

host# genkernel --menuconfig --udev all
and output: 

  : undefined reference to `__FD_SET'
  udevd.o(.text+0x41a): In function `main':
  : undefined reference to `__FD_ISSET'
  udevd.o(.text+0x5ba): In function `main':
  : undefined reference to `__FD_ISSET'
make: *** [udevd] Error 1
* Gentoo Linux Genkernel; Version 3.1.0

* ERROR: Failed to compile the "KERNEL_DIR=/usr/src/linux USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/udev/udev.conf" target...

I think the second attachment is a solution, but I have no idea how to use, (apply?) it.
Comment 13 Paul Sumner 2004-11-07 21:29:27 UTC
Same error, using (on AMD64):

genkernel --udev all

Produces:

----cut------------------
Compiling udevsend.c.
gcc -Wp,-MD,./.snprintf.d -Os -fno-asynchronous-unwind-tables -fomit-frame-pointer -falign-functions=0 -falign-jumps=0 -falign-loops=0 -m64 -nostdinc -iwithprefix include -D__KLIBC__ -DBITSIZE=64 -I../include/arch/x86_64 -I../include/bits64 -I../include -I../linux/include -I../linux/include2 -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -c -o snprintf.o snprintf.c
Compiling udevd.c.
gcc -Wp,-MD,./.vsprintf.d -Os -fno-asynchronous-unwind-tables -fomit-frame-pointer -falign-functions=0 -falign-jumps=0 -falign-loops=0 -m64 -nostdinc -iwithprefix include -D__KLIBC__ -DBITSIZE=64 -I../include/arch/x86_64 -I../include/bits64 -I../include -I../linux/include -I../linux/include2 -DWITH_ERRLIST -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline -c -o vsprintf.o vsprintf.c
  udevd.c: In function `main':
  udevd.c:505: warning: implicit declaration of function `__FD_ZERO'
  udevd.c:506: warning: implicit declaration of function `__FD_SET'
  udevd.c:519: warning: implicit declaration of function `__FD_ISSET'
--
ENOPKG (65) => "Package not installed"
EREMOTE (66) => "Object is remote"
ENOLINK (67) => "Link has been severed"
EADV (68) => "Advertise error"
ESRMNT (69) => "Srmount error"
ECOMM (70) => "Communication error on send"
--
  : undefined reference to `__FD_SET'
  udevd.o(.text+0x876): In function `main':
  : undefined reference to `__FD_ISSET'
  udevd.o(.text+0x891): In function `main':
  : undefined reference to `__FD_ISSET'
make: *** [udevd] Error 1
* Gentoo Linux Genkernel; Version 3.1.0a

* ERROR: Failed to compile the "KERNEL_DIR=/usr/src/linux USE_KLIBC=true USE_LOG=false DEBUG=false udevdir=/dev all etc/udev/udev.conf" target...
-----------cut-------------

I have:

sys-fs/udev-030
sys-kernel/genkernel-3.1.0a
sys-kernel/gentoo-dev-sources-2.6.9-r1

I agree udev/amd64 seems likely... I see newer (testing) versions of udev in portage, is that a specific version that I should test? Greg?

Thanks much.
Comment 14 Paul Sumner 2004-11-07 22:40:07 UTC
Actually, I just built in udev successfully *manually* w/o using genkernel. It seems related to genkernel ;-)
Comment 15 Greg Kroah-Hartman (RETIRED) gentoo-dev 2004-11-09 15:14:19 UTC
This is a genkernel issue, not a udev issue from what I can tell.
Comment 16 Tim Yamin (RETIRED) gentoo-dev 2005-02-18 10:29:25 UTC
*** Bug 65985 has been marked as a duplicate of this bug. ***
Comment 17 Tim Yamin (RETIRED) gentoo-dev 2005-02-18 10:46:52 UTC
Ok, should be fixed in 3.1.0j; please reopen this bug if issues still persist.