Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clodl fails on executables built with ghc-8.10.2 #34

Open
facundominguez opened this issue Nov 23, 2020 · 3 comments
Open

clodl fails on executables built with ghc-8.10.2 #34

facundominguez opened this issue Nov 23, 2020 · 3 comments

Comments

@facundominguez
Copy link
Member

facundominguez commented Nov 23, 2020

ERROR: /home/centos/clodl/BUILD:54:16: Linking of rule '//:libclotest_wrapper.so' failed (Exit 1) gcc failed: error executing command /nix/store/8pbwywcj6vbswz7xmy2dh716x8blgh8w-gcc-wrapper-9.3.0/
bin/gcc @bazel-out/k8-fastbuild/bin/libclotest_wrapper.so-2.params

Use --sandbox_debug to see verbose messages from the sandbox
/nix/store/p792j5f44l3f0xi7ai5jllwnxqwnka88-binutils-2.31.1/bin/ld.gold: error: bazel-out/k8-fastbuild/bin/_solib_k8/_U_S_S_Clibclotest_Uwrapper.so___Uclotest_UUsolib/libhello-hs.so: unsupported E
LF file type 2
collect2: error: ld returned 1 exit status
Target //:clotest failed to build
Use --verbose_failures to see the command lines of failed build steps.

Seems related to this:
tweag/rules_haskell#1418

GHC is passing -no-pie to the linker when building the haskell binary, and the subsequent attempt to link the wrapper fails probably because of that.

@facundominguez
Copy link
Member Author

It's rules_haskell who is adding -no-pie to the linking flags. Commenting this line makes clodl build fine: https://github.com/tweag/rules_haskell/blob/42b8b43623b82a6b7cfb151f01986735a135e0a9/haskell/private/actions/link.bzl#L113

@aherrmann
Copy link
Member

Once GHC 8.8.5, 8.10.3, and 9.0.1 are released we'll be able to fix this in rules_haskell.

@facundominguez facundominguez changed the title clodl fails on libraries built with ghc-8.10.2 clodl fails on executables built with ghc-8.10.2 Nov 24, 2020
facundominguez added a commit to tweag/rules_haskell that referenced this issue Dec 2, 2020
facundominguez added a commit to tweag/rules_haskell that referenced this issue Dec 2, 2020
@facundominguez
Copy link
Member Author

I made a temporary hack until this is fixed. https://github.com/tweag/rules_haskell/compare/fd/no-pie-hack
This branch should be removed when this is closed.

facundominguez added a commit that referenced this issue Dec 2, 2020
facundominguez added a commit to tweag/rules_haskell that referenced this issue Dec 4, 2020
facundominguez added a commit to tweag/rules_haskell that referenced this issue Jan 5, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 8, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 10, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 19, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 22, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 24, 2021
facundominguez added a commit to tweag/rules_haskell that referenced this issue Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants