This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
lions and tigers and LDFLAGS, oh my!
- From: "Poor Yorick" <org dot gnu dot gcc dot help at pooryorick dot com>
- To: gcc-help at gnu dot org
- Date: Fri, 22 May 2009 13:21:27 +0000
- Subject: lions and tigers and LDFLAGS, oh my!
- Reply-to: "Poor Yorick" <org dot gnu dot gcc dot help at pooryorick dot com>
I'd like to embed an RPATH/RUNPATH into all gcc binaries. It isn't enough to
just set LDFLAGS and BOOT_LDFLAGS in the environment; those two variables must
also be passed explicitly as part of the make command:
make LDFLAGS="$LDFLAGS", BOOT_LDFLAGS="$BOOT_LDFLAGS"
So far, so good. However, I'd also trying to use the magic word, '$ORIGIN',
with a literal dollar sign, in the embedded RPATH. LDFLAGS currently looks
like this:
-Wl,-rpath,'$ORIGIN/../lib' -Wl,-rpath,'$ORIGIN/../lib64'
-Wl,-rpath,'$ORIGIN/../../lib' -Wl,-rpath,'$ORIGIN/../../lib64'
-Wl,-rpath,'$ORIGIN/../../glibc/lib'
-L/path/to/bootstrap/lib
-L/path/to/bootstrap/lib64
-L/path/to/bootstrap/glibc/lib
-Wl,--dynamic-linker,/path/to/bootstrap/glibc/lib/ld-linux-x86-64.so.2
-Wl,-z,origin -Wl,--enable-new-dtags
The problem is that the top-level Makefile specifies enough layers of recursive
calls to make and the shell that I haven't found a way to quote the dollar sign
so that it stays quoted throughout the process. Any hints?
Had the same trouble with binutils and glibc. Each Makefile requires different
quoting.
https://www.pooryorick.com/secure/wiki/Pub/TheTroubleWithOrigin
--
Yorick