From fc25f1865940d8a0b188d460fdaf2d21c1758130 Mon Sep 17 00:00:00 2001 From: Butta Date: Tue, 29 Sep 2020 20:54:49 +0530 Subject: [PATCH] Make sure apple/swift#34023, which removes /usr/lib/swift/linux from the RUNPATH of several Swift libraries, stays that way. --- .../test-rpath-linux-repl.py | 4 --- test-snapshot-binaries/test-rpath-linux.py | 29 +++++++++++++++++++ 2 files changed, 29 insertions(+), 4 deletions(-) delete mode 100644 test-snapshot-binaries/test-rpath-linux-repl.py create mode 100644 test-snapshot-binaries/test-rpath-linux.py diff --git a/test-snapshot-binaries/test-rpath-linux-repl.py b/test-snapshot-binaries/test-rpath-linux-repl.py deleted file mode 100644 index d21e42a..0000000 --- a/test-snapshot-binaries/test-rpath-linux-repl.py +++ /dev/null @@ -1,4 +0,0 @@ -# Tests that DT_RPATH is correct for the dummy repl executable on Linux. -# REQUIRES: platform=Linux -# RUN: %{readelf} -d %{repl_swift} | %{FileCheck} %s -# CHECK: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN/../lib/swift/linux diff --git a/test-snapshot-binaries/test-rpath-linux.py b/test-snapshot-binaries/test-rpath-linux.py new file mode 100644 index 0000000..86a86b4 --- /dev/null +++ b/test-snapshot-binaries/test-rpath-linux.py @@ -0,0 +1,29 @@ +# Tests that DT_RPATH is correct for the dummy repl executable on Linux. +# REQUIRES: platform=Linux +# RUN: %{readelf} -d %{repl_swift} | %{FileCheck} %s +# CHECK: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN/../lib/swift/linux +# +# Tests that DT_RUNPATH is correct for the Swift stdlib and other libraries on Linux. +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftCore.so | %{FileCheck} --check-prefix CHECK-CORE %s +# CHECK-CORE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/libsourcekitdInProc.so | %{FileCheck} --check-prefix CHECK-SK %s +# CHECK-SK-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftRemoteMirror.so | %{FileCheck} --check-prefix CHECK-RM %s +# CHECK-RM-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswift_Differentiation.so | %{FileCheck} --check-prefix CHECK-SD %s +# CHECK-SD-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/lib_InternalSwiftSyntaxParser.so | %{FileCheck} --check-prefix CHECK-SP %s +# CHECK-SP-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftGlibc.so | %{FileCheck} --check-prefix CHECK-SG %s +# CHECK-SG-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s +# CHECK-SON-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux +# +# RUN: %{readelf} -d %{package_path}/usr/lib/libswiftDemangle.so | %{FileCheck} --check-prefix CHECK-SDE %s +# CHECK-SDE-NOT: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}:/usr/lib/swift/linux