Multiple versions of routines tuned for different devices
Schwarz, Konrad
konrad.schwarz@siemens.com
Tue Nov 22 01:32:00 GMT 2011
> -----Original Message-----
> From: newlib-owner@sourceware.org
> [mailto:newlib-owner@sourceware.org] On Behalf Of David Gilbert
> Sent: Friday, November 11, 2011 7:55 PM
> To: newlib@sourceware.org
> Cc: Greta Yorsh
> Subject: Multiple versions of routines tuned for different devices
>
> Hi,
> What's the right way to include multiple versions of string/memory
> routines, where the appropriate
> choice can't be determined from compiler defines?
> We could just pass an extra -D in somewhere.
I'm not an expert, but GCC has "spec files" that are used to
construct arguments to the subprograms the GCC driver program
invokes. These arguments include -D flags to the
C preprocessor/compiler.
The spec file syntax allows constructing arguments depending
on the arguments passed to the driver program.
For instance, GCC for the Power(PC) supports flags for the
(obsolete) "yellowknife", "MVME", and "ADS" single-board
computers.
I think the right thing to do would be to extend the standard
GCC spec file for ARM (and similarly for other architectures)
to generate defines according to the passed -mtune parameter.
This would ensure that a single option (-mtune) is responsible
for selecting the processor type. Otherwise, you would need
to ensure that the -mtune and -D__ARM_CORTEX_A9 arguments
are the same.
Konrad
More information about the Newlib
mailing list