dhcpcd has the following defines in common.h: #if __GNUC__ > 2 || defined(__INTEL_COMPILER) # define _noreturn __attribute__((__noreturn__)) # define _packed __attribute__((__packed__)) # define _unused __attribute__((__unused__)) #else # define _noreturn # define _packed # define _unused #endif this is a problem because on ppc, sigcontext is declared as: (with linux-headers-3.7) struct sigcontext { unsigned long _unused[4]; int signal; #ifdef __powerpc64__ int _pad0; #endif unsigned long handler; unsigned long oldmask; struct pt_regs *regs; #ifdef __powerpc64__ elf_gregset_t gp_regs; elf_fpregset_t fp_regs; ... which leads to the rather silly expansion: struct sigcontext { unsigned long __attribute__((__unused__))[4]; int signal; ... which doesn't compile, dying with: powerpc64-unknown-linux-gnu-gcc -O2 -pipe -mcpu=970 -mtune=970 -maltivec -mabi=altivec -floop-block -floop-interchange -floop-strip-mine -ggdb -D_BSD_SOURCE -D_XOPEN_SOURCE=600 -c dhcp.c -o dhcp.o In file included from /usr/include/bits/sigcontext.h:27:0, from /usr/include/signal.h:340, from /usr/include/sys/param.h:28, from net.h:32, from dhcp.h:174, from dhcp.c:38: /usr/include/asm/sigcontext.h:17:23: error: expected identifier or '(' before '[' token
Roy, Do you have any ideas on this? I checked the code for 5.6.8 and it looks like it has the same issue. Thanks, William
Fixed upstream here: http://roy.marples.name/cgi-bin/gitweb.cgi?p=dhcpcd.git;a=commit;h=603a701d1f31da614bdb377c0131bd889f42cb4a Let me know if it fixed the ppc issue!
you are in a maze of twisty #defines, all alike mjrosenb@euclid ~/oss_projects/dhcpcd $ make gcc -O2 -std=c99 -ggdb -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wstrict-overflow -Wdeclaration-after-statement -Wsequence-point -fno-common -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DINET -DINET6 -c common.c -o common.o gcc -O2 -std=c99 -ggdb -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wstrict-overflow -Wdeclaration-after-statement -Wsequence-point -fno-common -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DINET -DINET6 -c control.c -o control.o In file included from /usr/include/signal.h:360:0, from /usr/include/sys/param.h:28, from net.h:32, from dhcp.h:226, from dhcpcd.h:38, from control.c:40: /usr/include/sys/ucontext.h:100:24: error: expected identifier or ‘(’ before ‘[’ token make: *** [control.o] Error 1 mjrosenb@euclid ~/oss_projects/dhcpcd $ sed -n 99,107p /usr/include/sys/ucontext.h typedef struct { unsigned long __unused[4]; int signal; int __pad0; unsigned long handler; unsigned long oldmask; struct pt_regs *regs; gregset_t gp_regs; fpregset_t fp_regs; would it be plausible to change the order that the headers are included so all system headers are defined before anything gets #defined? this means we won't have access to some struct fields like _unused, but they are unused.
I find it highly unfair that the kernel claims both _unused and __unused, especially as __unused is defined on most BSD platforms as defined in dhcpcd. Changing the order of includes isn't that feasible on dhcpcd-5.6, but we should be able to move the structs out of dhcp.h and into dhcp.c in dhcpcd-6 which should also solve the problem. Is this issue only occuring on PPC? I take it linux-headers-3.7 works fine compiling dhcpcd on other archs?
http://roy.marples.name/cgi-bin/gitweb.cgi?p=dhcpcd.git;a=commit;h=805878326a3bd2175b7049ba99f69cd9c5dc8820 May work around it. let me know and I'll apply it to 5.6
Sorry for the slow turnaround time on this. mjrosenb@euclid ~/oss_projects/dhcpcd $ make gcc -O2 -std=c99 -ggdb -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wstrict-overflow -Wdeclaration-after-statement -Wsequence-point -fno-common -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DINET -DINET6 -c control.c -o control.o In file included from /usr/include/signal.h:360:0, from /usr/include/sys/param.h:28, from net.h:32, from dhcp.h:237, from dhcpcd.h:38, from control.c:40: /usr/include/sys/ucontext.h:100:24: error: expected identifier or ‘(’ before ‘[’ token looks like it was included elsewhere.
More fixes here http://roy.marples.name/projects/dhcpcd/changeset/12a3a1ba611a0bb67767cf2a8d4b921d15ca271c and here http://roy.marples.name/projects/dhcpcd/changeset/b3a09891b4c3bc56081f508573fb7265e851ea04 Hopefully it will compile now!
mjrosenb@euclid ~/oss_projects/dhcpcd $ make gcc -O2 -std=c99 -ggdb -Wall -Wextra -Wimplicit -Wshadow -Wformat=2 -Wmissing-prototypes -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Winline -Wwrite-strings -Wcast-align -Wcast-qual -Wpointer-arith -Wstrict-overflow -Wdeclaration-after-statement -Wsequence-point -fno-common -D_BSD_SOURCE -D_XOPEN_SOURCE=700 -DINET -DINET6 -c control.c -o control.o In file included from /usr/include/signal.h:360:0, from eloop.h:31, from control.c:42: /usr/include/sys/ucontext.h:100:24: error: expected identifier or ‘(’ before ‘[’ token not quite. It looks like there are many paths that this file gets included on.
Another fix: http://roy.marples.name/projects/dhcpcd/changeset/12ae0608bc4fd2ba0257ed59421d3c397fe381d1 Does it compile now?
Created attachment 348834 [details] fulll output of make -k Don't know why it didn't occur to me to run make -k before just now. Anyhow, if you want more immediate feedback, I'm usually on IRC, and can be coaxed online at basically any hour. (nick is mjrosenb)
looks like this is fixed in the latest git tip.
I can't close this bug based on whether it builds with the current git tip, but can you test with dhcpcd-5.99.6 and let me know if it builds successfully? Thanks, William
(In reply to William Hubbs from comment #12) > I can't close this bug based on whether it builds with the current git > tip, but can you test with dhcpcd-5.99.6 and let me know if it builds > successfully? It won't build :) However, I'm very close to releasing .7 - just need to waiting on a few testing results about other issues.
dhcpcd-5.99.7 released which fixes this.
This release is now in the tree. Thanks Roy. :-)