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: Cause gnatlink in gnat.dg to call correct gcc


> The obvious solution is to avoid running gcc from PATH at all, but use
> the just built gcc instead.  Unfortunately, this is more intricate than
> it seems:
>
> * We need to pass all of the full gcc pathname, the corresponding -B
>   option, and the correct multilib flag, if present, via the --GCC
>   option.  The tricky part here is to get this through the dejagnu exec
>   machinery as a single option including the embedded whitespace.  The
>   trick (thanks to Ben Elliston!) was to quote the embedded whitespace
>   to handle the levels of evaluation involved.
>
> * Since now the multilib flag is part of $GNAT_UNDER_TEST, we need to
>   reinitialize that every time the target changes (e.g. when testing
>   several multilibs).
>
> * gnatlink looks for system.ads itself, and the only way to point it to
>   the one in the just built tree is by setting
>   ADA_INCLUDE_PATH/ADA_OBJECTS_PATH, just as ada/acats/run_acats does.

Thanks for digging into this, the code is known to be a little buggy since 
the introduction of multilib in Ada.

> With those changes in place in gnat.exp, I was able to successfully run
> the gnat.dg testsuite with RUNTESTFLAGS='--target_board "unix{,-m64}"'
> in the configuration described above.

+ set 
CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --LINK=$root/xgcc -B$root 
$gnatlink_gcc -margs";

Passing --LINK was a kludge I put in for 4.4.  Does this still work with only

+ set 
CC "$file --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs 
$gnatlink_gcc -margs";

instead?  If so, the patch is OK for both mainline and 4.4 branch.

-- 
Eric Botcazou


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