Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
linking: Don't use --ghc-option=-optl-lm, use extra-libraries: m in…
Browse files Browse the repository at this point in the history
…stead.

Fixes

  ld.gold: fatal error: cannot mix -r with dynamic object

error for dynamic linking.

See NixOS/nixpkgs#24692 (comment)
  • Loading branch information
nh2 committed Jul 21, 2017
1 parent 3740762 commit 8f81fb0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cardano-sl.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ executable cardano-node
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down
2 changes: 0 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ in ((import ./pkgs { inherit pkgs; }).override {
"-f-asserts"
"-f-dev-mode"
"-fwith-explorer"
# https://github.com/NixOS/nixpkgs/pull/24692#issuecomment-306509337
"--ghc-option=-optl-lm"
];
});
cardano-sl-static = justStaticExecutables self.cardano-sl;
Expand Down
22 changes: 22 additions & 0 deletions tools/cardano-sl-tools.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ executable cardano-analyzer
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down Expand Up @@ -115,6 +117,8 @@ executable cardano-wallet-hs2purs
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down Expand Up @@ -187,6 +191,8 @@ executable cardano-dht-keygen
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down Expand Up @@ -245,6 +251,8 @@ executable cardano-swagger
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: NoImplicitPrelude
BangPatterns
Expand Down Expand Up @@ -281,6 +289,8 @@ executable cardano-checks
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: OverloadedStrings
BangPatterns
Expand Down Expand Up @@ -314,6 +324,8 @@ executable cardano-genupdate
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: OverloadedStrings
NoImplicitPrelude
Expand Down Expand Up @@ -361,6 +373,8 @@ executable cardano-keygen
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down Expand Up @@ -419,6 +433,8 @@ executable cardano-launcher
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: OverloadedStrings
RecordWildCards
Expand Down Expand Up @@ -457,6 +473,8 @@ executable cardano-addr-convert
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: DeriveDataTypeable
DeriveGeneric
Expand Down Expand Up @@ -503,6 +521,8 @@ executable cardano-cli-docs
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: NoImplicitPrelude
BangPatterns
Expand Down Expand Up @@ -558,6 +578,8 @@ executable cardano-block-gen
if os(linux)
ghc-options: -optl-fuse-ld=gold
ld-options: -fuse-ld=gold
-- ld.gold needs these explicitly
extra-libraries: m

default-extensions: RecordWildCards
NoImplicitPrelude
Expand Down

0 comments on commit 8f81fb0

Please sign in to comment.