This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Untangle last couple dozen incestuous target includes; takeconfig/ out of -I path
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: Richard Sandiford <rsandifo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 13:51:35 -0700
- Subject: Re: Untangle last couple dozen incestuous target includes; takeconfig/ out of -I path
- References: <87wudk8xn7.fsf@egil.codesourcery.com><wvnllu0ndr4.fsf@talisman.cambridge.redhat.com>
Richard Sandiford <rsandifo@redhat.com> writes:
> "Zack Weinberg" <zack@codesourcery.com> writes:
>> + tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h"
>> + case $machine in
>> + mips*el*) ;;
>> + *) tm_file="mips/openbsd-be.h ${tm_file}" ;;
>> + esac
>
> Minor nit, but I think the "el" is always expected to be at the
> end (i.e. mips*el).
The trailing star matches the rest of the configuration triple.
> It looks like mips*-openbsd now defines TARGET_ENDIAN_DEFAULT after
> including mips.h. This might be a problem since the endianness
> decides %(endian_spec), which is used in the assembler spec.
Ugh. I really dislike the style where generic headers change their
behavior based on pre-existing #defines.
What do you think of putting that setting into tm_defines instead,
like this:
+ mips*-*-openbsd*)
+ tm_defines="OBSD_HAS_DECLARE_FUNCTION_NAME OBSD_HAS_DECLARE_OBJECT OBSD_HAS_CORRECT_SPECS"
+ target_cpu_default="MASK_GAS|MASK_ABICALLS"
+ tm_file="mips/mips.h openbsd.h mips/openbsd.h mips/sdb.h"
+ case $machine in
+ mips*el*) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=0";;
+ *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";;
+ esac
+ ;;
This has the advantage that openbsd-be.h becomes unnecessary.
zw