]> granicus.if.org Git - libvpx/commitdiff
Update -linux-rvct targets
authorTero Rintaluoma <teror@google.com>
Tue, 14 Jun 2011 08:29:35 +0000 (11:29 +0300)
committerTero Rintaluoma <teror@google.com>
Tue, 14 Jun 2011 08:29:35 +0000 (11:29 +0300)
- 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

build/make/configure.sh
libs.mk

index 28a0247d803c8ef78aa30c6adf85ae98e9b7214b..f05e0ee87aec6f01dc1cc85fad21cea9fc3142d2 100755 (executable)
@@ -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"
-
-                # Set up compiler
-                add_cflags --library_interface=aeabi_glibc
-                add_cflags --no_hide_all
-                add_cflags --dwarf2
-
-                # 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
-
-                # 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
+                # 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"
+
+                # Use armcc as a linker to enable translation of
+                # some gcc specific options such as -lm and -lpthread.
+                LD="armcc --translate_gcc"
+
+                # create configuration file (uses path to CodeSourcery GCC)
+                armcc --arm_linux_configure --arm_linux_config_file=arm_linux.cfg
+
+                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
diff --git a/libs.mk b/libs.mk
index e3b2e2ce487ea0a111a6c6f34624fb4c0afffb2a..c09581cc30878c1b2116ef376562adab647e1f4a 100644 (file)
--- a/libs.mk
+++ b/libs.mk
@@ -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)/, \