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: Untangle last couple dozen incestuous target includes; takeconfig/ out of -I path


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


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