Bug 10451

Summary: libpcap 1.8.x and 1.7x does not compile on PPC
Product: buildroot Reporter: Karl Krach <mail>
Component: OtherAssignee: unassigned
Status: RESOLVED WONTFIX    
Severity: normal CC: buildroot, mail
Priority: P5    
Version: 2017.08   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Host: Target: powerpc-buildroot-linux-uclibcspe-
Build: Linux 4.9.0-4-amd64 #1 SMP Debian 4.9.51-1 (2017-09-28) x86_64 GNU/Linux
Attachments: Compile output
Defconfig to reproduce

Description Karl Krach 2017-10-23 11:38:11 UTC
Created attachment 7321 [details]
Compile output
Comment 1 Karl Krach 2017-10-23 11:40:58 UTC
Libpcap in version 1.8.1 and 1.7.4 doesn't compile with PPC gcc 7.2.0. When downgrading to 1.6.2 the compilation succeeds.

Buildroot is version 2017.08.



Full GCC Version:

./output/host/bin/powerpc-buildroot-linux-uclibcspe-gcc --version
powerpc-buildroot-linux-uclibcspe-gcc.br_real (Buildroot 2017.08-dirty) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 2 Karl Krach 2017-10-23 11:45:44 UTC
The compiler error is:


output/host/bin/powerpc-buildroot-linux-uclibcspe-gcc -fvisibility=hidden -fpic -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=double -Wa,-me500x2 -O3  -I.  -I/home/kkr/Projects/aseries-axos-c2m/system/buildroot-2017.08/output/host/powerpc-buildroot-linux-uclibcspe/sysroot/usr/include/dbus-1.0 -I/home/kkr/Projects/aseries-axos-c2m/system/buildroot-2017.08/output/host/powerpc-buildroot-linux-uclibcspe/sysroot/usr/lib/dbus-1.0/include   -DBUILDING_PCAP -DHAVE_CONFIG_H  -D_U_="__attribute__((unused))" -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mabi=spe -mfloat-gprs=double -Wa,-me500x2 -O3 -c ./pcap.c

./pcap.c: In function 'pcap_create_common':
./pcap.c:590:1: error: unrecognizable insn:
 }
 ^
(insn 58 57 59 9 (set (subreg:SI (reg:V2SI 181) 0)
        (unspec:SI [
                (symbol_ref:SI ("pcap_cant_set_rfmon") [flags 0x3] <function_decl 0x7eff366c4c00 pcap_cant_set_rfmon>)
                (reg:SI 30 30)
            ] UNSPEC_MOVSI_GOT)) "./pcap.c":570 -1
     (nil))
./pcap.c:590:1: internal compiler error: in extract_insn, at recog.c:2311
Comment 3 Karl Krach 2017-10-23 11:50:14 UTC
Created attachment 7326 [details]
Defconfig to reproduce
Comment 4 Karl Krach 2017-10-23 12:18:36 UTC
Doesn't compile with GCC 6.4 either:

output/host/bin/powerpc-buildroot-linux-uclibcspe-gcc --version
powerpc-buildroot-linux-uclibcspe-gcc.br_real (Buildroot 2017.08-dirty) 6.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 5 Arnout Vandecappelle 2017-10-25 18:51:19 UTC
Internal compiler error, so ideally you should report this to upstream GCC. I would first of all try playing with the command line options like -O3 and -fpic (replace with e.g. -fPIC) and the -mfloat-gprs and -Wa,-me500x2 options. You can also try to strip down pcap.c to the minimal thing that exposes the issue - that is needed for reporting the bug to GCC.

I do assume that the patches in ../../projects/92107-110/br_patches do not affect libpcap or gcc?

You can also try with an unpatched GCC:
make host-gcc-final-dirclean
make host-gcc-final-extract
mv output/build/host-gcc-final-*/ /tmp/
make HOST_GCC_FINAL_OVERRIDE_SRCDIR=/tmp/host-gcc-final-* libpcap
Comment 6 Thomas Petazzoni 2017-10-31 20:57:01 UTC
I'm going to close this bug because this is not a Buildroot bug, but a gcc issue.

However, I don't think we caught this issue with our autobuilders, which means our coverage of PowerPC testing isn't great. Karl, would you mind reviewing https://git.buildroot.org/buildroot/tree/support/config-fragments/autobuild and see if the set of PowerPC configurations is relevant or not ?