Commit fe796495 by Stephen Lanham

Update BUILD.gn configs to support ARM[64] builds.

Bug: b/114402930 Change-Id: Id7eedc6b01f40d24188d514755d5c89689b24abb Reviewed-on: https://swiftshader-review.googlesource.com/20568Tested-by: 's avatarStephen Lanham <slan@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent 17b75890
......@@ -88,7 +88,7 @@ config("swiftshader_config") {
"-march=x86-64",
"-mtune=generic",
]
} else { # 32 bit version
} else if (target_cpu == "x86") { # 32 bit version
cflags += [
"-m32",
"-msse2",
......
......@@ -21,7 +21,7 @@ config("swiftshader_common_private_config") {
"/wd4201", # nameless struct/union
"/wd5030", # attribute is not recognized
]
} else {
} else if (target_cpu == "x86" || target_cpu == "x64") {
cflags = [ "-msse2" ]
}
}
......
......@@ -241,7 +241,7 @@ namespace sw
return InterlockedExchange64(target, value);
#else
int ret;
__asm__ __volatile__("lock; xchg8 %0,(%1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
__asm__ __volatile__("lock; xchg8 %x0,(%x1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
return ret;
#endif
}
......@@ -252,7 +252,7 @@ namespace sw
return InterlockedExchange((volatile long*)target, (long)value);
#else
int ret;
__asm__ __volatile__("lock; xchgl %0,(%1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
__asm__ __volatile__("lock; xchgl %x0,(%x1)" : "=r" (ret) :"r" (target), "0" (value) : "memory" );
return ret;
#endif
}
......
......@@ -29,7 +29,7 @@ config("swiftshader_main_private_config") {
"-Wno-sign-compare",
]
}
} else {
} else if (target_cpu == "x86" || target_cpu == "x64") {
cflags = [ "-msse2" ]
defines =
[ "NO_SANITIZE_FUNCTION=__attribute__((no_sanitize(\"function\")))" ]
......
......@@ -28,7 +28,10 @@ config("swiftshader_libEGL_private_config") {
defines += [ "EGLAPI=" ]
} else {
cflags = [ "-Wno-sign-compare" ]
cflags = [
"-Wno-sign-compare",
"-Wno-unused-function",
]
if (!is_clang) {
cflags += [ "-Wno-unused-but-set-variable" ]
}
......
......@@ -152,7 +152,7 @@ config("swiftshader_reactor_private_config") {
"/wd4201", # nameless struct/union
"/wd4245", # conversion from int to unsigned int (llvm)
]
} else {
} else if (target_cpu == "x86" || target_cpu == "x64") {
cflags = [
"-Wno-unused-local-typedef",
"-msse2",
......
......@@ -103,7 +103,7 @@ namespace
static bool detectARM()
{
#if defined(__arm__)
#if defined(__arm__) || defined(__aarch64__)
return true;
#elif defined(__i386__) || defined(__x86_64__)
return false;
......@@ -372,6 +372,8 @@ namespace sw
assert(sizeof(void*) == 8 && elfHeader->e_machine == EM_X86_64);
#elif defined(__arm__)
assert(sizeof(void*) == 4 && elfHeader->e_machine == EM_ARM);
#elif defined(__aarch64__)
assert(sizeof(void*) == 8 && elfHeader->e_machine == EM_AARCH64);
#else
#error "Unsupported platform"
#endif
......
......@@ -22,7 +22,7 @@ config("swiftshader_renderer_private_config") {
"/wd4324", # structure was padded due to alignment specifier
"/wd5030", # attribute is not recognized
]
} else {
} else if (target_cpu == "x86" || target_cpu == "x64") {
cflags = [
"-msse2",
"-Wno-sign-compare",
......
......@@ -54,7 +54,7 @@ config("swiftshader_llvm_private_config") {
cflags += [ "-Wno-error" ]
}
if (is_clang) {
if (is_clang && (target_cpu == "x86" || target_cpu == "x64")) {
cflags += [
"-msse2",
"-Wno-header-hygiene",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment