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

GNU: use -Wl,-rpath,<dir> instead of -Wl,-R<dir> #4060

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

haampie
Copy link
Contributor

@haampie haampie commented Sep 26, 2023

Closes #4060

Summary of changes

Use -rpath instead of -R when using binutils.

The latter is supported in binutils for backwards compatibility, but in
general -R<path> is equivalent to --just-symbols=<path> when path
is a file; only when it's a directory, it's treated as -rpath=<path>.

Better avoid that ambiguity and use -rpath.

Also split -Wl,--enable-new-dtags and -Wl,-rpath,... into two
separate arguments, which is more common, and more likely to be parsed
correctly by compiler wrappers.

This commit does not attempt to add --enable-new-dtags to other
linkers than binutils ld/gold that support the flag.

Pull Request Checklist

  • Changes have tests
  • News fragment added in [newsfragments/].

The latter is supported in binutils for backwards compatibility, but in
general `-R<path>` is equivalent to `--just-symbols=<path>` when `path`
is a file; only when it's a directory, it's treated as `-rpath=<path>`.

Better avoid that ambiguity and use `-rpath`.

Also split `-Wl,--enable-new-dtags` and `-Wl,-rpath,...` into two
separate arguments, which is more common, and more likely to be parsed
correctly by compiler wrappers.

This commit does not attempt to add `--enable-new-dtags` to other
linkers than binutils ld/gold that support the flag.
@abravalheri
Copy link
Contributor

Hi @haampie, thank you very much for the contribution!

setuptools currently "bundles" the setuptools/_distutils directoty directly from https://github.com/pypa/distutils (only adding a MetaPathFinder around it). Therefore we cannot accept changes on that directory directly in this repo.

If you want the code in that path to be changes, maybe it is better to discuss directly with the https://github.com/pypa/distutils maintainers and propose a PR there? Once the changes are added, pypa/distutils is pulled in the setuptools repo.

@haampie
Copy link
Contributor Author

haampie commented Sep 26, 2023

Thanks, opened pypa/distutils#214

@haampie
Copy link
Contributor Author

haampie commented Oct 6, 2023

Looks like there is no activity in distutils though.

@abravalheri
Copy link
Contributor

We have to wait for the distutils maintainers to have the time to look into it, I don't think there is a way around that...

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.

None yet

2 participants