This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC_DRIVER_HOST_INITIALIZATION in gcc.c
> It is set for the djgpp port in the config/i386/xm-djgpp.h file, but
> this is completely hidden from gcc.c. This is a serious design flaw.
I don't agree that this is a serious design flaw. The targets modify
global variables all the time, why should this one be different?
> I see no such code in mainline gcc or gcc-3.3.
I was paraphrasing.
> The actual code is
> static const char *const standard_startfile_prefix =
> STANDARD_STARTFILE_PREFIX;
>
> #ifdef GCC_DRIVER_HOST_INITIALIZATION
> /* Perform host dependent initialization when needed. */
> GCC_DRIVER_HOST_INITIALIZATION;
> #endif
So the new code is this:
/* The target may change this. */
static const char * standard_startfile_prefix =
STANDARD_STARTFILE_PREFIX;
> The second const has to be removed to make djgpp work. It is impossible
> for someone looking at gcc.c to understand why, because there is no way
> to know that the GCC_DRIVER_HOST_INITIALIZATION macro might set it.
> This is a problem that needs to be fixed.
The GCC_DRIVER_HOST_INITIALIZATION macro is used only twice, and both
times it is used to change the prefix paths. It sounds like a lack of
documentation rather than a design flaw.