Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> The actual location will usually be /usr/lib64/libfoo.so

Usually indeed, for distro's that pretty much support one single version of every library. But this is no longer true for Nix, Spack, Gentoo Prefix and Guix, all these package managers/distro's have in common that there should be no default search paths where all libraries are dumped into.

How about `--copy-link-path-as-rpath` and `--copy-link-path-as-rpath-ignore=/build/dir`, so that ld continues to copy the soname to dt_needed, and registers rpath of non-build dirs. Then Nix, Spack, ... can simply use these flags in their linker wrapper.



I think most people designing build systems (I'm one of them) would prefer to explicitly set the paths at each point rather than have gcc ferry values between inputs behind the scenes.

My build system will have already resolved all these paths. It's very easy to interpolate these paths into the command to call the compiler.


And some build systems already have an option to add these RPATHs, e.g. https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_R...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: