diff mbox series

[1/1] package/rhash: fix build failure due to gcc -v

Message ID 20201203202853.616174-1-fontaine.fabrice@gmail.com
State Accepted
Headers show
Series [1/1] package/rhash: fix build failure due to gcc -v | expand

Commit Message

Fabrice Fontaine Dec. 3, 2020, 8:28 p.m. UTC
Fixes:
 - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...01-configure-allow-cross-compilation.patch | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/rhash/0001-configure-allow-cross-compilation.patch

Comments

Thomas Petazzoni Dec. 5, 2020, 8:31 p.m. UTC | #1
On Thu,  3 Dec 2020 21:28:53 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fixes:
>  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Why isn't gcc -v working ?

Thomas
Fabrice Fontaine Dec. 5, 2020, 8:44 p.m. UTC | #2
Hi,

Le sam. 5 déc. 2020 à 21:31, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> a écrit :
>
> On Thu,  3 Dec 2020 21:28:53 +0100
> Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
>
> > Fixes:
> >  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> >
> > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
> Why isn't gcc -v working ?
I don't know, you can see the full trace here:
http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20/rhash-1.4.0/config.log
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice
Peter Seiderer Dec. 13, 2020, 4:07 p.m. UTC | #3
Hello Fabrice, Thomas,

On Sat, 5 Dec 2020 21:44:05 +0100, Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Hi,
> 
> Le sam. 5 déc. 2020 à 21:31, Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> a écrit :
> >
> > On Thu,  3 Dec 2020 21:28:53 +0100
> > Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> >  
> > > Fixes:
> > >  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> > >
> > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>  
> >
> > Why isn't gcc -v working ?  
> I don't know, you can see the full trace here:
> http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20/rhash-1.4.0/config.log

May be a problem with the toolchain-wrapper?

	$ ls -l .../host/bin/arm-linux-gcc
.../host/bin/arm-linux-gcc -> toolchain-wrapper

	$ .../host/bin/arm-linux-gcc -v 
Using built-in specs.
COLLECT_GCC=.../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real
COLLECT_LTO_WRAPPER=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper
Target: arm-buildroot-linux-uclibcgnueabihf
Configured with: ./configure --prefix=/opt/br-arm11-full-nothread-2020.02 --sysconfdir=/opt/br-arm11-full-nothread-2020.02/etc --enable-static --target=arm-buildroot-linux-uclibcgnueabihf --with-sysroot=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/opt/br-arm11-full-nothread-2020.02 --with-mpc=/opt/br-arm11-full-nothread-2020.02 --with-mpfr=/opt/br-arm11-full-nothread-2020.02 --with-pkgversion='Buildroot 2020.02' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --disable-libsanitizer --disable-tls --disable-threads --disable-libitm --disable-libatomic --without-isl --without-cloog --with-abi=aapcs-linux --with-cpu=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-mode=arm --enable-languages=c,c++ --with-build-time-tools=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/bin --enable-shared --disable-libgomp
Thread model: single
gcc version 8.3.0 (Buildroot 2020.02) 
COMPILER_PATH=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../libexec/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/
LIBRARY_PATH=.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../lib/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-mabi=aapcs-linux' '-mfpu=vfp' '-marm' '-mfloat-abi=hard' '-mcpu=arm1176jzf-s' '-v' '-mtls-dialect=gnu' '-march=armv6kz+fp'
 .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/collect2 -plugin .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/liblto_plugin.so -plugin-opt=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccb9JJ1m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crti.o .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtbegin.o -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0 -L.../host/opt/ext-toolchain/bin/../lib/gcc -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib -z relro -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtend.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crtn.o
.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o: in function `_start':
(.text+0x34): undefined reference to `main'
collect2: error: ld returned 1 exit status


The toolchain-wrapper seems to do/try some compile after the '-v'
handling (all output after the 'gcc version 8.3.0 (Buildroot 2020.02)'
line)

The gcc -v output from the host for compare:

	$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/10/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d --enable-offload-targets=nvptx-none,amdgcn-amdhsa, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/10 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --enable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-10 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --with-build-config=bootstrap-lto-lean --enable-link-mutex --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9] (SUSE Linux) 


Regards,
Peter


> >
> > Thomas
> > --
> > Thomas Petazzoni, CTO, Bootlin
> > Embedded Linux and Kernel engineering
> > https://bootlin.com  
> Best Regards,
> 
> Fabrice
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Seiderer Dec. 13, 2020, 4:20 p.m. UTC | #4
Hello Fabrice, Thomas,

On Sun, 13 Dec 2020 17:07:36 +0100, Peter Seiderer <ps.report@gmx.net> wrote:

