Created attachment 28594 [details] *.i of the file raising the breakdown Bootstrapping gcc-trunk (xgcc (GCC) 4.8.0 20120927 (experimental)) fails with this error for --target=i386-rtems4.11: ... /users/rtems/src/rtems.org/rtems-gcc/BUILD-i386/./gcc/xgcc -B/users/rtems/src/rtems.org/rtems-gcc/BUILD-i386/./gcc/ -nostdinc -B/users/rtems/src/rtems.org/rtems-gcc/BUILD-i386/i386-rtems4.11/soft-float/newlib/ -isystem /users/rtems/src/rtems.org/rtems-gcc/BUILD-i386/i386-rtems4.11/soft-float/newlib/targ-include -isystem /users/rtems/src/rtems.org/rtems-gcc/newlib/libc/include -B/opt/rtems-4.11/i386-rtems4.11/bin/ -B/opt/rtems-4.11/i386-rtems4.11/lib/ -isystem /opt/rtems-4.11/i386-rtems4.11/include -isystem /opt/rtems-4.11/i386-rtems4.11/sys-include -msoft-float -g -O2 -Wall -O2 -I../../../../libgcc/../newlib/libc/sys/rtems/include -g -O2 -Wall -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc -I../../../../libgcc/../include -DHAVE_CC_TLS -o sfp-exceptions.o -MT sfp-exceptions.o -MD -MP -MF sfp-exceptions.dep -c ../../../../libgcc/config/i386/sfp-exceptions.c -fvisibility=hidden -DHIDE_EXPORTS ../../../../libgcc/config/i386/sfp-exceptions.c: In function '__sfp_handle_exceptions': ../../../../libgcc/config/i386/sfp-exceptions.c:52:7: error: impossible constraint in 'asm' asm volatile ("fdiv\t{%y0, %0|%0, %y0}" : "+t" (f)); ^ ../../../../libgcc/config/i386/sfp-exceptions.c:62:7: error: impossible constraint in 'asm' asm volatile ("fdivs\t%1" : "+t" (f) : "m" (g)); ^ make: *** [sfp-exceptions.o] Error 1
Created attachment 28596 [details] Proposed patch Patch that disables relevant parts of soft-fp library
Can you please try to build with attached (untested) patch? The patch disables the part that handles exceptions and where rounding mode is set. We need either x87 or SSE control register for this functionality.
(In reply to comment #2) > Can you please try to build with attached (untested) patch? > > The patch disables the part that handles exceptions and where rounding mode is > set. We need either x87 or SSE control register for this functionality. The patch lets the tool build. I successfully built i386-rtems4.11 using binutils and newlib cvs heads. Please commit and close this. Thanks for fixing this. i386 soft float doesn't attract much attention but some people still care. :)
Author: uros Date: Fri Nov 2 14:09:02 2012 New Revision: 193095 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193095 Log: PR target/55175 * config/i386/sfp-exceptions.c: Guard with _SOFT_FLOAT. * config/i386/sfp-machine.h: Guard exception handling code with _SOFT_FLOAT. * config/i386/32/sfp-machine.h: Guard rounding handling code with _SOFT_FLOAT. * config/i386/64/sfp-machine.h: Ditto. Modified: trunk/libgcc/ChangeLog trunk/libgcc/config/i386/32/sfp-machine.h trunk/libgcc/config/i386/64/sfp-machine.h trunk/libgcc/config/i386/sfp-exceptions.c trunk/libgcc/config/i386/sfp-machine.h
Fixed.
I can confirm i386-rtems4.11-gcc now builds. @Uros: I am inclined to believe this patch probably should be backported to 4.7.x. At least, RTEMS is facing bizarre compilation issues, which I would not want to be related to similar issues as this.
Author: uros Date: Sun Nov 4 18:58:29 2012 New Revision: 193140 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=193140 Log: PR target/55175 * config/i386/32/sfp-machine.h: Guard exception handling and rounding handling code with _SOFT_FLOAT. * config/i386/64/sfp-machine.h: Ditto. Modified: branches/gcc-4_7-branch/libgcc/ChangeLog branches/gcc-4_7-branch/libgcc/config/i386/32/sfp-machine.h branches/gcc-4_7-branch/libgcc/config/i386/64/sfp-machine.h
(In reply to comment #6) > I can confirm i386-rtems4.11-gcc now builds. > > @Uros: I am inclined to believe this patch probably should be backported to > 4.7.x. H have backported similar change to 4.7 branch. Please reopen the PR if there are still problems.
(In reply to comment #8) > H have backported similar change to 4.7 branch. Thanks for the backport. > Please reopen the PR if there are still problems. Unfortunately, your patch doesn't seem to help much: GCC-4.7's soft-float still seems to be pulling in fp routine from inside of newlib: ... /opt/rtems-4.11/lib/gcc/i386-rtems4.11/4.7.2/../../../../i386-rtems4.11/lib/soft-float/libc.a(lib_a-svfprintf.o): In function `_svfprintf_r': /builddir/build/BUILD/rtems-4.11-i386-rtems4.11-gcc-4.7.2/build/i386-rtems4.11/soft-float/newlib/libc/stdio/../../../../../../gcc-4.7.2/newlib/libc/stdio/vfprintf.c:1072: undefined reference to `__truncxfdf2' /builddir/build/BUILD/rtems-4.11-i386-rtems4.11-gcc-4.7.2/build/i386-rtems4.11/soft-float/newlib/libc/stdio/../../../../../../gcc-4.7.2/newlib/libc/stdio/vfprintf.c:1084: undefined reference to `__ltdf2' /builddir/build/BUILD/rtems-4.11-i386-rtems4.11-gcc-4.7.2/build/i386-rtems4.11/soft-float/newlib/libc/stdio/../../../../../../gcc-4.7.2/newlib/libc/stdio/vfprintf.c:1556: undefined reference to `__eqdf2' /builddir/build/BUILD/rtems-4.11-i386-rtems4.11-gcc-4.7.2/build/i386-rtems4.11/soft-float/newlib/libc/stdio/../../../../../../gcc-4.7.2/newlib/libc/stdio/vfprintf.c:1603: undefined reference to `__nedf2'
(In reply to comment #9) > (In reply to comment #8) > > H have backported similar change to 4.7 branch. > Thanks for the backport. > > > Please reopen the PR if there are still problems. > Unfortunately, your patch doesn't seem to help much: > > GCC-4.7's soft-float still seems to be pulling in fp routine from inside of > newlib: This is the other way around: newlib doesn't find libgcc. This is newlib's problem.
(In reply to comment #9) > (In reply to comment #8) > > H have backported similar change to 4.7 branch. > Thanks for the backport. > > > Please reopen the PR if there are still problems. > Unfortunately, your patch doesn't seem to help much: > > GCC-4.7's soft-float still seems to be pulling in fp routine from inside of > newlib: You should use t-softfp instead of 386/t-softfp for i[34567]86-*-rtems* in libgcc/config.host. In fact, there should be no i386/t-softfp for any x86 target.
(In reply to comment #11) > You should use t-softfp instead of 386/t-softfp for i[34567]86-*-rtems* in > libgcc/config.host. > > In fact, there should be no i386/t-softfp for any x86 target. You mean, we should apply a patch similar to this? --- a/libgcc/config.host +++ b/libgcc/config.host @@ -568,7 +568,7 @@ i[34567]86-*-nto-qnx*) extra_parts=crtbegin.o ;; i[34567]86-*-rtems*) - tmake_file="$tmake_file i386/t-softfp i386/t-crtstuff" + tmake_file="$tmake_file i386/t-crtstuff" extra_parts="$extra_parts crti.o crtn.o" ;; i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*) @@ -1165,6 +1165,7 @@ i[34567]86-*-darwin* | x86_64-*-darwin* | \ i[34567]86-*-kfreebsd*-gnu | x86_64-*-kfreebsd*-gnu | \ i[34567]86-*-linux* | x86_64-*-linux* | \ i[34567]86-*-gnu* | \ + i[34567]86-*-rtems* | \ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]* | \ i[34567]86-*-cygwin* | i[34567]86-*-mingw* | x86_64-*-mingw* | \ i[34567]86-*-freebsd* | x86_64-*-freebsd*) The breakdown above is with this patch applied.
(In reply to comment #12) > > You should use t-softfp instead of 386/t-softfp for i[34567]86-*-rtems* in > > libgcc/config.host. > > > > In fact, there should be no i386/t-softfp for any x86 target. > > You mean, we should apply a patch similar to this? Yes. > The breakdown above is with this patch applied. Then the problem is either in newlib or generic libgcc configury. Anyway, original problem with soft-fp was fixed.
(In reply to comment #13) > Then the problem is either in newlib or generic libgcc configury. Please note that t-fdpbit is not enabled by default for x86 anymore. I don't know if this was intentional omission during libgcc conversion, but nobody missed it until today. The second part of your patch enables TFmode soft-float, probably not needed for RTEMS. I think that you need either t-fdpbit or t-softfp-sfdf added to i[34567]86-*-rtems*)
(In reply to comment #14) > (In reply to comment #13) > > > Then the problem is either in newlib or generic libgcc configury. I meanwhile came to the latter conclusion. The math calls are being pulled-in by gcc's code generation from inside of newlib's libm, but soft-fp emulation is missing in libgcc. As we have both hard and soft-float multilib variants, I think RTEMS needs a "softfp wrapper". > Please note that t-fdpbit is not enabled by default for x86 anymore. I don't > know if this was intentional omission during libgcc conversion, but nobody > missed it until today. OK, will check. > The second part of your patch enables TFmode soft-float, probably not needed > for RTEMS. I think that you need either t-fdpbit or t-softfp-sfdf added to > i[34567]86-*-rtems*) Thanks for these hints - I am currently investigating, but ... things like these take _a lot of time_.