| 11 Nov 2024 |
Randy Eckenrode | Since clang is a multi-target cross-compiler by default. | 23:23:54 |
Randy Eckenrode | Was there an issue on GitHub? I thought I got pinged, but my notifications aren’t showing anything. | 23:24:33 |
emily | there's a discourse thread | 23:26:27 |
emily | In reply to @reckenrode:matrix.org
Just to make sure I understand, the expectation is that clang.cc == pkgsCross.x86_64-darwin.buildPackages.clang.cc == pkgsCross.gnu64.buildPackages.clang.cc?
I think this is the idea, yes | 23:26:40 |
Randy Eckenrode | In reply to @emilazy:matrix.org I think this is the idea, yes I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.
| 23:27:03 |
emily | In reply to @reckenrode:matrix.org
preHook = preHook + lib.optionalString buildPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_BUILD=1
'' + lib.optionalString (hostPlatform.isDarwin || (!hostPlatform.isElf && !hostPlatform.isMacho)) ''
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
'' + lib.optionalString (hostPlatform.isDarwin && hostPlatform.isMacOS) ''
export MACOSX_DEPLOYMENT_TARGET=${hostPlatform.darwinMinVersion}
'' + lib.optionalString targetPlatform.isDarwin ''
export NIX_DONT_SET_RPATH_FOR_TARGET=1
'';
honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me | 23:27:14 |
emily | In reply to @reckenrode:matrix.org
I tried reverting the NIX_DONT_SET_RPATH_FOR_TARGET change. It didn’t seem to make a difference.
there's the nostdlibinc patch | 23:27:24 |
emily | try removing it entirely | 23:27:32 |
Randy Eckenrode | In reply to @emilazy:matrix.org honestly, just replacing all of that with NIX_DONT_SET_RPATH_aarch64_apple_darwin/NIX_DONT_SET_RPATH_x86_64_apple_darwin seems cool to me It’s exposing a cc-wrapper internal detail, which is also different on static Darwin builds. | 23:27:38 |
Randy Eckenrode | In reply to @emilazy:matrix.org try removing it entirely Doesn’t matter either. | 23:28:47 |
Randy Eckenrode | In reply to @emilazy:matrix.org try removing it entirely * | 23:28:54 |
Randy Eckenrode | Does every clang dependency have to be audited for targetPlatform stuff?
| 23:29:59 |
Randy Eckenrode | Note that this includes my “Darwin as useLLVM” work.
| 23:30:30 |
emily | well, ideally targetPlatform would be null so they would have no way of depending on it | 23:30:58 |
emily | I'm curious what nix-diff says though | 23:31:09 |
Randy Eckenrode | Output of nix-diff $(nix-instantiate . -A clang.cc) $(nix-instantiate . -A pkgsCross.gnu64.buildPackages.clang.cc) with the NIX_DONT_SET_RPATH_FOR_TARGET change reverted and the -nostdlibinc patches dropped.
https://gist.github.com/reckenrode/be122136283d8ed5a05d52f2f57d8809
| 23:41:53 |
emily | the bootstrap stuff seems solvable | 23:43:15 |
emily | if we used the earlier stage compilers to bootstrap pkgsCross | 23:43:26 |
emily | I think comparing two pkgsCrosses would be more enlightening though | 23:43:39 |
emily | since that's still significantly more sharing | 23:43:42 |
emily | and would eliminate that difference | 23:43:47 |
emily | like gnu64 and aarch64-multiplatform instead | 23:43:56 |
emily | (or I guess aarch64-multiplatform and however x86_64-darwin is spelled, to capture OS differences) | 23:45:44 |
| 12 Nov 2024 |
Randy Eckenrode | I can check in a bit. | 00:55:17 |
sterni | emily: mainly the LLVM LLVMGold.so thing depending on GNU binutils or not, could be interesting to remove that somehow | 12:18:23 |
sterni | I think sharing between normal clang and cross clang is a bigger win though | 12:18:43 |
sterni | Ideally you can just pass useLLVM and never need to rebuild anything big | 12:19:06 |
sterni | In reply to @emilazy:matrix.org well, ideally targetPlatform would be null so they would have no way of depending on it that doesn't make sense, you always have a target platform in a package set and Nix can figure out whether it needs rebuilding or not on its own | 12:19:58 |
sterni | subtle problems are usually introduced elsewhere, so nulling it for some derivations isn't really solving anything | 12:20:45 |
sterni | if you care about it, just add a test somewhere that comparse outPaths i'd say | 12:21:04 |