Skip to content
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

rocmPackages.llvm.clang: remove -nostdlibinc flag #370180

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ stdenvNoCC.mkDerivation {
# no `/usr/include`, there’s essentially no risk to dropping
# the flag there. See discussion in NixOS/nixpkgs#191152.
#
+ optionalString ((cc.isClang or false) && !targetPlatform.isDarwin) ''
+ optionalString ((cc.isClang or false) && !(cc.isROCm or false) && !targetPlatform.isDarwin) ''
Copy link
Member

Choose a reason for hiding this comment

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

Could this be e.g. !targetPlatform.isROCm? Or is ROCm not actually using the proper cross‐compilation machinery?

LGTM as a temporary fix, anyway.

Copy link
Member

Choose a reason for hiding this comment

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

Offload code is treated as an auxiliary arch and doesn't fit into the current cross machinery.

eg:

host, target = x86-64
auxiliary-targets = [gfx908, gfx90a, ...]

auxiliary target code objects are embedded in the same output library/bin in a separate section.

Copy link
Member

Choose a reason for hiding this comment

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

I see; sounds complicated :)

This seems fine for now.

Copy link
Member Author

@collares collares Jan 3, 2025

Choose a reason for hiding this comment

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

From what I can tell it isn't using the cross-compilation machinery, but to be honest I know nothing about ROCm (I'm just here because Steam broke). Maybe one of the maintainers can chime in (Edit: I hadn't seen the above comments when I wrote this comment, sorry!).

Thanks for the review!

echo " -nostdlibinc" >> $out/nix-support/cc-cflags
''

Expand Down
1 change: 1 addition & 0 deletions pkgs/development/rocm-modules/5/llvm/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ stdenv.mkDerivation (finalAttrs: {
passthru = {
isLLVM = targetDir == "llvm";
isClang = targetDir == "clang" || builtins.elem "clang" targetProjects;
isROCm = true;

updateScript = rocmUpdateScript {
name = finalAttrs.pname;
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/rocm-modules/5/llvm/stage-3/clang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ wrapCCWith rec {
'';

passthru.isClang = true;
passthru.isROCm = true;
});

gccForLibs = stdenv.cc.cc;

extraPackages = [
llvm
lld
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/rocm-modules/6/llvm/base.nix
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ stdenv.mkDerivation (finalAttrs: {
passthru = {
isLLVM = targetDir == "llvm";
isClang = targetDir == "clang" || builtins.elem "clang" targetProjects;
isROCm = true;

updateScript = rocmUpdateScript {
name = finalAttrs.pname;
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/rocm-modules/6/llvm/stage-3/clang.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ wrapCCWith rec {
'';

passthru.isClang = true;
passthru.isROCm = true;
});

gccForLibs = stdenv.cc.cc;

extraPackages = [
llvm
lld
Expand Down
Loading