https://bugs.llvm.org/show_bug.cgi?id=51218

            Bug ID: 51218
           Summary: lld is confused by xctest reexports in xcode 13 sdk
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: MachO
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

% clang -x c /dev/null -o empty.o -c --target=arm64-apple-ios -isysroot
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk

% ld -demangle -dynamic -dylib -arch arm64 -platform_version ios 13.0.0 15.0
-syslibroot
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
-o foo.o -framework XCTest -why_load -lSystem
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/lib/clang/13.0.0/lib/darwin/libclang_rt.ios.a
-Fxcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks
empty.o

^ Works


% ~/src/llvm-project/out/gn/bin/ld64.lld -demangle -dynamic -dylib -arch arm64
-platform_version ios 13.0.0 15.0 -syslibroot
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
-o foo.o -framework XCTest -why_load -lSystem
/Users/thakis/src/chrome/src/third_party/llvm-build/Release+Asserts/lib/clang/13.0.0/lib/darwin/libclang_rt.ios.a
-Fxcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks
empty.o
ld64.lld: error: unable to locate re-export with install name
@rpath/XCTestCore.framework/XCTestCore exported from
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest

ld64.lld: error: unable to locate re-export with install name
@rpath/XCUnit.framework/XCUnit exported from
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest

ld64.lld: error: unable to locate re-export with install name
@rpath/XCUIAutomation.framework/XCUIAutomation exported from
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest

^ doesn't


I don't quite get _why_ ld64 can do this. Here are the reexport entries:


% otool -arch arm64 -l
xcode-13/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks/XCTest.framework/XCTest
| grep -A2 REEXPORT
          cmd LC_REEXPORT_DYLIB
      cmdsize 64
         name @rpath/XCTestCore.framework/XCTestCore (offset 24)
--
          cmd LC_REEXPORT_DYLIB
      cmdsize 56
         name @rpath/XCUnit.framework/XCUnit (offset 24)
--
          cmd LC_REEXPORT_DYLIB
      cmdsize 72
         name @rpath/XCUIAutomation.framework/XCUIAutomation (offset 24)




Does the rpath for a framework include the framework's parent dir?

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to