Hello,
Should I be able to copy the gcc (and g++, gcov, etc) binaries to a
different location after they've been built and have them behave the same?
I have a stock build of gcc 4.7.1. If I copy the gcc471 binary from
it's installed location to a different location, I get different results
when running with -print-search-dirs. I'm concerned about the 'install'
path which is displayed. It's a valid path on my system when the
original gcc471 is executed, but not when the copy is executed:
(for the original one):
> /usr/bin/gcc471 -print-search-dirs
install: /usr/lib64/gcc/x86_64-redhat-linux/4.7.1/
programs:=
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/bin/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/bin/
libraries:=
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/../lib64/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../lib64/:
/lib/x86_64-redhat-linux/4.7.1/:
/lib/../lib64/:
/usr/lib/x86_64-redhat-linux/4.7.1/:
/usr/lib/../lib64/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../../../:
/lib/:
/usr/lib/
(for the copy; it was also renamed to 'gcc'):
> /usr/lib64/gcc/x86_64-redhat-linux/4.7.1/gcc -print-search-dirs
install:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/
programs:=
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/bin/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/bin/
libraries:=
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/../lib64/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../x86_64-redhat-linux/4.7.1/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../lib64/:/lib/x86_64-redhat-linux/4.7.1/:
/lib/../lib64/:
/usr/lib/x86_64-redhat-linux/4.7.1/:
/usr/lib/../lib64/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../../x86_64-redhat-linux/lib/:
/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/../lib64/gcc/x86_64-redhat-linux/4.7.1/../../../:
/lib/:
/usr/lib/
My build was configured as:
Using built-in specs.
COLLECT_GCC=gcc471
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-redhat-linux/4.7.1/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --libdir=/usr/lib64 --libexecdir=/usr/lib64
--with-gxx-include-dir=/usr/include/c++/4.7.1
--enable-languages=c,c++,fortran --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--without-system-libunwind --disable-libssp
--enable-version-specific-runtime-libs --enable-bootstrap
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.7.1 (GCC)
Thanks,
Eric Wimmer
Lucasfilm, Ltd.