Bug 5810 - Buildroot 2012.11: Additional GCC option "-msoft-float" breaks the build
Summary: Buildroot 2012.11: Additional GCC option "-msoft-float" breaks the build
Status: RESOLVED FIXED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: PC Linux
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 17:52 UTC by Timofei Bolshakov
Modified: 2014-01-07 07:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Zip file contains .config and kernel defconfig used in .config (37.37 KB, application/zip)
2012-12-21 18:52 UTC, Timofei Bolshakov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Timofei Bolshakov 2012-12-21 17:52:44 UTC
I need to build an embedded Linux for 486 without coprocessor.
2012.08 works for that reason, 2012.11 breaks.
Here is the error (meanwhile - why it applies arm related patches to x86?):
_____________________________________________________
Applying 810-arm-softfloat-libgcc.patch using patch:
patching file gcc/config/arm/linux-elf.h
patching file libgcc/config/arm/t-linux

Applying 830-arm_unbreak_armv4t.patch using patch:
patching file gcc/config/arm/linux-eabi.h
touch /root/buildroot-2012.11/output/toolchain/gcc-4.7.2/.patched
mkdir -p /root/buildroot-2012.11/output/toolchain/gcc-4.7.2-initial
(cd /root/buildroot-2012.11/output/toolchain/gcc-4.7.2-initial; rm -rf config.cache; \
                PATH=/root/buildroot-2012.11/output/host/bin:/root/buildroot-2012.11/output/host/usr/bin:/usr/lib/git-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin AR="/usr/bin/ar" AS="/usr/bin/as" LD="/usr/bin/ld" NM="/usr/bin/nm" CC="/root/buildroot-2012.11/output/host/usr/bin/ccache /usr/bin/gcc" GCC="/root/buildroot-2012.11/output/host/usr/bin/ccache /usr/bin/gcc" CXX="/root/buildroot-2012.11/output/host/usr/bin/ccache /usr/bin/g++" CPP="/usr/bin/cpp" CPPFLAGS="-I/root/buildroot-2012.11/output/host/usr/include" CFLAGS="-O2 -I/root/buildroot-2012.11/output/host/usr/include" CXXFLAGS="-O2 -I/root/buildroot-2012.11/output/host/usr/include" LDFLAGS="-L/root/buildroot-2012.11/output/host/lib -L/root/buildroot-2012.11/output/host/usr/lib -Wl,-rpath,/root/buildroot-2012.11/output/host/usr/lib" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG="/root/buildroot-2012.11/output/host/usr/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_LIBDIR="/root/buildroot-2012.11/output/host/usr/lib/pkgconfig:/root/buildroot-2012.11/output/host/usr/share/pkgconfig" PERLLIB="/root/buildroot-2012.11/output/host/usr/lib/perl" LD_LIBRARY_PATH="/root/buildroot-2012.11/output/host/usr/lib:" \
                /root/buildroot-2012.11/output/toolchain/gcc-4.7.2/configure  \
                --prefix=/root/buildroot-2012.11/output/host/usr \
                --build=i686-pc-linux-gnu \
                --host=i686-pc-linux-gnu \
                --target=i486-buildroot-linux-uclibc \
                --enable-languages=c \
                --with-sysroot=/root/buildroot-2012.11/output/toolchain/uClibc_dev/ \
                --disable-__cxa_atexit \
                --enable-target-optspace \
                 \
                --enable-libgomp \
                --with-gnu-ld \
                --disable-shared \
                --disable-libssp \
                --without-headers \
                --with-newlib \
                --disable-multilib \
                --enable-tls \
                --with-gmp=/root/buildroot-2012.11/output/host/usr \
                --with-mpfr=/root/buildroot-2012.11/output/host/usr \
                --with-mpc=/root/buildroot-2012.11/output/host/usr \
                --disable-nls \
                --enable-threads \
                --disable-decimal-float \
                 \
                 --with-arch="i486" --with-tune="i486"  \
                --with-pkgversion="Buildroot 2012.11" --with-bugurl="http://bugs.buildroot.net/" -msoft-float \
        )
configure: error: unrecognized option: `-msoft-float'
Try `/root/buildroot-2012.11/output/toolchain/gcc-4.7.2/configure --help' for more information.
make: *** [/root/buildroot-2012.11/output/toolchain/gcc-4.7.2-initial/.configured] Error 1
Comment 1 Thomas Petazzoni 2012-12-21 18:22:34 UTC
Please post your Buildroot .config so we can reproduce the problem.

And for the "meanwhile - why it applies arm related patches to x86?" question, this is because we don't do architecture-specific patches. Those patches are always applied, regardless of which architecture you are building for, but in practice they only touch ARM-specific parts of gcc, so they are totally harmless if you build for x86, PowerPC or MIPS. Having a single stack of patches that are always applied regardless of the selected architecture is much better than having per-architecture patches.
Comment 2 Timofei Bolshakov 2012-12-21 18:42:55 UTC
(In reply to comment #1)
> Please post your Buildroot .config so we can reproduce the problem.
> 
> And for the "meanwhile - why it applies arm related patches to x86?" question,
> this is because we don't do architecture-specific patches. Those patches are
> always applied, regardless of which architecture you are building for, but in
> practice they only touch ARM-specific parts of gcc, so they are totally
> harmless if you build for x86, PowerPC or MIPS. Having a single stack of
> patches that are always applied regardless of the selected architecture is much
> better than having per-architecture patches.

OK.
Especially if it is harmless.
Comment 3 Timofei Bolshakov 2012-12-21 18:52:40 UTC
Created attachment 4706 [details]
Zip file contains .config and kernel defconfig used in .config
Comment 4 Thomas Petazzoni 2012-12-21 19:00:13 UTC
So, you're explicitly passing:

BR2_EXTRA_GCC_CONFIG_OPTIONS="-msoft-float"

in your Buildroot configuration, and then you complain because GCC doesn't understand your special flag? If you pass a special flag, aren't you supposed to know what you're doing?

This seems like a curious bug report, isn't it ?
Comment 5 Timofei Bolshakov 2012-12-21 20:44:10 UTC
(In reply to comment #4)
> So, you're explicitly passing:
> 
> BR2_EXTRA_GCC_CONFIG_OPTIONS="-msoft-float"

No, I am setting "Additional gcc options". That leads to 
BR2_EXTRA_GCC_CONFIG_OPTIONS="-msoft-float"
I surely was not understanding that it will lead to CONFIG option. 
My fault. But that is curious conversion from "Additional gcc options" to 
BR2_EXTRA_GCC_CONFIG_OPTIONS - it is not clear until one goes into 
the .config in text form. Meanwhile - using it in "Target optimizations" also 
leads to break. 

And that was not breaking the build in 2012.8

So, where should I put my -msoft-float then? I want everything to be compiled 
with this flag.

> 
> in your Buildroot configuration, and then you complain because GCC doesn't
> understand your special flag? 

What should I complain about then? Unclear language?
If one will change "Additional gcc options" to "Additional gcc config options"
there will be no confusion. Or to use anything I should go and check the source code? 

> If you pass a special flag, aren't you supposed
> to know what you're doing?
> 
> This seems like a curious bug report, isn't it ?

That is clear enough:

-msoft-float
           Use (do not use) the hardware floating-point instructions for floating-point operations.  When -msoft-float is specified, functions in libgcc.a will be used to perform floating-point operations. Unless they are replaced by routines that emulate the floating-point operations, or compiled in such a way as to call such emulations routines, these routines will issue floating-point operations. If you are compiling for an Alpha without floating-point operations, you must ensure that the library is built so as not to call them. Note that Alpha implementations without floating-point operations are required to have floating-point registers.

That is what I want - "functions in libgcc.a will be used to perform floating-point operations". I was wrong to use config option labelled as "additional" for that. Where can I put my "-msoft-float"?
Comment 6 Thomas Petazzoni 2014-01-07 07:37:43 UTC
The ARM soft-float / hard-float support has been significantly improved in the 2013.08 release. There is now a clear way of choosing between soft-float, hard-float with floating point arguments passed in integer registers (so-called softfp) and hard-float with floating point arguments passed in floating point registers (so called hardfp).

Therefore, I believe this bug can now be considered as fixed.