> Hello Fabrice, Thomas,
> 
> On Sat, 5 Dec 2020 21:44:05 +0100, Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> 
> > Hi,
> > 
> > Le sam. 5 déc. 2020 à 21:31, Thomas Petazzoni
> > <thomas.petazzoni@bootlin.com> a écrit :  
> > >
> > > On Thu,  3 Dec 2020 21:28:53 +0100
> > > Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> > >    
> > > > Fixes:
> > > >  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> > > >
> > > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>    
> > >
> > > Why isn't gcc -v working ?    
> > I don't know, you can see the full trace here:
> > http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20/rhash-1.4.0/config.log  
> 
> May be a problem with the toolchain-wrapper?
> 
> 	$ ls -l .../host/bin/arm-linux-gcc
> .../host/bin/arm-linux-gcc -> toolchain-wrapper
> 
> 	$ .../host/bin/arm-linux-gcc -v 
> Using built-in specs.
> COLLECT_GCC=.../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real
> COLLECT_LTO_WRAPPER=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper
> Target: arm-buildroot-linux-uclibcgnueabihf
> Configured with: ./configure --prefix=/opt/br-arm11-full-nothread-2020.02 --sysconfdir=/opt/br-arm11-full-nothread-2020.02/etc --enable-static --target=arm-buildroot-linux-uclibcgnueabihf --with-sysroot=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/opt/br-arm11-full-nothread-2020.02 --with-mpc=/opt/br-arm11-full-nothread-2020.02 --with-mpfr=/opt/br-arm11-full-nothread-2020.02 --with-pkgversion='Buildroot 2020.02' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --disable-libsanitizer --disable-tls --disable-threads --disable-libitm --disable-libatomic --without-isl --without-cloog --with-abi=aapcs-linux --with-cpu=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-mode=arm --enable-languages=c,c++ --with-build-time-tools=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/bin --enable-shared --disable-libgomp
> Thread model: single
> gcc version 8.3.0 (Buildroot 2020.02) 
> COMPILER_PATH=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../libexec/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/
> LIBRARY_PATH=.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../lib/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/
> COLLECT_GCC_OPTIONS='-mabi=aapcs-linux' '-mfpu=vfp' '-marm' '-mfloat-abi=hard' '-mcpu=arm1176jzf-s' '-v' '-mtls-dialect=gnu' '-march=armv6kz+fp'
>  .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/collect2 -plugin .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/liblto_plugin.so -plugin-opt=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccb9JJ1m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crti.o .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtbegin.o -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0 -L.../host/opt/ext-toolchain/bin/../lib/gcc -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib -z relro -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtend.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crtn.o
> .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o: in function `_start':
> (.text+0x34): undefined reference to `main'
> collect2: error: ld returned 1 exit status
> 
> 
> The toolchain-wrapper seems to do/try some compile after the '-v'
> handling (all output after the 'gcc version 8.3.0 (Buildroot 2020.02)'
> line)

A strace of

	$ .../host/bin/arm-linux-gcc -v

shows

	24399 execve(".../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real", ["/home/seiderer/Work/Buildroot/bu"..., "--sysroot", "/.../bu"..., "-mabi=aapcs-linux", "-mfpu=vfp", "-marm", "-mfloat-abi=hard", "-mcpu=arm1176jzf-s", "-Wl,-z,relro", "-v"], 0x7ffca405b940 /* 93 vars */) = 0


This one works:

	$ .../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real --sysroot bla -mabi=aapcs-linux -mfpu=vfp -marm -mfloat-abi=hard -mcpu=arm1176jzf-s  -v

This one fails:

	$ .../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real --sysroot bla -mabi=aapcs-linux -mfpu=vfp -marm -mfloat-abi=hard -mcpu=arm1176jzf-s -Wl,-z,relro -v

Regards,
Peter


> 
> The gcc -v output from the host for compare:
> 
> 	$ gcc -v
> Using built-in specs.
> COLLECT_GCC=gcc
> COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/10/lto-wrapper
> OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
> OFFLOAD_TARGET_DEFAULT=1
> Target: x86_64-suse-linux
> Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d --enable-offload-targets=nvptx-none,amdgcn-amdhsa, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/10 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --enable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-10 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --with-build-config=bootstrap-lto-lean --enable-link-mutex --build=x86_64-suse-linux --host=x86_64-suse-linux
> Thread model: posix
> Supported LTO compression algorithms: zlib zstd
> gcc version 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9] (SUSE Linux) 
> 
> 
> Regards,
> Peter
> 
> 
> > >
> > > Thomas
> > > --
> > > Thomas Petazzoni, CTO, Bootlin
> > > Embedded Linux and Kernel engineering
> > > https://bootlin.com    
> > Best Regards,
> > 
> > Fabrice
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot  
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Fabrice Fontaine Dec. 23, 2020, 3:42 p.m. UTC | #5
Hi Peter,

