Update -linux-rvct targets

- Updated -linux-rvct targets to support RVDS 4.0 and later.
- Changed optimization flag to -Otime because -O3 ruined performance
  for RVCT linux targets.
- Added support for --enable-small for RVCT
- RVCT created library should be able to link with GCC
- Supports building shared linux libraries

Change-Id: Ic62589950d86c3420fd4d908b8efb870806d1233
This commit is contained in:
Tero Rintaluoma 2011-06-14 11:29:35 +03:00
parent 532c30c83e
commit 5405bd9793
2 changed files with 23 additions and 36 deletions

View File

@ -689,7 +689,7 @@ process_common_toolchain() {
if enabled armv7
then
check_add_cflags --cpu=Cortex-A8 --fpu=softvfp+vfpv3
check_add_asflags --cpu=Cortex-A8 --fpu=none
check_add_asflags --cpu=Cortex-A8 --fpu=softvfp+vfpv3
else
check_add_cflags --cpu=${tgt_isa##armv}
check_add_asflags --cpu=${tgt_isa##armv}
@ -751,41 +751,24 @@ process_common_toolchain() {
linux*)
enable linux
if enabled rvct; then
# Compiling with RVCT requires an alternate libc (glibc) when
# targetting linux.
disabled builtin_libc \
|| die "Must supply --libc when targetting *-linux-rvct"
# Check if we have CodeSourcery GCC in PATH. Needed for
# libraries
hash arm-none-linux-gnueabi-gcc 2>&- || \
die "Couldn't find CodeSourcery GCC from PATH"
# Set up compiler
add_cflags --library_interface=aeabi_glibc
add_cflags --no_hide_all
add_cflags --dwarf2
# Use armcc as a linker to enable translation of
# some gcc specific options such as -lm and -lpthread.
LD="armcc --translate_gcc"
# Set up linker
add_ldflags --sysv --no_startup --no_ref_cpp_init
add_ldflags --entry=_start
add_ldflags --keep '"*(.init)"' --keep '"*(.fini)"'
add_ldflags --keep '"*(.init_array)"' --keep '"*(.fini_array)"'
add_ldflags --dynamiclinker=/lib/ld-linux.so.3
add_extralibs libc.so.6 -lc_nonshared crt1.o crti.o crtn.o
# create configuration file (uses path to CodeSourcery GCC)
armcc --arm_linux_configure --arm_linux_config_file=arm_linux.cfg
# Add the paths for the alternate libc
for d in usr/include; do
try_dir="${alt_libc}/${d}"
[ -d "${try_dir}" ] && add_cflags -J"${try_dir}"
done
add_cflags -J"${RVCT31INC}"
for d in lib usr/lib; do
try_dir="${alt_libc}/${d}"
[ -d "${try_dir}" ] && add_ldflags -L"${try_dir}"
done
# glibc has some struct members named __align, which is a
# storage modifier in RVCT. If we need to use this modifier,
# we'll have to #undef it in our code. Note that this must
# happen AFTER all libc inclues.
add_cflags -D__align=x_align_x
add_cflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
add_asflags --no_hide_all --apcs=/interwork
add_ldflags --arm_linux_paths --arm_linux_config_file=arm_linux.cfg
enabled pic && add_cflags --apcs=/fpic
enabled pic && add_asflags --apcs=/fpic
enabled shared && add_cflags --shared
fi
;;
@ -953,9 +936,13 @@ process_common_toolchain() {
enabled gcov &&
check_add_cflags -fprofile-arcs -ftest-coverage &&
check_add_ldflags -fprofile-arcs -ftest-coverage
if enabled optimizations; then
enabled rvct && check_add_cflags -Otime
enabled small && check_add_cflags -O2 || check_add_cflags -O3
if enabled rvct; then
enabled small && check_add_cflags -Ospace || check_add_cflags -Otime
else
enabled small && check_add_cflags -O2 || check_add_cflags -O3
fi
fi
# Position Independent Code (PIC) support, for building relocatable

View File

@ -184,7 +184,7 @@ BUILD_LIBVPX_SO := $(if $(BUILD_LIBVPX),$(CONFIG_SHARED))
LIBVPX_SO := libvpx.so.$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)
LIBS-$(BUILD_LIBVPX_SO) += $(BUILD_PFX)$(LIBVPX_SO)
$(BUILD_PFX)$(LIBVPX_SO): $(LIBVPX_OBJS) libvpx.ver
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm -pthread
$(BUILD_PFX)$(LIBVPX_SO): extralibs += -lm
$(BUILD_PFX)$(LIBVPX_SO): SONAME = libvpx.so.$(VERSION_MAJOR)
$(BUILD_PFX)$(LIBVPX_SO): SO_VERSION_SCRIPT = libvpx.ver
LIBVPX_SO_SYMLINKS := $(addprefix $(LIBSUBDIR)/, \