setuptools icon indicating copy to clipboard operation
setuptools copied to clipboard

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

Open haampie opened this issue 2 years ago • 4 comments

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

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

haampie avatar Sep 26 '23 09:09 haampie

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.

abravalheri avatar Sep 26 '23 10:09 abravalheri

Thanks, opened https://github.com/pypa/distutils/pull/214

haampie avatar Sep 26 '23 11:09 haampie

Looks like there is no activity in distutils though.

haampie avatar Oct 06 '23 14:10 haampie

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...

abravalheri avatar Oct 06 '23 18:10 abravalheri

Looks like this was merged in distutils. Is this PR still relevant?

Avasam avatar Jul 01 '24 15:07 Avasam

Thank you for the reminder @Avasam. If it is merged into distutils, it will be incorporated soon in setuptools.

abravalheri avatar Jul 01 '24 15:07 abravalheri