This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG17386cb4dc89: [clang][Driver] Make multiarch output file basenames reproducible (authored by keith).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D111269/new/ https://reviews.llvm.org/D111269 Files: clang/lib/Driver/Driver.cpp clang/test/Driver/darwin-dsymutil.c Index: clang/test/Driver/darwin-dsymutil.c =================================================================== --- clang/test/Driver/darwin-dsymutil.c +++ clang/test/Driver/darwin-dsymutil.c @@ -42,6 +42,16 @@ // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "[[outfile]]" // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["[[outfile]]"], output: "[[dsymfile]]" +// Check output name derivation for multiple -arch options. +// +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME < %t %s +// +// CHECK-MULTIARCH-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" + // Check that we only use dsymutil when needed. // // RUN: touch %t.o Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ clang/lib/Driver/Driver.cpp @@ -4960,7 +4960,13 @@ return ""; } } else { - TmpName = GetTemporaryPath(Split.first, Suffix); + if (MultipleArchs && !BoundArch.empty()) { + TmpName = GetTemporaryDirectory(Split.first); + llvm::sys::path::append(TmpName, + Split.first + "-" + BoundArch + "." + Suffix); + } else { + TmpName = GetTemporaryPath(Split.first, Suffix); + } } return C.addTempFile(C.getArgs().MakeArgString(TmpName)); }
Index: clang/test/Driver/darwin-dsymutil.c =================================================================== --- clang/test/Driver/darwin-dsymutil.c +++ clang/test/Driver/darwin-dsymutil.c @@ -42,6 +42,16 @@ // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: [{{.*}}], output: "[[outfile]]" // CHECK-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Dsymutil", inputs: ["[[outfile]]"], output: "[[dsymfile]]" +// Check output name derivation for multiple -arch options. +// +// RUN: %clang -target x86_64-apple-darwin10 \ +// RUN: -arch x86_64 -arch arm64 -ccc-print-bindings %s 2> %t +// RUN: FileCheck --check-prefix=CHECK-MULTIARCH-OUTPUT-NAME < %t %s +// +// CHECK-MULTIARCH-OUTPUT-NAME: "x86_64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Linker", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-arm64.o"], output: "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out" +// CHECK-MULTIARCH-OUTPUT-NAME: "arm64-apple-darwin10" - "darwin::Lipo", inputs: ["{{.*}}{{/|\\}}darwin-dsymutil-x86_64.out", "{{.*}}{{/|\\}}darwin-dsymutil-arm64.out"], output: "a.out" + // Check that we only use dsymutil when needed. // // RUN: touch %t.o Index: clang/lib/Driver/Driver.cpp =================================================================== --- clang/lib/Driver/Driver.cpp +++ clang/lib/Driver/Driver.cpp @@ -4960,7 +4960,13 @@ return ""; } } else { - TmpName = GetTemporaryPath(Split.first, Suffix); + if (MultipleArchs && !BoundArch.empty()) { + TmpName = GetTemporaryDirectory(Split.first); + llvm::sys::path::append(TmpName, + Split.first + "-" + BoundArch + "." + Suffix); + } else { + TmpName = GetTemporaryPath(Split.first, Suffix); + } } return C.addTempFile(C.getArgs().MakeArgString(TmpName)); }
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits