[PATCH] D97866: [lld-macho] Fix & fold reexport-nested-libs test into stub-link.s

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 08:44:47 PST 2021


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added a project: lld-macho.
int3 requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The reexport-nested-libs test added in D97438 <https://reviews.llvm.org/D97438> was a bit wonky.

First, it was linking against libReexportSystem.tbd which targets the
iOS simulator, and which in turn attempted to re-export the iOS
simulator's libSystem. However, due to the way `-syslibroot` works, it
was actually re-exporting the macOS libSystem.

As a result, the test was not actually able to resolve the symbols in
the desired libSystem. I'm guessing that @oontvoo was confused by this
and therefore included those symbols in libReexportSystem.tbd itself.
But this means that the test wasn't actually testing the resolution of
re-exported symbols (though it did at least verify that the re-exported
libraries could be located).

After some consideration, I figured that stub-link.s could be extended
to cover what reexport-nested-libs.s was attempting to do. The test
targets macOS, so we only have one `-syslibroot` and no chance of
confusion.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97866

Files:
  lld/MachO/InputFiles.cpp
  lld/test/MachO/Inputs/MacOSX.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd
  lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libReexportSystem.tbd
  lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
  lld/test/MachO/Inputs/libReexportSystem.tbd
  lld/test/MachO/reexport-nested-lib.s
  lld/test/MachO/stub-link.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97866.327815.patch
Type: text/x-patch
Size: 5331 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210303/e5da7792/attachment.bin>


More information about the llvm-commits mailing list