tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: Building a soft-float target compiler



   At $WORK we've been using the following patch to generate a compiler for
   PowerPC 405 that builds soft-float by default.  This has been especially
   useful so you don't need to edit makefiles with pkgsrc between a "make
   configure" and a "make install" to manually add -msoft-float everywhere.
   
   To enable this, use
   
        ./build.sh ... -V MKSOFTFLOAT_TARGET_TOOLCHAIN=yes ...
   
   The MK option name is a bit unwieldy, but other than that, anyone see
   any problems with adding this patch?  I couldn't see any other easy way
   to get this functionality.

this patch would be rejected upstream but there's no actual
facility for this currently that i can see.

i thought some combination of --with-cpu= or other hacks 
would help but turns out they don't.  the only way i can
see to turn off soft-float by default is to choose a
cpu that does not include soft-float, and that is not
what you are after.

i'm not sure what the right answer would be.  gcc folks?


.mrg.



   Index: gnu/dist/gcc4/gcc/config/rs6000/rs6000.c
   ===================================================================
   RCS file: /cvsroot/src/gnu/dist/gcc4/gcc/config/rs6000/rs6000.c,v
   retrieving revision 1.7
   diff -d -p -u -r1.7 rs6000.c
   --- gnu/dist/gcc4/gcc/config/rs6000/rs6000.c 11 Jan 2007 06:59:53 -0000      
1.7
   +++ gnu/dist/gcc4/gcc/config/rs6000/rs6000.c 22 Jan 2008 14:33:49 -0000
   @@ -1212,6 +1212,10 @@ rs6000_override_options (const char *def
      rs6000_select[0].string = default_cpu;
      rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT;
    
   +#ifdef TARGET_TOOLCHAIN_IS_SOFTFLOAT
   +  target_flags |= MASK_SOFT_FLOAT;
   +#endif
   +
      for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)
        {
          ptr = &rs6000_select[i];
   Index: gnu/usr.bin/gcc4/backend/Makefile
   ===================================================================
   RCS file: /cvsroot/src/gnu/usr.bin/gcc4/backend/Makefile,v
   retrieving revision 1.9
   diff -d -p -u -r1.9 Makefile
   --- gnu/usr.bin/gcc4/backend/Makefile        8 Apr 2007 09:35:32 -0000       
1.9
   +++ gnu/usr.bin/gcc4/backend/Makefile        22 Jan 2008 14:33:49 -0000
   @@ -50,6 +50,9 @@ CPPFLAGS.${f}.c=           -DGENERATOR_FILE
    # XXX
    COPTS.varasm.c=                     -Wno-error
    
   +.if (${MKSOFTFLOAT_TARGET_TOOLCHAIN:Uno} == "yes")
   +CPPFLAGS+= -DTARGET_TOOLCHAIN_IS_SOFTFLOAT
   +.endif
    
    # Headers that host objects depend on (except gen*rtl*)
    HH_NORTL=   ${G_tm_file_list} ${G_build_xm_include_list}
   



Home | Main Index | Thread Index | Old Index