This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Separate target and host config files
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 04 May 2005 17:36:55 +0100
- Subject: Re: [PATCH]: Separate target and host config files
- References: <4278DEB9.7070406@codesourcery.com> <87psw7dksh.fsf@codesourcery.com>
Zack Weinberg wrote:
Nathan Sidwell <nathan@codesourcery.com> writes:
This patch fixes the problem by adding a new 'tconfig.in' template and
amending the configure machinery to create auto-target.h from that, and
inlude that file in 'tconfig.h'. This allowed me to remove the #include
auto-host.h from the target side libraries. I also uncovered a couple
of typos with the runtime checking configure processing.
If I understand the patch correctly, the definitions in auto-target.h
are a strict subset of the definitions in auto-host.h. I'm not sure I
see the point. Is it merely that some of those definitions are unsafe
to expose to target libraries? If so, could you illustrate why?
Correct they are a subset. However, auto-host also contains such
delights as BYTEORDER, CHAR_BIT, and various type #defines like
ssize_t. It seems dangerous to expose more than the minimum necessary
to the target-side files. The current situation of just including
auto-host.h where it is absolutely needed is not practical going
forward, as essentially all target side files include tsystem.h, which
now provides definitions for runtime gcc_assert and gcc_unreachable.
It requires ENABLE_RUNTIME_CHECKING to know what those should expand
to.
Also, again if I understand correctly, I'd prefer that the subsetting
be done not by configure, but by a separate operation controlled from
the Makefile, e.g. by adding more special-case logic to mkconfig.sh
for tconfig.h. This is primarily because I don't trust autoheader not
to decide it knows better, and splat a complete copy of config.in onto
tconfig.in, ruining all your careful subsetting.
The subsetting is done manually, by manually editing the template file
tconfig.in (as it says in the comment therein). autoheader will only
autogenerate the _first_ template mentioned in AC_CONFIG_HEADERS, as
autoheader's documentation states. In this case that will remain
config.in.
An alternative mechanism for creating auto-target.h would be to
grep auto-host.h for the desired #defines. But this strikes me as
reinventing the wheel -- autoconf already has machinery to generate
a header file from a template, and that's what I've employed.
Also also, could we please *not* increase the number of thing.in files
with a confusing name relationship to their thing.h? Call it
auto-target.in if it must exist.
yeah, I was in a quandry about that, and I had originally named it
as you suggest. But, that then makes it inconsistent with the current
mapping of config.in->auto-host.h. IMHO having a similar mapping
to that was more desireable -- but there wasn't much in it :) Perhaps
we should take the opportunity of renaming config.in to auto-host.in
and removing that confusion too! If we do that, I'd prefer to address
it as a separate patch.
Let me know how you'd like to proceed
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk