Building with recent binutils require --no-pie

Hi all For anyone building on Debian testing or similar and getting linker failures, there is currently a workaround in progress by Ben Gamari that can be used. It is based on first applying D2672, D2673, and D2674 and then configuring with ./configure \ CONF_CC_OPTS_STAGE2=-fno-PIE \ CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \ CONF_LD_LINKER_OPTS_STAGE2=-no-pie \ CONF_CC_OPTS_STAGE0=-no-pie \ CONF_GCC_LINKER_OPTS_STAGE0=-no-pie \ CONF_LD_LINKER_OPTS_STAGE0=-no-pie \ CONF_HC_OPTS_STAGE0=-optl=-no-pie See https://gist.github.com/alanz/570eb6f1c0ae7e989f493f1b69904c28 for a more legible version. Regards Alan

Alan & Kim Zimmerman wrote:
For anyone building on Debian testing or similar and getting linker failures, there is currently a workaround in progress by Ben Gamari that can be used.
It is based on first applying D2672, D2673, and D2674 and then configuring with
./configure \ CONF_CC_OPTS_STAGE2=-fno-PIE \ CONF_GCC_LINKER_OPTS_STAGE2=-no-pie \ CONF_LD_LINKER_OPTS_STAGE2=-no-pie \ CONF_CC_OPTS_STAGE0=-no-pie \ CONF_GCC_LINKER_OPTS_STAGE0=-no-pie \ CONF_LD_LINKER_OPTS_STAGE0=-no-pie \ CONF_HC_OPTS_STAGE0=-optl=-no-pie
Unfortunately, that is not sufficient. With the three patchs you listed and the configure options above, the resulting GHC still fails to build the 'magic' due to something going wrong with hsc2hs: Configuring magic-1.1... Building magic-1.1... Preprocessing library magic-1.1... /usr/bin/ld: dist/build/Magic/Data_hsc_make.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Nonrepresentable section on output collect2: error: ld returned 1 exit status linking dist/build/Magic/Data_hsc_make.o failed (exit code 1) command was: /usr/bin/gcc dist/build/Magic/Data_hsc_make.o dist/build/Magic/Data_hsc_utils.o -o dist/build/Magic/Data_hsc_make -fno-PIE -fno-stack-protector -lmagic -L/usr/lib/ghc-8.0/lib/base-4.9.0.0 -Wl,-R,/usr/lib/ghc-8.0/lib/base-4.9.0.0 -L/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1 -Wl,-R,/usr/lib/ghc-8.0/lib/integer-gmp-1.0.0.1 -lgmp -L/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0 -Wl,-R,/usr/lib/ghc-8.0/lib/ghc-prim-0.5.0.0 -L/usr/lib/ghc-8.0/lib/rts -Wl,-R,/usr/lib/ghc-8.0/lib/rts -lm -lrt -ldl -lffi Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

Erik de Castro Lopo wrote:
Unfortunately, that is not sufficient. With the three patchs you listed and the configure options above, the resulting GHC still fails to build the 'magic' due to something going wrong with hsc2hs:
Just to be clear, this is patching the 8.0.1 release. It seems that the final piece of the puzzle is the cabal 1.24.1.0 release which is due RealSoonNow! https://github.com/haskell/cabal/issues/4080 Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
participants (2)
-
Alan & Kim Zimmerman
-
Erik de Castro Lopo