This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [WIP] glibc: Use /lib/ld-linux-armhf.so.3 for ARM's-mfloat-abi=hard ABI.


I trimmed the CC of people probably not very interested in arcane libc
build internals, and added libc-alpha since we're now talking about
possibly changing the generic build infrastructure.

> Except that this idea doesn't work because the implicit rule uses
> -undef and I didn't notice that.
> 
> Therefore __ARM_PCS_VFP is *never* defined.

I don't really recall, but I suspect that the reason for -undef may have
been just the default predefines like "i386" or "linux" causing problems.

Possibly there once was a principle that this mechanism should only be
used for testing things we defined in config.h or other such places
rather than predefines--the same general principle by which we prefer
sysdeps file selection to #ifdef on predefines.  But here we have a case
where using the predefine seems sensible enough.  There's no need to
enforce such a philosophy mechanically so it constrains all cases.  We
can just do it socially through code review, to constrain reliance on
predefines to the very few cases where we really think it's the wise choice.

Just dropping -undef will break things by replacing all "linux" with "1"
and so forth.  In some trivial experiments on my random system version of
GCC, -std=c99 or -std=c89 does not eliminate the nonstandard predefines
(non-__ names), but -ansi does--despite the GCC manual's claim that -ansi
is equivalent to -std=c89.  So we could use -ansi instead of -undef,
though that feels a little icky because it's so nonobvious (and contrary
to documentation) that this is what has that effect.

Conversely, I can see a doing a generalized version of configure-time
tests for predefines.  i.e.
	GLIBC_CHECK_PREDEFINE([__ARM_PCS_VFP])
would expand to a check that adds __ARM_PCS_VFP to an extra config.h-like
file (or maybe just a config.make variable, for simplicity at the cost of
full dependency tracking goodness) if predefined at configure time.


Thanks,
Roland


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