What is the best way to add a target specific system header directory
Xi Ruoyao
ryxi@stu.xidian.edu.cn
Tue May 9 04:03:00 GMT 2017
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
More information about the Gcc-help
mailing list