Le dim. 13 déc. 2020 à 17:20, Peter Seiderer <ps.report@gmx.net> a écrit :
>
> Hello Fabrice, Thomas,
>
> On Sun, 13 Dec 2020 17:07:36 +0100, Peter Seiderer <ps.report@gmx.net> wrote:
>
> > Hello Fabrice, Thomas,
> >
> > On Sat, 5 Dec 2020 21:44:05 +0100, Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Le sam. 5 déc. 2020 à 21:31, Thomas Petazzoni
> > > <thomas.petazzoni@bootlin.com> a écrit :
> > > >
> > > > On Thu,  3 Dec 2020 21:28:53 +0100
> > > > Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> > > >
> > > > > Fixes:
> > > > >  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> > > > >
> > > > > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> > > >
> > > > Why isn't gcc -v working ?
> > > I don't know, you can see the full trace here:
> > > http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20/rhash-1.4.0/config.log
> >
> > May be a problem with the toolchain-wrapper?
> >
> >       $ ls -l .../host/bin/arm-linux-gcc
> > .../host/bin/arm-linux-gcc -> toolchain-wrapper
> >
> >       $ .../host/bin/arm-linux-gcc -v
> > Using built-in specs.
> > COLLECT_GCC=.../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real
> > COLLECT_LTO_WRAPPER=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper
> > Target: arm-buildroot-linux-uclibcgnueabihf
> > Configured with: ./configure --prefix=/opt/br-arm11-full-nothread-2020.02 --sysconfdir=/opt/br-arm11-full-nothread-2020.02/etc --enable-static --target=arm-buildroot-linux-uclibcgnueabihf --with-sysroot=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --disable-decimal-float --with-gmp=/opt/br-arm11-full-nothread-2020.02 --with-mpc=/opt/br-arm11-full-nothread-2020.02 --with-mpfr=/opt/br-arm11-full-nothread-2020.02 --with-pkgversion='Buildroot 2020.02' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --disable-libsanitizer --disable-tls --disable-threads --disable-libitm --disable-libatomic --without-isl --without-cloog --with-abi=aapcs-linux --with-cpu=arm1176jzf-s --with-fpu=vfp --with-float=hard --with-mode=arm --enable-languages=c,c++ --with-build-time-tools=/opt/br-arm11-full-nothread-2020.02/arm-buildroot-linux-uclibcgnueabihf/bin --enable-shared --disable-libgomp
> > Thread model: single
> > gcc version 8.3.0 (Buildroot 2020.02)
> > COMPILER_PATH=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../libexec/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/
> > LIBRARY_PATH=.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/:.../host/opt/ext-toolchain/bin/../lib/gcc/:.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib/:.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/
> > COLLECT_GCC_OPTIONS='-mabi=aapcs-linux' '-mfpu=vfp' '-marm' '-mfloat-abi=hard' '-mcpu=arm1176jzf-s' '-v' '-mtls-dialect=gnu' '-march=armv6kz+fp'
> >  .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/collect2 -plugin .../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/liblto_plugin.so -plugin-opt=.../host/opt/ext-toolchain/bin/../libexec/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/lto-wrapper -plugin-opt=-fresolution=/tmp/ccb9JJ1m.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --sysroot=.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crti.o .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtbegin.o -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0 -L.../host/opt/ext-toolchain/bin/../lib/gcc -L.../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/lib -L.../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib -z relro -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/crtend.o .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crtn.o
> > .../host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabihf/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabihf/bin/ld: .../host/arm-buildroot-linux-uclibcgnueabihf/sysroot/usr/lib/crt1.o: in function `_start':
> > (.text+0x34): undefined reference to `main'
> > collect2: error: ld returned 1 exit status
> >
> >
> > The toolchain-wrapper seems to do/try some compile after the '-v'
> > handling (all output after the 'gcc version 8.3.0 (Buildroot 2020.02)'
> > line)
>
> A strace of
>
>         $ .../host/bin/arm-linux-gcc -v
>
> shows
>
>         24399 execve(".../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real", ["/home/seiderer/Work/Buildroot/bu"..., "--sysroot", "/.../bu"..., "-mabi=aapcs-linux", "-mfpu=vfp", "-marm", "-mfloat-abi=hard", "-mcpu=arm1176jzf-s", "-Wl,-z,relro", "-v"], 0x7ffca405b940 /* 93 vars */) = 0
>
>
> This one works:
>
>         $ .../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real --sysroot bla -mabi=aapcs-linux -mfpu=vfp -marm -mfloat-abi=hard -mcpu=arm1176jzf-s  -v
>
> This one fails:
>
>         $ .../host/opt/ext-toolchain/bin/arm-linux-gcc.br_real --sysroot bla -mabi=aapcs-linux -mfpu=vfp -marm -mfloat-abi=hard -mcpu=arm1176jzf-s -Wl,-z,relro -v
Indeed, it seems that -Wl,-z,relro and -v doesn't work, I'll send a
patch to update toolchain-wrapper.c.
>
> Regards,
> Peter
>
>
> >
> > The gcc -v output from the host for compare:
> >
> >       $ gcc -v
> > Using built-in specs.
> > COLLECT_GCC=gcc
> > COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/10/lto-wrapper
> > OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
> > OFFLOAD_TARGET_DEFAULT=1
> > Target: x86_64-suse-linux
> > Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go,d --enable-offload-targets=nvptx-none,amdgcn-amdhsa, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/10 --enable-ssp --disable-libssp --disable-libvtv --enable-cet=auto --disable-libcc1 --enable-plugin --with-bugurl=https://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-libphobos --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-10 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --with-build-config=bootstrap-lto-lean --enable-link-mutex --build=x86_64-suse-linux --host=x86_64-suse-linux
> > Thread model: posix
> > Supported LTO compression algorithms: zlib zstd
> > gcc version 10.2.1 20201202 [revision e563687cf9d3d1278f45aaebd03e0f66531076c9] (SUSE Linux)
> >
> >
> > Regards,
> > Peter
> >
> >
> > > >
> > > > Thomas
> > > > --
> > > > Thomas Petazzoni, CTO, Bootlin
> > > > Embedded Linux and Kernel engineering
> > > > https://bootlin.com
> > > Best Regards,
> > >
> > > Fabrice
> > > _______________________________________________
> > > buildroot mailing list
> > > buildroot@busybox.net
> > > http://lists.busybox.net/mailman/listinfo/buildroot
> >
> > _______________________________________________
> > buildroot mailing list
> > buildroot@busybox.net
> > http://lists.busybox.net/mailman/listinfo/buildroot
>
Best Regards,

