On Thu, Oct 20, 2016 at 05:47PM, Clint Adams wrote:
> and then on amd64 we have occasional things like
> 
> /usr/bin/ld: dist-ghc/build/Text/Password/Strength_hsc_make.o: relocation 
> R_X86_64_32 against `.rodata' can not be used when making a shared object; 
> recompile with -fPIC

I confirm that on amd64, building magic with the latest GHC (v8.0.1-4)
fails with the following error:

| # cabal install magic
| Resolving dependencies...
| Downloading magic-1.1...
| Configuring magic-1.1...
| Building magic-1.1...
| Failed to install magic-1.1
| Build log ( /root/.cabal/logs/magic-1.1.log ):
| cabal: Entering directory '/tmp/cabal-tmp-17350/magic-1.1'
| 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/base-4.9.0.0 
-Wl,-R,/usr/lib/ghc/base-4.9.0.0 -L/usr/lib/ghc/integer-gmp-1.0.0.1 
-Wl,-R,/usr/lib/ghc/integer-gmp-1.0.0.1 -lgmp -L/usr/lib/ghc/ghc-prim-0.5.0.0 
-Wl,-R,/usr/lib/ghc/ghc-prim-0.5.0.0 -L/usr/lib/ghc/rts -Wl,-R,/usr/lib/ghc/rts 
-lm -lrt -ldl -lffi

If I downgrade gcc-6 to a version prior to v6.2.0-7, it works!
It also works with GHC v7.10.3-10.

Today I noticed a similar bug on grads [#841493]. Could it be that
libmagic.a has not been built with -fPIC?

[#841493] https://bugs.debian.org/841493

-- 
Ilias

Reply via email to