This is the mail archive of the gcc-patches@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: [Patch, Build+Fortran] PR54725 - correctly set TARGET_SYSTEM_ROOT for CPP


Dear Tobias,

I had already reviewed this patch in its previous accidental manifestation :-)

OK for trunk

Thanks for the patch

Paul

On 19 October 2012 10:22, Tobias Burnus <burnus@net-b.de> wrote:
> gfortran was ignoring the TARGET_SYSTEM_ROOT and thus searched in
> /usr/include for files specified with "#include"/"include" files and for
> .mod files.
>
> The solution is to do in gcc/fortran/cpp.c the same as it is done in
> gcc/c-family/c-opts.c.
>
>
> However, the TARGET_SYSTEM_ROOT also has to be available. For C/C++ that's
> done via gcc/Makefile.in:
>   CFLAGS-c-family/c-opts.o += @TARGET_SYSTEM_ROOT_DEFINE@
>
> For Fortran, we have to to it likewise, but slightly different:
>
> The gcc/Makefile.in gets updated by configure and written to
> $BUILD/gcc/Makefile. At that point the @TARGET...@ has been replaced by the
> actual value.
>
> For Fortran, the gcc/fortran/Make-lang.in is included in
> $BUILD/gcc/Makefile:
>   include $(LANG_MAKEFRAGS)
>
> Thus, we cannot use @TARGET_...@ as it won't get replaced. Hence, I create a
> Makefile variable in gcc/Makefile.in and set it there, which then in turn
> gets used in gcc/fortran/Make-lang.in.
>
> Build and regtested on x86-64-gnu-linux.
> OK for the trunk?
>
> Tobias
>
> PS: I haven't yet cross compiled and thus checked whether it indeed works.



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy


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