Ticket #2049: svn-arm-compilev3.diff

File svn-arm-compilev3.diff, 4.8 KB (added by Josh, 11 years ago)

Diff of latest SVN + typo fix

  • libraries/source/fcollada/src/Makefile

     
    11OS_ARCH := $(shell uname -s)
     2OS_CPU := $(shell uname -p)
    23
    34ifeq ($(OS_ARCH),Darwin)
    45PIC_FLAGS ?= -fPIC
     
    910
    1011CXX ?= g++
    1112CXXFLAGS += -fvisibility=hidden -W -Wall -Wno-unused-parameter -Wno-unused-function -Wno-unused-but-set-variable $(OS_DEFINE) $(PIC_FLAGS) $(CPPFLAGS)
     13# If we're compiling on *nix ARM, target Cortex-A15 CPUs with NEON ***mfloat-abi setting must be the same on everything linked to FCollada***
     14ifeq ($(OS_CPU),armv7l)
     15CXXFLAGS += -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard
     16endif
    1217CXXFLAGS_DEBUG := -O0 -g -D_DEBUG -DRETAIL
    1318CXXFLAGS_RELEASE := -O1 -DNDEBUG -DRETAIL
    14 # (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1)
     19# (-O2 with gcc 4.3 causes linker errors when using this library, for unknown reasons, so stick with -O1 until gcc >4.3 is typical.)
    1520CXXFLAGS_TEST := -O0 -g -D_DEBUG
    1621LIBS += `pkg-config libxml-2.0 --libs`
    1722INCLUDES += -IFCollada `pkg-config libxml-2.0 --cflags`
  • libraries/source/fcollada/src/FCollada/FUtils/FUAssert.cpp

     
    4444#elif defined (__APPLE__)
    4545        Debugger();
    4646        //SysBreak();
     47#elif defined (__arm__)
     48        __asm__("bkpt 0");
    4749#else
    4850        // AFAIK This is available on all X86 platforms
    4951        __asm__("int $0x03");
  • libraries/source/nvtt/src/src/nvcore/nvcore.h

     
    6767// NV_CPU_X86
    6868// NV_CPU_X86_64
    6969// NV_CPU_PPC
     70// NV_CPU_ARM
    7071
    7172#define NV_CPU_STRING   POSH_CPU_STRING
    7273
     
    7677#   define NV_CPU_X86 1
    7778#elif defined POSH_CPU_PPC
    7879#   define NV_CPU_PPC 1
     80#elif defined POSH_CPU_STRONGARM
     81#   define NV_CPU_ARM 1
    7982#else
    8083#   error "Unsupported CPU"
    8184#endif
  • build/premake/premake4.lua

     
    2626
    2727dofile("extern_libs4.lua")
    2828
    29 -- detect CPU architecture (simplistic, currently only supports x86 and amd64)
     29-- detect CPU architecture (simplistic, currently only supports x86, amd64 and ARM)
    3030arch = "x86"
    3131if _OPTIONS["android"] then
    3232    arch = "arm"
     
    4747            arch = "amd64"
    4848        elseif string.find(machine, "i.86") == 1 then
    4949            arch = "x86"
     50        elseif string.find(machine, "arm") == 1 then
     51            arch = "arm"
    5052        else
    5153            print("WARNING: Cannot determine architecture from GCC, assuming x86")
    5254        end
     
    262264            if arch == "arm" then
    263265                -- disable warnings about va_list ABI change
    264266                buildoptions { "-Wno-psabi" }
    265 
    266                 -- target Cortex-A9 CPUs with NEON
    267                 buildoptions { "-mthumb -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp" }
     267                if _OPTIONS["android"] then
     268                    -- target generic arm CPUs with NEON
     269                    buildoptions { "-mtune=generic-arm -mfpu=neon -mfloat-abi=softfp" }
     270                else
     271                    -- target Cortex-A15 CPUs with NEON
     272                    buildoptions { "-mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard" }
     273                end
    268274            end
    269275
    270276            if _OPTIONS["coverage"] then
  • source/lib/sysdep/arch/arm/arm.cpp

     
    2828
    2929#include "lib/sysdep/cpu.h"
    3030
    31 #include <android/log.h>
    3231intptr_t cpu_AtomicAdd(volatile intptr_t* location, intptr_t increment)
    3332{
    3433    return __sync_fetch_and_add(location, increment);
     
    4140
    4241bool cpu_CAS64(volatile i64* location, i64 expected, i64 newValue)
    4342{
    44     // Current versions of GCC don't implement this on ARM:
    45     //   return __sync_bool_compare_and_swap(location, expected, newValue);
    46    
    47     // http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40fb79c8a88625504857d44de1bc89dc0341e618
    48     // adds support for
    49     //   return __kernel_cmpxchg64(&expected, &newValue, (long long*)location) == 0;
    50     // but only for Linux kernel 3.1
    51    
    52     // Maybe we can do it with user-space assembly assuming a modern-enough CPU?
    53     // That sounds non-trivial so let's just cheat
    54 #warning TODO: atomic cpu_CAS64 on ARM
    55     if (*location != expected)
    56         return false;
    57     *location = newValue;
    58     return true;
     43    return __sync_bool_compare_and_swap(location, expected, newValue);
    5944}
    6045
    6146const char* cpu_IdentifierString()