[PATCH] D139672: [lld-macho] Update -adhoc_codesign default
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 8 13:49:23 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGbd570709c06a: [lld-macho] Update -adhoc_codesign default (authored by keith).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D139672/new/
https://reviews.llvm.org/D139672
Files:
lld/MachO/Driver.cpp
lld/test/MachO/adhoc-codesign.s
Index: lld/test/MachO/adhoc-codesign.s
===================================================================
--- lld/test/MachO/adhoc-codesign.s
+++ lld/test/MachO/adhoc-codesign.s
@@ -57,11 +57,11 @@
# RUN: %no-arg-lld -arch arm64 -platform_version ios-simulator 14.0 15.0 -execute -o %t/out %t/main-arm64-sim.o -syslibroot %S/Inputs/iPhoneSimulator.sdk -lSystem
-# RUN: llvm-objdump --macho --all-headers %t/out | FileCheck --check-prefix=NO-ADHOC %s
+# RUN: llvm-objdump --macho --all-headers %t/out | FileCheck --check-prefix=ADHOC %s
# RUN: %no-arg-lld -arch arm64 -platform_version ios-simulator 14.0 15.0 -dylib -o %t/out %t/foo-arm64-sim.o
-# RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s
+# RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s
# RUN: %no-arg-lld -arch arm64 -platform_version ios-simulator 14.0 15.0 -bundle -o %t/out %t/foo-arm64-sim.o
-# RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=NO-ADHOC %s
+# RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s
# RUN: %no-arg-lld -arch arm64 -platform_version ios-simulator 14.0 15.0 -execute -adhoc_codesign -o %t/out %t/main-arm64-sim.o -syslibroot %S/Inputs/iPhoneSimulator.sdk -lSystem
# RUN: llvm-objdump --macho --all-headers %t/out| FileCheck --check-prefix=ADHOC %s
Index: lld/MachO/Driver.cpp
===================================================================
--- lld/MachO/Driver.cpp
+++ lld/MachO/Driver.cpp
@@ -936,6 +936,15 @@
config->arch() == AK_arm64_32);
}
+static bool shouldAdhocSignByDefault(Architecture arch, PlatformType platform) {
+ if (arch != AK_arm64 && arch != AK_arm64e)
+ return false;
+
+ return platform == PLATFORM_MACOS || platform == PLATFORM_IOSSIMULATOR ||
+ platform == PLATFORM_TVOSSIMULATOR ||
+ platform == PLATFORM_WATCHOSSIMULATOR;
+}
+
static bool dataConstDefault(const InputArgList &args) {
static const std::array<std::pair<PlatformType, VersionTuple>, 5> minVersion =
{{{PLATFORM_MACOS, VersionTuple(10, 15)},
@@ -1735,8 +1744,7 @@
config->adhocCodesign = args.hasFlag(
OPT_adhoc_codesign, OPT_no_adhoc_codesign,
- (config->arch() == AK_arm64 || config->arch() == AK_arm64e) &&
- config->platform() == PLATFORM_MACOS);
+ shouldAdhocSignByDefault(config->arch(), config->platform()));
if (args.hasArg(OPT_v)) {
message(getLLDVersion(), lld::errs());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139672.481441.patch
Type: text/x-patch
Size: 2496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221208/74f5df5a/attachment.bin>
More information about the llvm-commits
mailing list