[lld] 3e6b6ce - [lld/mac] Use libSystem.dylib instead of libSystem.B.dylib in tests

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 1 12:26:16 PST 2021


Author: Nico Weber
Date: 2021-03-01T15:23:28-05:00
New Revision: 3e6b6cee00819d256f30e84aec7ae634e0725534

URL: https://github.com/llvm/llvm-project/commit/3e6b6cee00819d256f30e84aec7ae634e0725534
DIFF: https://github.com/llvm/llvm-project/commit/3e6b6cee00819d256f30e84aec7ae634e0725534.diff

LOG: [lld/mac] Use libSystem.dylib instead of libSystem.B.dylib in tests

For -flat_namespace, lld needs to load dylibs in LC_LOAD_DYLIB.
The current setup meant that libSystem.dylib would cause a LC_LOAD_DYLIB
with libSystem.B.dylib, but that didn't exist in our libsysroot for
tests. So just drop the .B.

See https://reviews.llvm.org/D97641#2595237 and
https://reviews.llvm.org/D97641#2595270

Added: 
    

Modified: 
    lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
    lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
    lld/test/MachO/implicit-dylibs.s
    lld/test/MachO/lc-linker-option.ll
    lld/test/MachO/link-search-order.s
    lld/test/MachO/stub-link.s
    lld/test/MachO/weak-import.s

Removed: 
    


################################################################################
diff  --git a/lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd b/lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
index 1aa52894971d..427d598bb6a2 100644
--- a/lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
+++ b/lld/test/MachO/Inputs/MacOSX.sdk/usr/lib/libSystem.tbd
@@ -2,7 +2,7 @@
 archs:            [ x86_64, arm64 ]
 uuids:            [ 'x86_64: 00000000-0000-0000-0000-000000000000', 'arm64: 00000000-0000-0000-0000-000000000010' ]
 platform:         macosx
-install-name:     '/usr/lib/libSystem.B.dylib'
+install-name:     '/usr/lib/libSystem.dylib'
 current-version:  0001.001.1
 exports:
   - archs:        [ 'x86_64', 'arm64' ]

diff  --git a/lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd b/lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
index 86d576b507cd..64c512b712a9 100644
--- a/lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
+++ b/lld/test/MachO/Inputs/iPhoneSimulator.sdk/usr/lib/libSystem.tbd
@@ -2,7 +2,7 @@
 archs:            [ i386, x86_64 ]
 uuids:            [ 'i386: 00000000-0000-0000-0000-000000000000', 'x86_64: 00000000-0000-0000-0000-000000000001' ]
 platform:         ios
-install-name:     '/usr/lib/libSystem.B.dylib'
+install-name:     '/usr/lib/libSystem.dylib'
 current-version:  1281
 exports:
   - archs:      [ i386, x86_64 ]

diff  --git a/lld/test/MachO/implicit-dylibs.s b/lld/test/MachO/implicit-dylibs.s
index bd2d6e8d104b..5d01fadcdc63 100644
--- a/lld/test/MachO/implicit-dylibs.s
+++ b/lld/test/MachO/implicit-dylibs.s
@@ -67,7 +67,7 @@
 
 # LOAD:          cmd LC_LOAD_DYLIB
 # LOAD-NEXT: cmdsize
-# LOAD-NEXT:    name /usr/lib/libSystem.B.dylib
+# LOAD-NEXT:    name /usr/lib/libSystem.dylib
 # LOAD:          cmd LC_LOAD_DYLIB
 # LOAD-NEXT: cmdsize
 # LOAD-NEXT:    name /System/Library/Frameworks/Foo.framework/Versions/A/Foo

diff  --git a/lld/test/MachO/lc-linker-option.ll b/lld/test/MachO/lc-linker-option.ll
index 617de53d38f9..48f93c3d6408 100644
--- a/lld/test/MachO/lc-linker-option.ll
+++ b/lld/test/MachO/lc-linker-option.ll
@@ -21,7 +21,7 @@
 # RUN:  --implicit-check-not LC_LOAD_DYLIB
 # LIB:          cmd LC_LOAD_DYLIB
 # LIB-NEXT: cmdsize
-# LIB-NEXT:    name /usr/lib/libSystem.B.dylib
+# LIB-NEXT:    name /usr/lib/libSystem.dylib
 
 # RUN: llvm-as %t/invalid.ll -o %t/invalid.o
 # RUN: not %lld %t/invalid.o -o /dev/null 2>&1 | FileCheck --check-prefix=INVALID %s

diff  --git a/lld/test/MachO/link-search-order.s b/lld/test/MachO/link-search-order.s
index a2ce1fa59438..5ace27cc4de5 100644
--- a/lld/test/MachO/link-search-order.s
+++ b/lld/test/MachO/link-search-order.s
@@ -48,11 +48,11 @@
 
 # DYLIB: @executable_path/libhello.dylib
 # DYLIB: @executable_path/libgoodbye.dylib
-# DYLIB: /usr/lib/libSystem.B.dylib
+# DYLIB: /usr/lib/libSystem.dylib
 
 # ARCHIVE:     @executable_path/libhello.dylib
 # ARCHIVE-NOT: @executable_path/libgoodbye.dylib
-# ARCHIVE:     /usr/lib/libSystem.B.dylib
+# ARCHIVE:     /usr/lib/libSystem.dylib
 
 .section __TEXT,__text
 .global _main

diff  --git a/lld/test/MachO/stub-link.s b/lld/test/MachO/stub-link.s
index 5ca91efaef99..8d34e958bbbe 100644
--- a/lld/test/MachO/stub-link.s
+++ b/lld/test/MachO/stub-link.s
@@ -23,7 +23,7 @@
 
 # LOAD:          cmd LC_LOAD_DYLIB
 # LOAD-NEXT:               cmdsize
-# LOAD-NEXT:                  name /usr/lib/libSystem.B.dylib
+# LOAD-NEXT:                  name /usr/lib/libSystem.dylib
 # LOAD-NEXT:            time stamp
 # LOAD-NEXT:       current version 1.1.1
 # LOAD-NEXT: compatibility version

diff  --git a/lld/test/MachO/weak-import.s b/lld/test/MachO/weak-import.s
index a47bfb8df3c5..6b13fcd7110b 100644
--- a/lld/test/MachO/weak-import.s
+++ b/lld/test/MachO/weak-import.s
@@ -24,7 +24,7 @@
 
 # WEAK-SYS:          cmd LC_LOAD_WEAK_DYLIB
 # WEAK-SYS-NEXT: cmdsize
-# WEAK-SYS-NEXT:    name /usr/lib/libSystem.B.dylib
+# WEAK-SYS-NEXT:    name /usr/lib/libSystem.dylib
 
 # WEAK-SYS:          cmd LC_LOAD_WEAK_DYLIB
 # WEAK-SYS-NEXT: cmdsize
@@ -32,7 +32,7 @@
 
 # SYS:               cmd LC_LOAD_DYLIB
 # SYS-NEXT:      cmdsize
-# SYS-NEXT:         name /usr/lib/libSystem.B.dylib
+# SYS-NEXT:         name /usr/lib/libSystem.dylib
 
 # WEAK-FOO:          cmd LC_LOAD_WEAK_DYLIB
 # WEAK-FOO-NEXT: cmdsize


        


More information about the llvm-commits mailing list