[systemd-bugs] [Bug 53265] New: systemd-187 fails at multi-arch and cross-compile

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 8 11:51:21 PDT 2012


https://bugs.freedesktop.org/show_bug.cgi?id=53265

             Bug #: 53265
           Summary: systemd-187 fails at multi-arch and cross-compile
    Classification: Unclassified
           Product: systemd
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
        AssignedTo: systemd-bugs at lists.freedesktop.org
        ReportedBy: peter.alfredsen at gmail.com
         QAContact: systemd-bugs at lists.freedesktop.org


Created attachment 65308
  --> https://bugs.freedesktop.org/attachment.cgi?id=65308
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.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the systemd-bugs mailing list