Skip to content

use ld specified by "ghc --info" by default #1528

Closed
@rwbarton

Description

@rwbarton

The ghc testsuite tests "cabal0{1,3,4}" fail in my cross-compilation setup (i686 cross-compiler built on amd64) because Cabal tries to link with the system linker with no special options.

The ghc testsuite could pass the appropriate --with-ld option to cabal, but wouldn't it make sense for Cabal to use the ld binary and ld flags specified by ghc --info, using the version of ghc specified by the --with-compiler option?

Specifically, the testsuite does this:

'/home/rwbarton/dist/ghc-i686/inplace/bin/ghc-stage2' --make -o setup Setup.lhs -v0
'/home/rwbarton/dist/ghc-i686/inplace/bin/ghc-pkg' init local.db
./setup configure -v0 --prefix=/home/rwbarton/dist/ghc-i686/testsuite/tests/cabal/cabal01/install --with-compiler='/home/rwbarton/dist/ghc-i686/inplace/bin/ghc-stage2' --ghc-options='-fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db' --with-hc-pkg='/home/rwbarton/dist/ghc-i686/inplace/bin/ghc-pkg' --package-db=local.db --enable-library-vanilla --disable-library-profiling --enable-shared

and the linker complains because it is expecting an x86_64 elf object file (I think). The output of /home/rwbarton/dist/ghc-i686/inplace/bin/ghc-stage2 --info is:

...
 ,("ld command","/home/rwbarton/bin/i686/ld")
 ,("ld flags","")
 ,("ld supports compact unwind","YES")
 ,("ld supports build-id","YES")
 ,("ld supports filelist","NO")
 ,("ld is GNU ld","YES")
...

and when I manually add --with-ld=/home/rwbarton/bin/i686/ld to the setup command, it completes successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions