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

netbsd.mkDerivation: fix darwin build #59278

Merged
merged 2 commits into from Apr 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion pkgs/os-specific/bsd/netbsd/default.nix
Expand Up @@ -51,7 +51,7 @@ let

AR = "${stdenv'.cc.targetPrefix or ""}ar";
CC = "${stdenv'.cc.targetPrefix or ""}cc";
CPP = if (stdenv'.cc.isClang or false) then "clang-cpp" else "cpp";
CPP = "${stdenv'.cc.targetPrefix or ""}cpp";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ericson2314 should cpp be prefixed? I feel like it is one case where we don't want the prefixed one. Everyone target could use the same cpp.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know much about cross stuff, but I think cpp knows about the target to be able to define macros like __i386__ and such (e.g. https://github.com/openbsd/src/blob/master/libexec/tradcpp/config.h)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just safer to prefix

CXX = "${stdenv'.cc.targetPrefix or ""}c++";
LD = "${stdenv'.cc.targetPrefix or ""}ld";
STRIP = "${stdenv'.cc.targetPrefix or ""}strip";
Expand All @@ -65,6 +65,8 @@ let
platforms = platforms.unix;
license = licenses.bsd2;
};
} // lib.optionalAttrs stdenv'.isDarwin {
MKRELRO = "no";
} // lib.optionalAttrs (stdenv'.cc.isClang or false) {
HAVE_LLVM = lib.head (lib.splitString "." (lib.getVersion stdenv'.cc.cc));
} // lib.optionalAttrs (stdenv'.cc.isGNU or false) {
Expand Down