Fabrice
Yann E. MORIN Dec. 25, 2020, 10:34 p.m. UTC | #6
Fabrice, All,

On 2020-12-03 21:28 +0100, Fabrice Fontaine spake thusly:
> Fixes:
>  - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Applied to master with the following changes:

  - retain "$CC -v" as default, fallback to "$CC --version", in the hope
    that it stands better chance with upstream
  - write a commit log to explain the actual root-cause of the build
    failure

Thanks!

Regards,
Yann E. MORIN.

> ---
>  ...01-configure-allow-cross-compilation.patch | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 package/rhash/0001-configure-allow-cross-compilation.patch
> 
> diff --git a/package/rhash/0001-configure-allow-cross-compilation.patch b/package/rhash/0001-configure-allow-cross-compilation.patch
> new file mode 100644
> index 0000000000..e33353f8b3
> --- /dev/null
> +++ b/package/rhash/0001-configure-allow-cross-compilation.patch
> @@ -0,0 +1,45 @@
> +From 0605ddf795330c03ff52e993726de99a984cf2f4 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Sat, 10 Oct 2020 11:07:39 +0200
> +Subject: [PATCH] configure: allow cross-compilation
> +
> +Update configure to allow the user to pass a cross-compiler such as
> +--cc=/home/fabrice/buildroot/output/host/bin/riscv64-buildroot-linux-uclibc-gcc
> +
> +First, use --version instead of -v to avoid a build failure and set
> +cc_vendor to gnu if CC compiler contains gcc
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +---
> + configure | 8 ++++----
> + 1 file changed, 4 insertions(+), 4 deletions(-)
> +
> +diff --git a/configure b/configure
> +index 2783b85..c8e1ea7 100755
> +--- a/configure
> ++++ b/configure
> +@@ -512,9 +512,9 @@ else
> +   CC_TMP="$CC"
> +   test -n "$OPT_CC" && OTHER_CC= || OTHER_CC="gcc cc"
> +   for CC in "$CC_TMP" $OTHER_CC; do
> +-    if run_cmd "$CC -v"; then
> +-      cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
> +-      if test "$cc_name_tmp" = "gcc"; then
> ++    if run_cmd "$CC --version"; then
> ++      cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1)
> ++      if echo "$cc_name_tmp" | grep -q "gcc"; then
> +         cc_name=$cc_name_tmp
> +         start_check "$CC version"
> +         cc_vendor=gnu
> +@@ -538,7 +538,7 @@ else
> +         finish_check "$cc_name $cc_version"
> +         break
> +       fi
> +-      if $CC -v 2>&1 | grep -q "clang"; then
> ++      if $CC --version 2>&1 | grep -q "clang"; then
> +         start_check "$CC version"
> +         cc_vendor=clang
> +         cc_version=$($CC -dumpversion 2>&1)
> +-- 
> +2.29.2
> +
> -- 
> 2.29.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard Dec. 27, 2020, 7:55 a.m. UTC | #7
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Fabrice, All,
 > On 2020-12-03 21:28 +0100, Fabrice Fontaine spake thusly:
 >> Fixes:
 >> - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
 >> 
 >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 > Applied to master with the following changes:

 >   - retain "$CC -v" as default, fallback to "$CC --version", in the hope
 >     that it stands better chance with upstream
 >   - write a commit log to explain the actual root-cause of the build
 >     failure

