Added additional newlib specific target flags with new option

LIBC_NEWLIB_TARGET_CFLAGS.

Signed-off-by: Jasmin Jessich <jasmin@anw.at>
This commit is contained in:
Jasmin Jessich 2015-09-06 13:54:46 +02:00
parent b6342809d0
commit 9e905afb56
2 changed files with 18 additions and 1 deletions

View File

@ -144,6 +144,20 @@ config LIBC_VERSION
Enter the tag you want to use. Enter the tag you want to use.
Leave empty to use the 'head' of the repository. Leave empty to use the 'head' of the repository.
config LIBC_NEWLIB_TARGET_CFLAGS
string
prompt "Target CFLAGS for newlib"
default ""
help
Used to add specific options when compiling the target libraries
(eg. -ffunction-sections -fdata-sections), which can't be defined
in global TARGET_CFLAGS, because they shall be not used for the
gcc target libraries.
Note: Both TARGET_CFLAGS and LIBC_NEWLIB_TARGET_CFLAGS are used
to compile the libraries.
Leave blank if you don't know better.
comment "Architecture specific options" comment "Architecture specific options"
config ATMEL_AVR32_HEADERS config ATMEL_AVR32_HEADERS

View File

@ -72,6 +72,7 @@ do_libc_start_files() {
do_libc() { do_libc() {
local -a newlib_opts local -a newlib_opts
local cflags_for_target
CT_DoStep INFO "Installing C library" CT_DoStep INFO "Installing C library"
@ -109,6 +110,8 @@ do_libc() {
[ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace") [ "${CT_LIBC_NEWLIB_ENABLE_TARGET_OPTSPACE}" = "y" ] && newlib_opts+=("--enable-target-optspace")
cflags_for_target="${CT_TARGET_CFLAGS} ${CT_LIBC_NEWLIB_TARGET_CFLAGS}"
# Note: newlib handles the build/host/target a little bit differently # Note: newlib handles the build/host/target a little bit differently
# than one would expect: # than one would expect:
# build : not used # build : not used
@ -116,7 +119,7 @@ do_libc() {
# target : the machine newlib runs on # target : the machine newlib runs on
CT_DoExecLog CFG \ CT_DoExecLog CFG \
CC_FOR_BUILD="${CT_BUILD}-gcc" \ CC_FOR_BUILD="${CT_BUILD}-gcc" \
CFLAGS_FOR_TARGET="${CT_TARGET_CFLAGS}" \ CFLAGS_FOR_TARGET="${cflags_for_target}" \
AR=${CT_TARGET}-ar \ AR=${CT_TARGET}-ar \
RANLIB=${CT_TARGET}-ranlib \ RANLIB=${CT_TARGET}-ranlib \
"${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \ "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/configure" \