mirror of
https://github.com/google/brotli.git
synced 2026-07-08 17:56:58 +00:00
Regression 31754d4f: gcc -R: command-line option not found
#341
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jengelh on GitHub (Sep 1, 2020).
Please have
31754d4freverted. One cannot build programs with brotli & pkg-config anymore, for reasons of:gcc: error: unrecognized command-line option ‘-R’
None of the 350-or-so .pc files in my system have any rpath specifiers, and I will make the argument that it is wrong to do so in brotli.pc, especially considering the "cross-compilation" argument made in the commit message of
31754d4f.While the library may be present in /home/me/aarch64-linux-gnu/sys-root/lib, the rpath will have no effect if and when the system inside sys-root/ is being copied to an SD card where the lib directory just /lib.
@jengelh commented on GitHub (Sep 1, 2020):
@eustas commented on GitHub (Sep 2, 2020):
Does replacing
-Rwith-Wl,-rpathimprove situation?@jengelh commented on GitHub (Sep 2, 2020):
gcc would succeed, but then you still have the problem that you are forcing down an rpath entry into everything that uses brotli.pc, even transitively (i.e. when there is a
mylib.pcusingRequires: brotliand a call togcc myprog.c $(pkg-config mylib --libs)which otherwise does not care about brotli).@eustas commented on GitHub (Sep 2, 2020):
Got it. Thanks.
@eustas commented on GitHub (Sep 2, 2020):
Reverted with #838
@nigoroll commented on GitHub (Sep 26, 2020):
I understand that the issue had to be resolved by reverting the RPATH config, but the reason for above will most likely be that they all refer to libraries installed in the default path.
@jengelh commented on GitHub (Oct 2, 2020):
Negative. pkg-config is used (here) as a build-time utility. It need only satisfy the linker, and
-Lis all that is needed.pkg-config does not participate in runtime resolution of paths, that instead is a property that ought to be configured elsewhere, i.e. ld.so.conf or other mechanisms.
@nigoroll commented on GitHub (Oct 2, 2020):
then that is the default path
@jengelh commented on GitHub (Oct 12, 2020):
-L controls the ld linker (/usr/bin/ld or the like), -R/-rpath controls the runtime linker (ld.so or whatever).
The build system need not be the same as the target system, injecting -R is an error. Particularly when, for example,
the -R path is not going to exist in the target environment.
@nigoroll commented on GitHub (Oct 12, 2020):
@jengelh I am aware that this topic is controversial, but cross compiling brings even more challenges. In your example the
.pcfile should contain-Ras seen by the target system, and, yes, we have not considered that in31754d4ffcThe trouble is really that, with non-default install paths (that is, paths not configured via
ldconfig, the evilLD_LIBERARY_PATHetc), not having-Rin the pkg-configLibswill require adding that-Rto the consuming package's build, which to avoid is exactly the goal of pkg-config.