Skip to content

cctools-llvm: match binutils targetPrefix definition#242316

Merged
wegank merged 1 commit intoNixOS:staging-nextfrom
wegank:reckenrode-cctools-llvm-fix
Jul 9, 2023
Merged

cctools-llvm: match binutils targetPrefix definition#242316
wegank merged 1 commit intoNixOS:staging-nextfrom
wegank:reckenrode-cctools-llvm-fix

Conversation

@wegank
Copy link
Member

@wegank wegank commented Jul 8, 2023

Description of changes

#242202 retargeted staging, but this still worth merging into staging-next.

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 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 8, 2023
Copy link
Contributor

@reckenrode reckenrode left a comment

Choose a reason for hiding this comment

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

Thanks for opening this. lgtm. I’ll rebase and keep #242202 focused on the general fix to the assembler issue that affected GCC.

@wegank
Copy link
Member Author

wegank commented Jul 8, 2023

@ofborg build nixStatic

@wegank

This comment was marked as resolved.

@wegank wegank force-pushed the reckenrode-cctools-llvm-fix branch from 4475db6 to 7687058 Compare July 8, 2023 23:09
@wegank wegank force-pushed the reckenrode-cctools-llvm-fix branch from 7687058 to 6ebedad Compare July 8, 2023 23:13
@reckenrode
Copy link
Contributor

reckenrode commented Jul 9, 2023

nixStatic is failing to build for me.

At first I noticed the following:

find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory
find: 'install_name_tool': No such file or directory

The fixLibsystemRefs hook doesn’t take targetPrefix into account, which causes it to fail when sandboxing is enabled and the system install_name_tool is not available. I’ll be opening a PR to fix that issue. Edit: Opened #242399.

The other issue is it fails during installCheckPhase, but it’s not really clear why. There are crash reports in Console.app with the following backtrace for nix-store. Interestingly, it does not crash if I run the build manually via nix develop <failing .drv>.

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   ???                           	       0x1017fdb94 std::__1::basic_ostream<char, std::__1::char_traits<char>>::sentry::sentry(std::__1::basic_ostream<char, std::__1::char_traits<char>>&) + 28
1   ???                           	       0x100c5cedc std::__1::basic_ostream<char, std::__1::char_traits<char>>& std::__1::__put_character_sequence<char, std::__1::char_traits<char>>(std::__1::basic_ostream<char, std::__1::char_traits<char>>&, char const*, unsigned long) + 68
2   ???                           	       0x100f7d730 nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4::operator()() const + 164
3   ???                           	       0x100f7d68c decltype(std::__1::forward<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4&>(fp)()) std::__1::__invoke<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4&>(nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4&) + 12
4   ???                           	       0x100f7d680 void std::__1::__invoke_void_return_wrapper<void>::__call<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4&>(nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4&) + 12
5   ???                           	       0x100f7d674 std::__1::__function::__alloc_func<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4, std::__1::allocator<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4>, void ()>::operator()() + 12
6   ???                           	       0x100f7d5f0 std::__1::__function::__func<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4, std::__1::allocator<nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&)::$_4>, void ()>::operator()() + 16
7   ???                           	       0x100f75c1c nix::doFork(bool, std::__1::function<void ()>) + 44
8   ???                           	       0x100f757bc nix::startProcess(std::__1::function<void ()>, nix::ProcessOptions const&) + 92
9   ???                           	       0x100f764c0 nix::runProgram2(nix::RunOptions const&) + 436
10  ???                           	       0x100f76268 nix::runProgram(nix::RunOptions&&) + 72
11  ???                           	       0x10143877c nix::Settings::getDefaultExtraPlatforms() + 340
12  ???                           	       0x101433434 nix::Settings::Settings() + 14832
13  ???                           	       0x1014cc740 _GLOBAL__sub_I_globals.cc + 28
14  dyld                          	       0x1a95041e0 invocation function for block in dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const::$_0::operator()() const + 168
15  dyld                          	       0x1a9545c60 invocation function for block in dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 172
16  dyld                          	       0x1a95391a4 invocation function for block in dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 528
17  dyld                          	       0x1a94e42d8 dyld3::MachOFile::forEachLoadCommand(Diagnostics&, void (load_command const*, bool&) block_pointer) const + 296
18  dyld                          	       0x1a95381cc dyld3::MachOFile::forEachSection(void (dyld3::MachOFile::SectionInfo const&, bool, bool&) block_pointer) const + 192
19  dyld                          	       0x1a953acfc dyld3::MachOFile::forEachInitializerPointerSection(Diagnostics&, void (unsigned int, unsigned int, bool&) block_pointer) const + 160
20  dyld                          	       0x1a9545904 dyld3::MachOAnalyzer::forEachInitializer(Diagnostics&, dyld3::MachOAnalyzer::VMAddrConverter const&, void (unsigned int) block_pointer, void const*) const + 432
21  dyld                          	       0x1a9500864 dyld4::Loader::findAndRunAllInitializers(dyld4::RuntimeState&) const + 448
22  dyld                          	       0x1a9500c18 dyld4::Loader::runInitializersBottomUp(dyld4::RuntimeState&, dyld3::Array<dyld4::Loader const*>&) const + 220
23  dyld                          	       0x1a950426c dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const::$_1::operator()() const + 112
24  dyld                          	       0x1a9500d98 dyld4::Loader::runInitializersBottomUpPlusUpwardLinks(dyld4::RuntimeState&) const + 304
25  dyld                          	       0x1a9524984 dyld4::APIs::runAllInitializersForMain() + 468
26  dyld                          	       0x1a94e92d0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3480
27  dyld                          	       0x1a94e7e18 start + 1964

@reckenrode
Copy link
Contributor

@ofborg build nixStatic

@reckenrode
Copy link
Contributor

The ofborg error is strange. I disabled the sandbox, and nixStatic builds for me. That doesn’t seem like it should be necessary when regular nix builds fine, but it was. Even when I had the sandbox enabled, my failure was in installCheckPhase.

@reckenrode
Copy link
Contributor

Result of nixpkgs-review pr 242316 run on aarch64-darwin 1

2 packages built:
  • nixStatic
  • nixStatic.dev

@wegank wegank merged commit c5fd953 into NixOS:staging-next Jul 9, 2023
@wegank wegank deleted the reckenrode-cctools-llvm-fix branch July 9, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments