Bug 4941 - udev doesn't compile with older toolchains
Summary: udev doesn't compile with older toolchains
Status: RESOLVED INVALID
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low normal
Target Milestone: 1.5
Assignee: Laszlo Papp
QA Contact:
URL:
Whiteboard:
Depends on: 4942
Blocks:
  Show dependency tree
 
Reported: 2013-07-29 07:20 UTC by Laszlo Papp
Modified: 2014-01-20 15:05 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
local.conf (10.59 KB, application/octet-stream)
2013-07-29 07:20 UTC, Laszlo Papp
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laszlo Papp 2013-07-29 07:20:05 UTC
Created attachment 1376 [details]
local.conf

Just to make it clear, this is a blocker issue for now. bblayers.conf is the default.

Trying to build poky master head with meta-sourcery master HEAD by invoking the command "bitbake core-image-minimal", and using the following toolchain: 

https://developer.ridgerun.com/wiki/index.php/Code_Sourcery_ARM_toolchain_2009q1-203

| arm-poky-linux-gnueabi-libtool: compile:  arm-none-linux-gnueabi-gcc -march=armv5te -marm -mthumb-interwork --sysroot=/home/lpapp/Projects/poky/build/tmp/sysroots/qemuarm -DHAVE_CONFIG_H -I. -I/home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182 -include ./config.h -I/home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src -DSYSCONFDIR=\"/etc\" -DPKGLIBEXECDIR=\"/lib/udev\" -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat-security -Wtype-limits -fvisibility=hidden -ffunction-sections -fdata-sections -O2 -pipe -g -feliminate-unused-debug-types -c /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c  -fPIC -DPIC -o src/.libs/libudev-monitor.o
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c: In function 'udev_monitor_new_from_socket':
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:153: error: 'SOCK_NONBLOCK' undeclared (first use in this function)
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:153: error: (Each undeclared identifier is reported only once
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:153: error: for each function it appears in.)
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:153: error: 'SOCK_CLOEXEC' undeclared (first use in this function)
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c: In function 'udev_monitor_new_from_netlink_fd':
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:186: error: 'SOCK_CLOEXEC' undeclared (first use in this function)
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:186: error: 'SOCK_NONBLOCK' undeclared (first use in this function)
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c: In function 'udev_monitor_receive_device':
| /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/udev-182/src/libudev-monitor.c:654: warning: comparison between signed and unsigned
| make[2]: *** [src/libudev-monitor.lo] Error 1
| make[1]: *** [all-recursive] Error 1
| make: *** [all] Error 2
| ERROR: oe_runmake failed
| ERROR: Function failed: do_compile (log file is located at /home/lpapp/Projects/poky/build/tmp/work/armv5te-poky-linux-gnueabi/udev/182-r7/temp/log.do_compile.14578)
ERROR: Task 981 (/home/lpapp/Projects/poky/meta/recipes-core/udev/udev_182.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1327 tasks of which 723 didn't need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:

Summary: 1 task failed:
  /home/lpapp/Projects/poky/meta/recipes-core/udev/udev_182.bb, do_compile
Summary: There were 2 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.

========================

Here you can see that the symbol is not available for the old toolchain:

lpapp ~/Projects/poky/build $ grep -rn SOCK_NONBLOCK /usr/local/arm-2013.05/
/usr/local/arm-2013.05/arm-none-linux-gnueabi/libc/usr/include/bits/socket_type.h:52:  SOCK_NONBLOCK = 00004000	/* Atomically mark descriptor(s) as
/usr/local/arm-2013.05/arm-none-linux-gnueabi/libc/usr/include/bits/socket_type.h:54:#define SOCK_NONBLOCK SOCK_NONBLOCK
lpapp ~/Projects/poky/build $ grep -rn SOCK_NONBLOCK /usr/local/arm-2009q1/
lpapp ~/Projects/poky/build $

I get a full build nicely with arm-2013.05, respectively.
Comment 1 Ross Burton 2013-07-31 11:52:14 UTC
Marking as a dup of 4942 as we need to decide what the minimum requirements for kernel/glibc/gcc are if an external toolchain is being used.

If/when we pick a set of versions where this is still a valid bug we can un-duplicate it.

*** This bug has been marked as a duplicate of bug 4942 ***
Comment 2 Laszlo Papp 2013-07-31 11:55:12 UTC
Actually, I was just working on this issue as PACKAGECONFIG is a simple case in here.
Comment 3 Laszlo Papp 2013-07-31 11:59:25 UTC
"-DSOCK_NONBLOCK=0 -DSOCK_CLOEXEC=0"

-> this should make it work even with older toolchains. This should be mapped to the PACKAGECONFIG.
Comment 4 Laszlo Papp 2013-07-31 12:04:07 UTC
I mean, surely, it could be done with .bbappend already most probably, but a PACKAGECONFIG feature would be nicer.

I am still investigating if there is a configure option for this in udev.
Comment 5 Laszlo Papp 2013-07-31 12:09:38 UTC
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]

.. perhaps these ones.
Comment 6 Ross Burton 2014-01-20 15:05:15 UTC
As per 4942, that toolchain is sufficiently old that it doesn't have common defines required by the system.  After udev fails, kmod will probably fail too.

Either upgrade the toolchain, or downgrade the packages that fail.