#4022: GHC Bindist is Broken on FreeBSD/amd64
---------------------------------+------------------------------------------
    Reporter:  pgj               |       Owner:  pgj                            
             
        Type:  bug               |      Status:  new                            
             
    Priority:  normal            |   Component:  libraries (other)              
             
     Version:  6.13              |    Keywords:  GMP,integer-gmp, x86_64, 
FreeBSD, sharedlibs
          Os:  FreeBSD           |    Testcase:                                 
             
Architecture:  Unknown/Multiple  |     Failure:  Building GHC failed            
             
       Patch:  0                 |  
---------------------------------+------------------------------------------
 After correcting the name of the FreeBSD/amd64 platform in
 `PlatformSupportsSharedLibs` it turned out that shared libraries do not
 build on that platform at all.  Log shows that the problem is with the
 integer-gmp library where the sources are not compiled with the `-fPIC`
 flag.

 Excerpt from the build log:

 {{{
 ...
 "inplace/bin/ghc-stage1" libraries/integer-gmp/dist-
 install/build/GHC/Integer.dyn_o libraries/integer-gmp/dist-
 install/build/GHC/Integer/GMP/Internals.dyn_o libraries/integer-gmp/dist-
 install/build/GHC/Integer/Type.dyn_o libraries/integer-gmp/dist-
 install/build/cbits/gmp-wrappers.dyn_o libraries/integer-gmp/dist-
 install/build/cbits/cbits.dyn_o libraries/integer-gmp/gmp/objs/*.o
 `/usr/bin/find libraries/integer-gmp/dist-install/build -name
 "*_stub.dyn_o" -print` -shared -dynamic -dynload deploy -dylib-install-
 name /usr/local/lib/ghc-6.13.20100427/`basename "libraries/integer-gmp
 /dist-install/build/libHSinteger-gmp-0.2.0.0-ghc6.13.20100427.so" | sed
 's/^libHS//;s/[-]ghc.*//'`/`basename "libraries/integer-gmp/dist-
 install/build/libHSinteger-gmp-0.2.0.0-ghc6.13.20100427.so"` -no-auto-
 link-packages -packageghc-prim-0.2.0.0 -o libraries/integer-gmp/dist-
 install/build/libHSinteger-gmp-0.2.0.0-ghc6.13.20100427.so
 /usr/bin/ld: libraries/integer-gmp/gmp/objs/abs.o: relocation R_X86_64_32
 can not be used when making a shared object; recompile with -fPIC
 libraries/integer-gmp/gmp/objs/abs.o: could not read symbols: Bad value
 ...
 }}}

 According to Simon Marlow, it looks like it is building the in-tree gmp
 library rather than using a local one, and perhaps there is no shared
 version, so `gcc` picks up the static one and complains. There should be a
 shared gmp library when shared Haskell libraries are being built.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4022>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to