Changes between Version 31 and Version 32 of Building/Troubleshooting


Ignore:
Timestamp:
Aug 23, 2010 2:20:58 PM (4 years ago)
Author:
Itkovian
Comment:

Relocation errors when using older GCC on x86_64

Legend:

Unmodified
Added
Removed
Modified
  • Building/Troubleshooting

    v31 v32  
    469469 
    470470This happened to me with MSYS on Windows Server 2003.  Exact cause unknown, but it seems that Windows Server 2003 was upset by the `patch.exe.manifest` supplied with MSYS alongside `patch.exe` to work around the installer-detection nonsense on Vista.  Workaround: remove `/usr/bin/patch.exe.manifest`. 
     471 
     472 
     473== Relocation error when linking the RTS shared library == 
     474 
     475If you use a system with an older GCC (4.1.2 in my case), you may run into the following error: 
     476 
     477{{{ 
     478/usr/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32 against `StgRun' can not be used when making a shared object;  
     479recompile with -fPIC 
     480/usr/bin/ld: final link failed: Bad value 
     481collect2: ld returned 1 exit status 
     482make[1]: *** [rts/dist/build/libHSrts-ghc6.13.20100816.so] Error 1 
     483make[1]: *** Waiting for unfinished jobs.... 
     484make: *** [all] Error 2 
     485}}} 
     486 
     487The Scientific Linux system I was building on had the following software installed: 
     488kernel 2.6.18-128.1.1.el5 
     489gcc version 4.1.2 20080704 (Red Hat 4.1.2-44) 
     490GNU ld version 2.17.50.0.6-9.el5 20061020 (that's the binutils version afaik) 
     491Bootstrapping GHC was version 6.12.1. 
     492 
     493As far as I could tell all .dyn_o files had been built to allow relocation, but StgCRun.c contains some inline assembler code that specifically targets the x86 and x86_64. Upon removal and using the generic version (the part that's protected by the #ifdef USE_MINIINTERPRETER), the error shifted to another file, so the problem did not seem to be with that specific symbol that was referenced in RtsStartup.c  
     494 
     495There was another GCC on the system however (4.3.3). Using that version did allow GHC to build.  
     496 
     497 
     498