Skip to content

Commit a2dddf2

Browse files
committed
[LinkerWrapper] Update deprecated fatbin command line option
1 parent 227bc57 commit a2dddf2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/test/Driver/linker-wrapper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ __attribute__((visibility("protected"), used)) int x;
102102

103103
// CUDA: clang{{.*}} -o [[IMG_SM70:.+]] -dumpdir a.out.nvptx64.sm_70.img. --target=nvptx64-nvidia-cuda -march=sm_70
104104
// CUDA: clang{{.*}} -o [[IMG_SM52:.+]] -dumpdir a.out.nvptx64.sm_52.img. --target=nvptx64-nvidia-cuda -march=sm_52
105-
// CUDA: fatbinary{{.*}}-64 --create {{.*}}.fatbin --image=profile=sm_70,file=[[IMG_SM70]] --image=profile=sm_52,file=[[IMG_SM52]]
105+
// CUDA: fatbinary{{.*}}-64 --create {{.*}}.fatbin --image3=kind=elf,sm=70,file=[[IMG_SM70]] --image3=kind=elf,sm=52,file=[[IMG_SM52]]
106106
// CUDA: usr/bin/ld{{.*}} {{.*}}.openmp.image.{{.*}}.o {{.*}}.cuda.image.{{.*}}.o
107107

108108
// RUN: llvm-offload-binary -o %t.out \
@@ -236,7 +236,7 @@ __attribute__((visibility("protected"), used)) int x;
236236
// RUN: %t.o -o a.out 2>&1 | FileCheck %s --check-prefix=RELOCATABLE-LINK-CUDA
237237

238238
// RELOCATABLE-LINK-CUDA: clang{{.*}} -o {{.*}}.img -dumpdir a.out.nvptx64.sm_89.img. --target=nvptx64-nvidia-cuda
239-
// RELOCATABLE-LINK-CUDA: fatbinary{{.*}} -64 --create {{.*}}.fatbin --image=profile=sm_89,file={{.*}}.img
239+
// RELOCATABLE-LINK-CUDA: fatbinary{{.*}} -64 --create {{.*}}.fatbin --image3=kind=elf,sm=89,file={{.*}}.img
240240
// RELOCATABLE-LINK-CUDA: /usr/bin/ld.lld{{.*}}-r
241241
// RELOCATABLE-LINK-CUDA: llvm-objcopy{{.*}}a.out --remove-section .llvm.offloading
242242

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,8 +396,8 @@ fatbinary(ArrayRef<std::pair<StringRef, StringRef>> InputFiles,
396396
CmdArgs.push_back("--create");
397397
CmdArgs.push_back(*TempFileOrErr);
398398
for (const auto &[File, Arch] : InputFiles)
399-
CmdArgs.push_back(
400-
Args.MakeArgString("--image=profile=" + Arch + ",file=" + File));
399+
CmdArgs.push_back(Args.MakeArgString(
400+
"--image3=kind=elf,sm=" + Arch.drop_front(3) + ",file=" + File));
401401

402402
if (Error Err = executeCommands(*FatBinaryPath, CmdArgs))
403403
return std::move(Err);

0 commit comments

Comments
 (0)