[OpenWrt-Devel] GCC 7.4.0 ld LTO plugin issues with SDK

Daniel F. Dickinson cshored at thecshore.com
Wed Jan 2 15:06:45 EST 2019


Hi,

With the SDK I'm getting errors with LTO -- at least for json-c LD is
trying to load the *target's* LTO plugin instead of host.

Not sure where to start looking for this.

Some relevant config:

'like buildbot'
when building SDK: all packages and kernel mods and target specific
packages.

Is LTO used by default normally or is some package (in base) enabling
it, but it's not expected to the be normal case?

Compile log below:


Thread model: posix
gcc version 7.4.0 (OpenWrt GCC 7.4.0 r8970+3-5c4277ec37)
configure:3318: $? = 0
configure:3307: arm-openwrt-linux-muslgnueabi-gcc -V >&5
arm-openwrt-linux-muslgnueabi-gcc: error: unrecognized command line
option '-V'
arm-openwrt-linux-muslgnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3318: $? = 1
configure:3307: arm-openwrt-linux-muslgnueabi-gcc -qversion >&5
arm-openwrt-linux-muslgnueabi-gcc: error: unrecognized command line
option '-qversion'; did you mean '--version'?
arm-openwrt-linux-muslgnueabi-gcc: fatal error: no input files
compilation terminated.
configure:3318: $? = 1
configure:3338: checking whether the C compiler works
configure:3360: arm-openwrt-linux-muslgnueabi-gcc -Os -pipe
-mcpu=arm1176jzf-s -mfpu=vfp -fno-caller-saves -fno-plt -fhonour-copts
-Wno-error=unused-but-set-variable -Wno-error=unused-result
-mfloat-abi=hard
-iremap/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/build_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/json-c-0.12.1:json-c-0.12.1
-Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1
-Wl,-z,now -Wl,-z,relro -fpic -Wno-implicit-fallthrough 
-I/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/usr/include
-I/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/include
-I/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/usr/include
-I/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/include/fortify
-I/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/include 
-L/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/usr/lib
-L/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/target-arm_arm1176jzf-s+vfp_musl_eabi/lib
-L/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/usr/lib
-L/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/lib
-znow -zrelro  conftest.c  >&5
/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/bin/../lib/gcc/arm-openwrt-linux-muslgnueabi/7.4.0/../../../../arm-openwrt-linux-muslgnueabi/bin/ld:
/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/7.4.0/liblto_plugin.so:
error loading plugin:
/home/daniel/Build/openwrt-sdk/cshoredwrt-sdk-19.01-1-brcm2708-bcm2708_gcc-7.4.0_musl_eabi.Linux-x86_64/staging_dir/toolchain-arm_arm1176jzf-s+vfp_gcc-7.4.0_musl_eabi/bin/../libexec/gcc/arm-openwrt-linux-muslgnueabi/7.4.0/liblto_plugin.so:
invalid ELF header
collect2: error: ld returned 1 exit status
configure:3364: $? = 1
configure:3402: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "json-c"
| #define PACKAGE_TARNAME "json-c"
| #define PACKAGE_VERSION "0.12.1"
| #define PACKAGE_STRING "json-c 0.12.1"
| #define PACKAGE_BUGREPORT "json-c at googlegroups.com"
| #define PACKAGE_URL ""
| #define PACKAGE "json-c"
| #define VERSION "0.12.1"
| /* end confdefs.h.  */

Regards,

Daniel


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list