-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
cctools-port 949.0.1 broke various builds on macOS #101330
Comments
Diff if someone needs it quickly. I couldn't find the root cause and it is breaking a lot for darwin so we maybe should just take this fix. diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 1fa5ea0aecfb..8fbbdefb1afc 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -126,6 +126,7 @@ let
"--with-out-ext=tk"
# on yosemite, "generating encdb.h" will hang for a very long time without this flag
"--with-setjmp-type=setjmp"
+ # fix error after upgrading cctools-port to 949.0.1
+ # https://github.com/NixOS/nixpkgs/issues/101330
+ "LDFLAGS=-Wl,-w"
]
++ op (stdenv.hostPlatform != stdenv.buildPlatform)
"--with-baseruby=${buildRuby}"; |
@jonringer I think this is also causing haskellPackages.trifecta to fail which is blocking the unstable channel 👀 https://hydra.nixos.org/build/129070963/nixlog/1 It seems to me that there is a deeper issue here involving the new cctools and how they are being invoked:
|
I think the correct ping is @NixOS/darwin-maintainers but I don't seem to have the clearance ;) |
cc @NixOS/darwin-maintainers |
I'm currently testing out this patch to disable the warning - ruby is working, haskellPackages.trifecta diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp
index 5b8c755..1b8ebf8 100644
--- a/cctools/ld64/src/ld/Options.cpp
+++ b/cctools/ld64/src/ld/Options.cpp
@@ -3187,8 +3187,6 @@ void Options::parse(int argc, const char* argv[])
}
if (fPlatforms.contains(info->platform)) {
std::string existingVersionStr = getVersionString32(fPlatforms.minOS(info->platform));
- warning("passed two min versions (%s, %s) for platform %s. Using %s.",
- existingVersionStr.c_str(), versStr, info->printName, versStr);
fPlatforms.updateMinVersion(info->platform, minVersValue);
fPlatforms.updateSDKVersion(info->platform, SDKValue);
} else {
@@ -3210,8 +3208,6 @@ void Options::parse(int argc, const char* argv[])
}
if (fPlatforms.contains(info->platform)) {
std::string existingVersionStr = getVersionString32(fPlatforms.minOS(info->platform));
- warning("passed two min versions (%s, %s) for platform %s. Using %s.",
- existingVersionStr.c_str(), versStr, info->printName, versStr);
fPlatforms.updateMinVersion(info->platform, value);
} else {
fPlatforms.insert(ld::PlatformVersion(info->platform, value)); |
Seems that the root cause is mentioned in the |
I guess I'm still not really clear on who's in the wrong here. Is cctools being overly strict by adding this warning? Or is clang overstepping its role by auto-adding extra flags? |
I think #93596 (comment) means that this is the problem
|
oops forgot the ping |
Ok, here's a patch to skip clang's diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix
index 905ec862ad7..c5df66bd983 100644
--- a/pkgs/development/compilers/llvm/7/clang/default.nix
+++ b/pkgs/development/compilers/llvm/7/clang/default.nix
@@ -43,6 +43,7 @@ let
./purity.patch
# make clang -xhip use $PATH to find executables
./HIP-use-PATH-7.patch
+ ./dont-add-args.patch
];
postPatch = ''
diff --git a/pkgs/development/compilers/llvm/7/clang/dont-add-args.patch b/pkgs/development/compilers/llvm/7/clang/dont-add-args.patch
new file mode 100644
index 00000000000..f164ebe1b73
--- /dev/null
+++ b/pkgs/development/compilers/llvm/7/clang/dont-add-args.patch
@@ -0,0 +1,14 @@
+diff --git a/lib/Driver/ToolChains/Darwin.cpp b/lib/Driver/ToolChains/Darwin.cpp
+index dc540688d2b..1f73c81121c 100644
+--- a/lib/Driver/ToolChains/Darwin.cpp
++++ b/lib/Driver/ToolChains/Darwin.cpp
+@@ -326,9 +326,6 @@ void darwin::Linker::AddLinkArgs(Compilation &C, const ArgList &Args,
+ Args.AddAllArgs(CmdArgs, options::OPT_image__base);
+ Args.AddAllArgs(CmdArgs, options::OPT_init);
+
+- // Add the deployment target.
+- MachOTC.addMinVersionArgs(Args, CmdArgs);
+-
+ Args.AddLastArg(CmdArgs, options::OPT_nomultidefs);
+ Args.AddLastArg(CmdArgs, options::OPT_multi__module);
+ Args.AddLastArg(CmdArgs, options::OPT_single__module); |
May as well keep this open until the main problem is resolved. |
Another option that seems to work: removing our extra -macosx_version_min from bintools-wrapper since it is already added by clang. Builds ruby and haskellPackages.trifecta. diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix
index 786f0f9c598..a3f1f54d5c5 100644
--- a/pkgs/build-support/bintools-wrapper/default.nix
+++ b/pkgs/build-support/bintools-wrapper/default.nix
@@ -252,7 +252,7 @@ stdenv.mkDerivation {
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
+ optionalString stdenv.targetPlatform.isMacOS ''
- echo "-macosx_version_min 10.12 -sdk_version 10.12 -no_uuid" >> $out/nix-support/libc-ldflags-before
+ echo "-sdk_version 10.12 -no_uuid" >> $out/nix-support/libc-ldflags-before
''
## So to recap, the options that have been tested to work so far are
|
Also encountering this issue when building pyobjc. |
I tested the bintool option which caused a rebuilt of literally everything. I think this is maybe the best approach in the long term but it is totally unsuitable for local rebuilds. Next I tried the cctools patch which only caused the Darwin Frameworks, perl and some others to rebuild which could work locally. Same with the clang. |
Pinging @NixOS/darwin-maintainers again, also @Ericson2314 who may be able to help? |
Opened a PR: #103053 |
This is also breaking |
Describe the bug
Ruby configure step has been failing on darwin since 3c6bd61 with the following error:
This appears to be due to the new linker warning
ld: warning: passed two min versions (10.12.0, 10.12) for platform macOS
, as addingLDFLAGS="-Wl,-w"
to ruby allows it to build successfully.git bisect log:
Further bisection on the cctools-port repo itself is unproductive, simply leading to the mass update tpoechtrager/cctools-port@466063cSee #101330 (comment) for the offending code in cctools.Hydra build
https://hydra.nixos.org/build/128219205
Notify maintainers
cctools: @matthewbauer
ruby: @vrthra @manveru @marsam
The text was updated successfully, but these errors were encountered: