[PATCH] D124887: [lld/mac] Support writing zippered dylibs and bundles
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 15:40:14 PDT 2022
thakis added inline comments.
================
Comment at: lld/MachO/Driver.cpp:650
+ error("lld supports writing zippered outputs only for "
+ "macos and mac-catalyst");
+ } else if (config->outputType != MH_DYLIB &&
----------------
ld64 allows this, but it's not used for anything as far as I can tell. So let's not allow it for now.
================
Comment at: lld/MachO/Driver.cpp:653
+ config->outputType != MH_BUNDLE) {
+ error("writing zippered outputs only valid for -dylib and -bundle");
+ } else {
----------------
This is just a warning in ld64 (it uses the last flag in that case). Let's see if we can make it an error.
================
Comment at: lld/MachO/Driver.cpp:1153
symtab = std::make_unique<SymbolTable>();
+ config->outputType = getOutputType(args);
target = createTargetInfo(args);
----------------
Moved up so that it's set in time for the new outputType check in parsePlatformVersions
================
Comment at: lld/test/MachO/zippered.yaml:60
+
+## Reject .o files which only have the secondary platform.
+# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 12.0 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o %t/test_zippered.dylib 2>&1 | FileCheck --check-prefix=CAT %s
----------------
This matches ld64.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124887/new/
https://reviews.llvm.org/D124887
More information about the llvm-commits
mailing list