Skip to content

Comments

swiftc: pass -Xcc before -march#301103

Merged
2 commits merged intoNixOS:masterfrom
Samasaur1:fix-swift
Apr 3, 2024
Merged

swiftc: pass -Xcc before -march#301103
2 commits merged intoNixOS:masterfrom
Samasaur1:fix-swift

Conversation

@Samasaur1
Copy link
Member

@Samasaur1 Samasaur1 commented Apr 3, 2024

Description of changes

Adds the -Xcc flag before the -march flag passed to swiftc.

#291901 changed how clang got the -march flag, which caused swiftc to get that flag as well. However, swiftc needs -Xcc before -march because it's a clang flag, not a swift flag.

We could also simply prevent the -march flag from being passed to swiftc. I'm not familiar with exactly what this flag does, so I'm choosing to leave it in. However, note that #291901 seems to only have intended to add this flag to clang and accidentally added it to Swift, so maybe we do just want to remove it.

I know adding -Xcc made Swift able to build one of my Swift packages on aarch64-darwin, and I assume removing the flag will as well.

Closes #295322.
May supercede #296082.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 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.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Apr 3, 2024
@Samasaur1 Samasaur1 requested a review from Ericson2314 as a code owner April 3, 2024 03:10
@Samasaur1 Samasaur1 requested a review from a user April 3, 2024 05:50
@alyssais
Copy link
Member

alyssais commented Apr 3, 2024

Haven't reviewed in depth because I don't know about swift, but I like the approach. -march tells the compiler to optimise for a specific architecture, so we probably want it for Swift.

@ghost
Copy link

ghost commented Apr 3, 2024

@ofborg build swift

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 3, 2024
@ghost
Copy link

ghost commented Apr 3, 2024

x64/aarch64 darwin builds pass on community builder (ofborg timesout)

@ghost ghost merged commit facc176 into NixOS:master Apr 3, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: swift for aarch64

3 participants