[lld] [LLD, MachO] Default objc_relative_method_lists on MacOS11+/iOS14+ (PR #101360)

Daniel Bertalan via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 12:32:48 PDT 2024


================
@@ -1140,12 +1140,20 @@ static bool shouldEmitRelativeMethodLists(const InputArgList &args) {
   if (arg && arg->getOption().getID() == OPT_no_objc_relative_method_lists)
     return false;
 
-  // TODO: If no flag is specified, don't default to false, but instead:
-  //   - default false on   <   ios14
-  //   - default true  on   >=  ios14
-  // For now, until this feature is confirmed stable, default to false if no
-  // flag is explicitly specified
-  return false;
+  // If no flag is specified:
+  //   - default true  on   >=  ios14/macos11
+  //   - default false on everything else
+  switch (config->platformInfo.target.Platform) {
+  case PLATFORM_IOS:
+  case PLATFORM_IOSSIMULATOR:
+    return config->platformInfo.target.MinDeployment >= VersionTuple(14, 0);
+  case PLATFORM_MACOS:
+    return config->platformInfo.target.MinDeployment >= VersionTuple(11, 0);
+  default:
+    return false;
+  };
----------------
BertalanD wrote:

Actually, I think that part is safe to ignore, no need to special case it.

Apple might need to back-deploy executables during macOS's development process, but that is not relevant for user code.

https://github.com/llvm/llvm-project/pull/101360


More information about the llvm-commits mailing list