lions and tigers and LDFLAGS, oh my!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux