Changes between Version 31 and Version 32 of Building/Troubleshooting

Aug 23, 2010 2:20:58 PM (7 years ago)

Relocation errors when using older GCC on x86_64


  • Building/Troubleshooting

    v31 v32  
    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`.
     473== Relocation error when linking the RTS shared library ==
     475If you use a system with an older GCC (4.1.2 in my case), you may run into the following error:
     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/] Error 1
     483make[1]: *** Waiting for unfinished jobs....
     484make: *** [all] Error 2
     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 20061020 (that's the binutils version afaik)
     491Bootstrapping GHC was version 6.12.1.
     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
     495There was another GCC on the system however (4.3.3). Using that version did allow GHC to build.