Skip to content

cctools-llvm: use cctools assembler on LLVM 11 and x86_64-darwin#242202

Merged
vcunat merged 2 commits intoNixOS:staging-nextfrom
reckenrode:cctools-llvm-fix
Jul 11, 2023
Merged

cctools-llvm: use cctools assembler on LLVM 11 and x86_64-darwin#242202
vcunat merged 2 commits intoNixOS:staging-nextfrom
reckenrode:cctools-llvm-fix

Conversation

@reckenrode
Copy link
Copy Markdown
Contributor

@reckenrode reckenrode commented Jul 8, 2023

Description of changes

This PR addresses the build failure in #241951 (comment) more generally by using the cctools assembler with LLVM 11 on x86_64-darwin (in case there are other packages that are sensitive to the differences in output it can produce depending on debug information).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jul 8, 2023
@reckenrode reckenrode mentioned this pull request Jul 8, 2023
12 tasks
@reckenrode reckenrode marked this pull request as draft July 8, 2023 06:38
@reckenrode
Copy link
Copy Markdown
Contributor Author

Converting to draft because it’s late, and I don’t have any more time tonight to dig into the ofborg failure.

@tjni tjni mentioned this pull request Jul 8, 2023
12 tasks
@wegank
Copy link
Copy Markdown
Member

wegank commented Jul 8, 2023

Looks like pkgsStatic.hello failed to evaluate on darwin, probably shouldn't linkManPages llvmPackages.llvm-manpages there? 🤔

@wegank wegank force-pushed the cctools-llvm-fix branch 4 times, most recently from 3d4a5f1 to 7e76bbc Compare July 8, 2023 09:04
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Jul 8, 2023
@wegank
Copy link
Copy Markdown
Member

wegank commented Jul 8, 2023

@ofborg build gcc gcc.passthru.tests

@reckenrode
Copy link
Copy Markdown
Contributor Author

Looks like pkgsStatic.hello failed to evaluate on darwin, probably shouldn't linkManPages llvmPackages.llvm-manpages there? 🤔

Shouldn’t that have caused an evaluation failure in the bootstrap PR? I’ll look at this more today. There’s also a Rust build failure I was trying to proactively fix that needs fixed too.

@reckenrode reckenrode changed the base branch from staging-next to staging July 8, 2023 16:53
@reckenrode
Copy link
Copy Markdown
Contributor Author

Since the fix has been merged into staging-next for the build failure, I’m going to retarget staging since this also touches a separate issue.

@reckenrode
Copy link
Copy Markdown
Contributor Author

@wegank Thanks for pushing the assembler stuff that was added to #242316 but dropped. I’ll add the GCC change to this later today and mark this PR as ready.

@wegank
Copy link
Copy Markdown
Member

wegank commented Jul 9, 2023

I checked the failure of texlive-core-big.bin-2022 this morning and found that ICU_LIBS was not correctly set. If the fix for icu triggers a world build on darwin, I'm thinking of retargeting this PR on staging-next.

@reckenrode
Copy link
Copy Markdown
Contributor Author

#242519 is the PR to fix the icu issue. I’m waiting on that PR because there are differences between x86_64-darwin and aarch64-darwin in how Libsystem and CF are built, which could cause unwanted paths in the output. I feel pretty confident, but I don’t want to mark it ready when x86_64-darwin could still be broken.

Clang 11 performs an optimization on x86_64 that is sensitive to the
presence of debug information. This results in GCC’s bootstrap failing
because it builds stage 2 with debug information and stage 3 without,
and the resulting objects do not match.

This patch uses the cctools assembler on LLVM 11 and x86_64-darwin while
using the integrated assembler on newer versions, which matches the
platform tools (Apple has uses the integrated assembler since Xcode 12).
@reckenrode
Copy link
Copy Markdown
Contributor Author

I pushed a commit to revert the GCC change since this PR addresses the issue generally for clang 11 on x86_64-darwin.

@reckenrode
Copy link
Copy Markdown
Contributor Author

@ofborg build gcc gcc.passthru.tests

@reckenrode reckenrode marked this pull request as ready for review July 9, 2023 19:30
@reckenrode reckenrode requested a review from matthewbauer as a code owner July 9, 2023 19:31
@reckenrode reckenrode changed the title cctools-llvm: fix targetPrefix for cross-compilation and GCC staging-next build failures cctools-llvm: use cctools assembler on LLVM 11 and x86_64-darwin Jul 9, 2023
@reckenrode reckenrode changed the base branch from staging to staging-next July 9, 2023 19:33
@reckenrode
Copy link
Copy Markdown
Contributor Author

@wegank I updated the description since the scope of the PR changed and rebased it on staging-next. The x86_64-darwin stdend still has 460 packages to build on my system before I can confirm there are no issues with the final stdenv.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin ofborg-internal-error Ofborg encountered an error labels Jul 9, 2023
@reckenrode
Copy link
Copy Markdown
Contributor Author

#242519 is ready for review. It fixes the ICU issue.

@vcunat
Copy link
Copy Markdown
Member

vcunat commented Jul 10, 2023

You have still time for reviewing this; I believe it's possible to include in the current staging-next a bit later.

Given our situation, I made Hydra build only aarch64-darwin for now, as that will keep it busy by itself for quite some time. And this PR does no rebuild on aarch64-darwin.

@vcunat vcunat merged commit b3d701e into NixOS:staging-next Jul 11, 2023
@cole-h cole-h removed the ofborg-internal-error Ofborg encountered an error label Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: darwin Running or building packages on Darwin 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants