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]

Re: What is the best way to add a target specific system header directory


On 2017-05-08 19:46 +0100, Martin J. O'Riordan wrote:
> I am building GCC as a cross compiler for the Sparc Leon processor, it has
> been working well for me for several years and is currently at v6.3.0.
> 
> However, a recent change I want to make is to provide an additional
> non-standard system header directory to be searched when '<...>' is used,
> and this directory is located relative to the 'gcc' binary; in this case
> relative to:
> 
>     <wherever>/bin/triple-gcc

So you have to determine where the executable triple-gcc is.  For linux
we should readlink /proc/self/exe, but it's not portable.

> I have tried using '--with-native-system-header-dir' but this wants an
> absolute path.  I want to avoid redefining 'INCLUDE_DEFAULTS' with my own
> custom replacement.  Substituting for '/usr/include' is okay too, because
> the host version is not meaningful the context of cross compilation.
> 
> Any recommendations on how to configure for this, or should I add something
> (a '#define' for example) to 'gcc/gcc/config/sparc/sparc.h'?

It seems GCC doesn't have this functionality.  I think we have to implement
this ourselves.

> Thanks,
> 
>     MartinO
> 
> 
-- 
Xi Ruoyao <ryxi@stu.xidian.edu.cn>
School of Aerospace Science and Technology, Xidian University


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