Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check the runpaths for more ELF binaries #113

Merged
merged 1 commit into from
Apr 18, 2023
Merged

Conversation

finagolfin
Copy link
Member

@finagolfin finagolfin commented Mar 4, 2023

This is needed for swiftlang/swift#63782, which changes the Unix toolchain to look for libraries in architecture-specific directories.

Make sure they include $ORIGIN, so they can find each other in the same toolchain.

lit.cfg Outdated Show resolved Hide resolved
# 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
# RUN: %{readelf} -d %{package_path}/usr/lib/swift/linux/%{linux_arch}/libswiftSwiftOnoneSupport.so | %{FileCheck} --check-prefix CHECK-SON %s
# CHECK-SON: {{.*}} {{\(RPATH\)|\(RUNPATH\)}} {{.*}}$ORIGIN{{[^/]}}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as I'm updating this file, I added these $ORIGIN checks too, which are needed for the runtime libraries to find each other.

@finagolfin
Copy link
Member Author

@bnbarham, now that this passed the CI on the linked compiler pull, looking for review so I can get this in before the upcoming 5.9 branch. Please don't merge though, as all 11 pulls will have to be merged together.

Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I'm the best to review these, but assuming your main PR is reasonable than this seems to match that 👍.

lit.cfg Outdated Show resolved Hide resolved
Make sure they include $ORIGIN, so they can find each other in the same toolchain.
@finagolfin
Copy link
Member Author

Removed the changes to add the architecture to the runpath since the Swift devs want to take a different approach, leaving only the other runpath checks I added.

One last CI run and this can go in, @bnbarham.

@finagolfin finagolfin changed the title Change the runpath to an architecture-specific directory on ELF platforms Check the runpaths for more ELF binaries Apr 12, 2023
Copy link
Contributor

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me.

Not sure about the check-string names. SG, SON, and RM don't communicate a lot, but they are prior art, so ¯_(ツ)_/¯.

@finagolfin
Copy link
Member Author

finagolfin commented Apr 14, 2023

Passed CI, checked the linux log to make sure this test was run:

PASS: swift-package-tests :: test-snapshot-binaries/test-rpath-linux.py (12 of 31)

This can be merged now.

@finagolfin finagolfin closed this Apr 14, 2023
@finagolfin finagolfin reopened this Apr 14, 2023
@finagolfin
Copy link
Member Author

Ping @bnbarham, ready for merge.

@bnbarham bnbarham merged commit c24baed into swiftlang:main Apr 18, 2023
@bnbarham
Copy link
Contributor

Sorry about the delay there, thanks for the ping. The last comment got lost amongst many other emails 😅

@finagolfin finagolfin deleted the arch branch April 18, 2023 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants