GeertJohan / GeertJohan/openwrt-go

GCC build fails for AR71XX

Open
#7 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
240
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Hi,

I am trying to build with make -j1 V=s, and GCC fails to build for MIPS ar71xx with this error:

```
cc1: note: someone does not honour COPTS correctly, passed 0 times
In file included from sysinfo.c:82:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/if_ether.h:137:8: error: redefinition of 'struct ethhdr'
struct ethhdr {
^
In file included from sysinfo.c:28:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/netinet/if_ether.h:96:8: note: originally defined here
struct ethhdr {
^
In file included from sysinfo.c:118:0:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/sys/sysinfo.h:10:8: error: redefinition of 'struct sysinfo'
struct sysinfo {
^
In file included from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/kernel.h:4:0,
from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/netlink.h:4,
from /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/if_addr.h:5,
from sysinfo.c:79:
/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/include/linux/sysinfo.h:7:8: note: originally defined here
struct sysinfo {
^
/bin/bash ./libtool --tag=CC --mode=compile /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/xgcc -B/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/bin/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/lib/ -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/include -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/sys-include -DHAVE_CONFIG_H -I. -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libgcc -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libbacktrace -I ../../gcc/include -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -MT getncpu-linux.lo -MD -MP -MF .deps/getncpu-linux.Tpo -c -o getncpu-linux.lo `test -f 'runtime/getncpu-linux.c' || echo '/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/'`runtime/getncpu-linux.c
libtool: compile: /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/xgcc -B/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04-final/./gcc/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/bin/ -B/home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/lib/ -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/include -isystem /home/zoobab/soft/openwrt-go/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/mips-openwrt-linux-musl/sys-include -DHAVE_CONFIG_H -I. -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime -I/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libffi/include -I../libffi/include -pthread -fexceptions -fplan9-extensions -Wall -Wextra -Wwrite-strings -Wcast-qual -Werror -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libgcc -I /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/../libbacktrace -I ../../gcc/include -Os -pipe -mno-branch-likely -mips32r2 -mtune=34kc -fno-caller-saves -fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -MT getncpu-linux.lo -MD -MP -MF .deps/getncpu-linux.Tpo -c /home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime/getncpu-linux.c -fPIC -DPIC -o .libs/getncpu-linux.o
/home/zoobab/soft/openwrt-go/build_dir/toolchain-mips_34kc_gcc-4.8-linaro_musl-1.1.10/gcc-linaro-4.8-2014.04/libgo/runtime/getncpu-linux.c:9:48: error: missing binary operator before token "("
#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 6)
^
Makefile:3190: recipe for target 'getncpu-linux.lo' failed
make[8]: *** [getncpu-linux.lo] Error 1
```

I will try with other arches if I have the same error...

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the AR71XX build with `make -j1 V=s` and inspect the failures reported from `sysinfo.c` and `runtime/getncpu-linux.c`. Review the `getncpu-linux.lo` target in the generated Makefile and the conflicting headers shown in the log; done means the GCC/libgo build completes for AR71XX without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, go
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.