How to enable soft-float support in newlib and gcc toolchains for an i386 target

Mian M. Hamayun mian-muhammad.hamayun@imag.fr
Tue Aug 2 18:14:00 GMT 2011


Here is the procedure that I followed, you might be able to see a more 
clearer picture of my gcc toolchain build procedure.

1) Binutils
===========
   ${TMP_DIR}/${BINUTILS_DIR}/configure  \
   --prefix=${INSTALL_DIR}               \
   --target=${TARGET}                    \
   --disable-nls                         \
   --disable-werror                      \
   --enable-multilib                     \
   --with-float=soft                     \
   --enable-soft-float                   \
     &> logs/configure.log || return

   make
   make install

2) GCC Bootstrap
================
   ${TMP_DIR}/${GCC_DIR}/configure   \
   --prefix=${INSTALL_DIR}           \
   --target=${TARGET}                \
   --disable-nls                     \
   --enable-multilib                 \
   --with-newlib                     \
   --enable-soft-float               \
   --enable-interwork                \
   --enable-languages=c      &> logs/configure.log || return

   make all-gcc
   make install-gcc

3) Newlib
=========
   ${TMP_DIR}/${NEWLIB_DIR}/configure      \
   --prefix=${INSTALL_DIR}                 \
   --target=${TARGET}                      \
   --disable-nls                           \
   --enable-multilib                       \
   --enable-interwork                      \
   --enable-newlib-io-long-long            \
   --enable-newlib-io-long-double          \
   --enable-newlib-io-c99-formats          \
   --disable-newlib-may-supply-syscalls    \
   --enable-newlib-multithread             \
   --with-float=soft                       \
   --enable-soft-float                     \
   --disable-newlib-supplied-syscalls      &> logs/configure.log || return

   make
   make install

4) GCC Final
============
   make all
   make install


Here ${TARGET} is "i386-sls-dnaos" which is an i386 target with DNAOS 
(http://www.soclib.fr/trac/dev/wiki/Tools/Muteka) support.

Key points:
- The gcc configure does not accept "--with-float=soft" option !!!
- When we talk about "soft-float" support, do I need to look into my 
target specific code i.e. i386 dnaos ? or its a generic multilibs issue?
- The gcc version of source code that I am using is "4.4.2" with 
binutils version "2.18" and newlib version "1.18.0"

Thanks for your support,
--
Hamayun


On 08/02/2011 03:53 PM, Joel Sherrill wrote:
> On 08/02/2011 06:16 AM, Mian M. Hamayun wrote:
>> Hello Everyone,
>>
>> I am newbie to newlib and gcc toolchains, so my question may be a
>> little ambiguous for this forum.
>>
>> In fact I am trying to build a gcc toolchain with newlib for an i386
>> target which doesn't support hw float/mmx instructions. In fact it is
>> a virtual machine which I am targeting.
>> So when I compile my applications with "-msoft-float" flag, I get
>> quite a few unresolved symbols.
>>
> The support of the soft-float multilibs is dependent on the
> target which the compiler was built for. And the gcc version.
> Without that information, it is hard to answer.
>
>
>> For Example:
>> Sources/susan.c:979: undefined reference to `__floatsisf'
>> Sources/susan.c:979: undefined reference to `__divsf3'
>> Sources/susan.c:1626: undefined reference to `__subdf3'
>> Sources/susan.c:1628: undefined reference to `__mulsf3'
>> ...
>>
> These are gcc support methods. So it is up to how gcc is built.
>> So my obvious 'guess' is to rebuild the gcc toolchain and/or newlib
>> using "--with-float=soft" and/or "--enable-soft-float" options. But so
>> far I haven't been able to build a toolchain that solves this issue.
>>
>> Any help / pointers in this regard will be greatly appreciated.
>> Please also point-out if this is not the right forum for this type of
>> question.
>>
>> Best Regards,
>> Hamayun
>>
>
>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3781 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://sourceware.org/pipermail/newlib/attachments/20110802/0f7822ec/attachment.p7s>


More information about the Newlib mailing list