public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Building a compiler that honors symbolic links.
@ 2020-05-07  8:44 xaxazak xak
  2020-05-07 10:43 ` Jonathan Wakely
  2020-05-07 21:03 ` L A Walsh
  0 siblings, 2 replies; 4+ messages in thread
From: xaxazak xak @ 2020-05-07  8:44 UTC (permalink / raw)
  To: gcc-help

When I manually build GCC (via SVN trunk) or LLVM (via GIT trunk) I
use a symbolic link (/make/) to my development folder as part of the
destination path.

Both GCC and LLVM extract the “physical” target location of this
symlink, so their default include paths etc use the physical location,
which starts with (/media/<HOME>/<HDD>/...) instead of just
(/make/...).

This is annoying for a few reasons:

1. I’m capturing the header information (via -H), and I want to avoid
having <HOME> and <HDD> included in this list.
2. <HDD> can change.

I can choose to not use the default include paths (eg -nostdinc++
etc), and just explicitly set them when I invoke clang, but that makes
build setup a lot more complex.

Is there any way I can build GCC (and LLVM / clang if you know) so
that it remembers my symlinks instead of expanding them?


(NOTE: Also asked for LLVM, here:
https://llvm.discourse.group/t/maintaining-symlinks-when-installing/955)


Thanks,
Simon.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Building a compiler that honors symbolic links.
  2020-05-07  8:44 Building a compiler that honors symbolic links xaxazak xak
@ 2020-05-07 10:43 ` Jonathan Wakely
  2020-05-07 19:37   ` xaxazak xak
  2020-05-07 21:03 ` L A Walsh
  1 sibling, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2020-05-07 10:43 UTC (permalink / raw)
  To: xaxazak xak; +Cc: gcc-help

On Thu, 7 May 2020 at 09:46, xaxazak xak via Gcc-help
<gcc-help@gcc.gnu.org> wrote:
>
> When I manually build GCC (via SVN trunk) or LLVM (via GIT trunk) I
> use a symbolic link (/make/) to my development folder as part of the
> destination path.
>
> Both GCC and LLVM extract the “physical” target location of this
> symlink, so their default include paths etc use the physical location,
> which starts with (/media/<HOME>/<HDD>/...) instead of just
> (/make/...).
>
> This is annoying for a few reasons:
>
> 1. I’m capturing the header information (via -H), and I want to avoid
> having <HOME> and <HDD> included in this list.
> 2. <HDD> can change.
>
> I can choose to not use the default include paths (eg -nostdinc++
> etc), and just explicitly set them when I invoke clang, but that makes
> build setup a lot more complex.
>
> Is there any way I can build GCC (and LLVM / clang if you know) so
> that it remembers my symlinks instead of expanding them?

You'll have to provide more information. How are you configuring GCC?
What are the paths involved? What is the path you're talking about
used for? Is it where GCC is installed? --prefix? --with-sysroot?
Something else? What paths does gcc show if you add -v when compiling?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Building a compiler that honors symbolic links.
  2020-05-07 10:43 ` Jonathan Wakely
@ 2020-05-07 19:37   ` xaxazak xak
  0 siblings, 0 replies; 4+ messages in thread
From: xaxazak xak @ 2020-05-07 19:37 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-help

Here's the requested and useful info - full commands and outputs below
in case the quick info misses anything.

The setup is a bit convoluted sorry, it's a cheap initial attempt at a
script to build multiple versions of gcc and llvm. I'm using GIT
instead of SVN now, but the issue is the same.


QUICK INFO
================
build CWD: "/make/tool/gcc/build/gcc-unk-2020-05-08-06-10-20"

build configuration:
"/make/tool/gcc/git/gcc-unk-2020-05-08-06-10-20/configure
--disable-bootstrap --disable-multilib --enable-languages=c++
--prefix=/make/tool/gcc/use/unk-2020-05-08-06-10-20
--program-suffix=-unk"

-v (full output below) has one line showing the issue:
"COLLECT_LTO_WRAPPER=/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20
bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper"

NOTE: "/make" is the symlink for to "/home/xaxazak/Fast/make" that I
don't want expanded

output of "g++-unk -E -x c++ - -v < /dev/null" contains many lines
using expanded path, eg:
"
#include <...> search starts here:
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0
"
================


I note that the output from make ends with lines like:
"make[4]: Leaving directory
'/home/xaxazak/Fast/make/tool/gcc/build/gcc-unk-2020-05-08-06-10-20/x86_64-pc-linux-gnu/libatomic"
So perhaps the issue is that the symlinks are being expanded within make?



FULL INSTALL & COMMAND DETAILS BELOW



SETUP
=====
git clone git://gcc.gnu.org/git/gcc.git /make/tool/gcc/git/gcc
mv /make/tool/gcc/git/gcc /make/tool/gcc/git/gcc-unk-2020-05-08-06-10-20
mkdir /make/tool/gcc/build/gcc-unk-2020-05-08-06-10-20
=====



BUILD
=====
cd /make/tool/gcc/build/gcc-unk-2020-05-08-06-10-20
/make/tool/gcc/git/gcc-unk-2020-05-08-06-10-20/configure
--disable-bootstrap --disable-multilib --enable-languages=c++
--prefix=/make/tool/gcc/use/unk-2020-05-08-06-10-20
--program-suffix=-unk
make
=====



/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/g++-unk -v
=========================================================
Using built-in specs.
COLLECT_GCC=/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/g++-unk
COLLECT_LTO_WRAPPER=/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/make/tool/base/gcc/git/gcc-unk-2020-05-08-06-10-20/configure
--disable-bootstrap --disable-multilib --enable-languages=c++
--prefix=/make/tool/gcc/use/unk-2020-05-08-06-10-20
--program-suffix=-unk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200507 (experimental) (GCC)
=========================================================



/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/g++-unk -E -x c++ - -v
< /dev/null
=================================================================================
Using built-in specs.
COLLECT_GCC=/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/g++-unk
Target: x86_64-pc-linux-gnu
Configured with:
/make/tool/base/gcc/git/gcc-unk-2020-05-08-06-10-20/configure
--disable-bootstrap --disable-multilib --enable-languages=c++
--prefix=/make/tool/gcc/use/unk-2020-05-08-06-10-20
--program-suffix=-unk
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200507 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/cc1plus
-E -quiet -v -imultiarch x86_64-linux-gnu -iprefix
/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/
-D_GNU_SOURCE - -mtune=generic -march=x86-64
ignoring nonexistent directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../x86_64-pc-linux-gnu/include"
ignoring duplicate directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0"
ignoring duplicate directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/x86_64-pc-linux-gnu"
ignoring duplicate directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/backward"
ignoring duplicate directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/include"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring duplicate directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/include-fixed"
ignoring nonexistent directory
"/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../x86_64-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/x86_64-pc-linux-gnu
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../include/c++/11.0.0/backward
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/include
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/include-fixed
 /usr/local/include
 /home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/../../include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
# 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "<stdin>"
COMPILER_PATH=/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/:/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../libexec/gcc/
LIBRARY_PATH=/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/:/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/:/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../../lib64/:/lib/x86_64-linux-gnu/:/lib/../lib64/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib64/:/home/xaxazak/Fast/make/tool/gcc/use/unk-2020-05-08-06-10-20/bin/../lib/gcc/x86_64-pc-linux-gnu/11.0.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-E' '-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
=================================================================================

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Building a compiler that honors symbolic links.
  2020-05-07  8:44 Building a compiler that honors symbolic links xaxazak xak
  2020-05-07 10:43 ` Jonathan Wakely
@ 2020-05-07 21:03 ` L A Walsh
  1 sibling, 0 replies; 4+ messages in thread
From: L A Walsh @ 2020-05-07 21:03 UTC (permalink / raw)
  To: xaxazak xak; +Cc: gcc-help

Try mounting your target onto a "make" directory using the bind feature in
mount.


On Thu, May 7, 2020 at 1:44 AM xaxazak xak via Gcc-help <
gcc-help@gcc.gnu.org> wrote:

> When I manually build GCC (via SVN trunk) or LLVM (via GIT trunk) I
> use a symbolic link (/make/) to my development folder as part of the
> destination path.
>
> Both GCC and LLVM extract the “physical” target location of this
> symlink, so their default include paths etc use the physical location,
> which starts with (/media/<HOME>/<HDD>/...) instead of just
> (/make/...).
>
> This is annoying for a few reasons:
>
> 1. I’m capturing the header information (via -H), and I want to avoid
> having <HOME> and <HDD> included in this list.
> 2. <HDD> can change.
>
> I can choose to not use the default include paths (eg -nostdinc++
> etc), and just explicitly set them when I invoke clang, but that makes
> build setup a lot more complex.
>
> Is there any way I can build GCC (and LLVM / clang if you know) so
> that it remembers my symlinks instead of expanding them?
>
>
> (NOTE: Also asked for LLVM, here:
> https://llvm.discourse.group/t/maintaining-symlinks-when-installing/955)
>
>
> Thanks,
> Simon.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-07 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07  8:44 Building a compiler that honors symbolic links xaxazak xak
2020-05-07 10:43 ` Jonathan Wakely
2020-05-07 19:37   ` xaxazak xak
2020-05-07 21:03 ` L A Walsh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).