This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

lions and tigers and LDFLAGS, oh my!


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]