Created attachment 65308 [details] [review] fix incorrect autotools usage The new hackery to extract syscalls from syscall.h just calls plain cpp and doesn't use CFLAGS even though CPP expands to "gcc -E" on all post-2000 linux platforms. This causes multi-arch (CFLAGS=-m32) and cross-compile builds of systemd to fail because the same syscalls aren't available everywhere. Example with CFLAGS=-m32 [...] GEN src/core/load-fragment-gperf.c GEN src/core/load-fragment-gperf-nulstr.c CC src/udev/libudev_core_la-udev-event.lo CC src/udev/libudev_core_la-udev-watch.lo CC src/udev/libudev_core_la-udev-node.lo CC src/udev/libudev_core_la-udev-rules.lo In file included from src/core/syscall-list.c:31:0: src/core/syscall-to-name.h:6:2: error: ‘__NR_connect’ undeclared here (not in a function) src/core/syscall-to-name.h:6:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:6:1: error: (near initialization for ‘syscall_names’) src/core/syscall-to-name.h:21:2: error: ‘__NR_semop’ undeclared here (not in a function) src/core/syscall-to-name.h:21:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:21:1: error: (near initialization for ‘syscall_names’) src/core/syscall-to-name.h:23:2: error: ‘__NR_epoll_ctl_old’ undeclared here (not in a function) src/core/syscall-to-name.h:23:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:23:1: error: (near initialization for ‘syscall_names’) src/core/syscall-to-name.h:25:2: error: ‘__NR_shmat’ undeclared here (not in a function) src/core/syscall-to-name.h:25:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:25:1: error: (near initialization for ‘syscall_names’) src/core/syscall-to-name.h:30:2: error: ‘__NR_shmdt’ undeclared here (not in a function) src/core/syscall-to-name.h:30:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:30:1: error: (near initialization for ‘syscall_names’) src/core/syscall-to-name.h:52:2: error: ‘__NR_semctl’ undeclared here (not in a function) src/core/syscall-to-name.h:52:1: error: array index in initializer not of integer type src/core/syscall-to-name.h:52:1: error: (near initialization for ‘syscall_names’) [...] The attached patch fixes up all calls to CPP. It assumes that CPP expands to "gcc -E" or something that accepts CFLAGS as parameters, but that's the case already with DBUS_PREPROCESS. It could be worked around in configure.ac if ever (god forbid) there was a linux system where CPP expands to plain cpp, but that's probably an academic exercise given the target group of systemd. It looks to me like the problem was introduced because the person who introduced this feature saw that "cpp $BLA $FOO < /dev/null > foo.txt" worked and "$(CPP) $BLA $FOO < /dev/null > foo.txt" didn't. That's because gcc needs a dash before < /dev/null to accept input on stdin.
Better always work against the git tree, not the released version; this seems to be fixed already: http://cgit.freedesktop.org/systemd/systemd/commit/?id=b5dd874ddad5857a6bb418e6a1cdf318e71ca69c
(In reply to comment #1) > Better always work against the git tree, not the released version; this seems > to be fixed already: > > http://cgit.freedesktop.org/systemd/systemd/commit/?id=b5dd874ddad5857a6bb418e6a1cdf318e71ca69c Aitch! You still need to add CFLAGS, because CFLAGS changes the defines (WORDSIZE and __I386). CFLAGS=-m32 is not fixed by that patch.
Next round. :) Please check: http://cgit.freedesktop.org/systemd/systemd/commit/?id=276c54e7995493e59853a448a2d2c3b499b8a7de
Checks out. Thanks a lot.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.