This is only an issue with rhash 1.4.0, and not the older versions we
have on the stable branches, right?
Fabrice Fontaine Dec. 27, 2020, 10:26 a.m. UTC | #8
Hi Peter,

Le dim. 27 déc. 2020 à 08:55, Peter Korsgaard <peter@korsgaard.com> a écrit :
>
> >>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:
>
>  > Fabrice, All,
>  > On 2020-12-03 21:28 +0100, Fabrice Fontaine spake thusly:
>  >> Fixes:
>  >> - http://autobuild.buildroot.org/results/8605c16cc28316954ce8b9dcc266974390c5da20
>  >>
>  >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>
>  > Applied to master with the following changes:
>
>  >   - retain "$CC -v" as default, fallback to "$CC --version", in the hope
>  >     that it stands better chance with upstream
>  >   - write a commit log to explain the actual root-cause of the build
>  >     failure
>
> This is only an issue with rhash 1.4.0, and not the older versions we
> have on the stable branches, right?
Right, this issue is raised by the configure script which is available
since version 1.3.6.
We're using it since our bump to version 1.4.0 with commit
cdaf43862229fb0f10d2b6b7448bcded2ef8edde.
>
> --
> Bye, Peter Korsgaard
Best Regards,

Fabrice
diff mbox series

Patch

diff --git a/package/rhash/0001-configure-allow-cross-compilation.patch b/package/rhash/0001-configure-allow-cross-compilation.patch
new file mode 100644
index 0000000000..e33353f8b3
--- /dev/null
+++ b/package/rhash/0001-configure-allow-cross-compilation.patch
@@ -0,0 +1,45 @@ 
+From 0605ddf795330c03ff52e993726de99a984cf2f4 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sat, 10 Oct 2020 11:07:39 +0200
+Subject: [PATCH] configure: allow cross-compilation
+
+Update configure to allow the user to pass a cross-compiler such as
+--cc=/home/fabrice/buildroot/output/host/bin/riscv64-buildroot-linux-uclibc-gcc
+
+First, use --version instead of -v to avoid a build failure and set
+cc_vendor to gnu if CC compiler contains gcc
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+---
+ configure | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/configure b/configure
+index 2783b85..c8e1ea7 100755
+--- a/configure
++++ b/configure
+@@ -512,9 +512,9 @@ else
+   CC_TMP="$CC"
+   test -n "$OPT_CC" && OTHER_CC= || OTHER_CC="gcc cc"
+   for CC in "$CC_TMP" $OTHER_CC; do
+-    if run_cmd "$CC -v"; then
+-      cc_name_tmp=$($CC -v 2>&1 | tail -n 1 | cut -d ' ' -f 1)
+-      if test "$cc_name_tmp" = "gcc"; then
++    if run_cmd "$CC --version"; then
++      cc_name_tmp=$($CC --version 2>&1 | head -n 1 | cut -d ' ' -f 1)
++      if echo "$cc_name_tmp" | grep -q "gcc"; then
+         cc_name=$cc_name_tmp
+         start_check "$CC version"
+         cc_vendor=gnu
+@@ -538,7 +538,7 @@ else
+         finish_check "$cc_name $cc_version"
+         break
+       fi
+-      if $CC -v 2>&1 | grep -q "clang"; then
++      if $CC --version 2>&1 | grep -q "clang"; then
+         start_check "$CC version"
+         cc_vendor=clang
+         cc_version=$($CC -dumpversion 2>&1)
+-- 
+2.29.2
+