Commit 55275c35 by Jiaxun Yang Committed by Ben Clayton

Fix MIPS build cflags

Accorading to GCC and Clang documents, march=mipsel/mips64el doesn't really exist. So we use real CPU arch instead, and apply '-EL' flag to indicate endianess. Also, to deal with link failure, we add '-mxgot' to increase GOT size. Change-Id: I21706da3423412c968f6e80a9d21f5266255a0cf Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41028Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com>
parent 683bad83
...@@ -109,26 +109,28 @@ config("swiftshader_config") { ...@@ -109,26 +109,28 @@ config("swiftshader_config") {
] ]
} else if (target_cpu == "mipsel" && current_cpu == target_cpu) { } else if (target_cpu == "mipsel" && current_cpu == target_cpu) {
cflags += [ cflags += [
"-march=mipsel", "-EL",
"-fPIC", "-fPIC",
"-mhard-float", "-mhard-float",
"-mfp32", "-mfp32",
"-mxgot",
] ]
if (mips_arch_variant == "r1") { if (mips_arch_variant == "r1") {
cflags += [ cflags += [
"-mcpu=mips32", "-march=mips32",
] ]
} else { } else {
cflags += [ cflags += [
"-mcpu=mips32r2", "-march=mips32r2",
] ]
} }
} else if (target_cpu == "mips64el" && current_cpu == target_cpu) { } else if (target_cpu == "mips64el" && current_cpu == target_cpu) {
cflags += [ cflags += [
"-march=mips64el", "-EL",
"-mcpu=mips64r2", "-arch=mips64r2",
"-mabi=64", "-mabi=64",
"-fPIC", "-fPIC",
"-mxgot",
] ]
} }
......
...@@ -475,15 +475,19 @@ else() ...@@ -475,15 +475,19 @@ else()
set_cpp_flag("-mtune=generic") set_cpp_flag("-mtune=generic")
endif() endif()
if(ARCH STREQUAL "mipsel") if(ARCH STREQUAL "mipsel")
set_cpp_flag("-EL")
set_cpp_flag("-march=mips32r2") set_cpp_flag("-march=mips32r2")
set_cpp_flag("-fPIC") set_cpp_flag("-fPIC")
set_cpp_flag("-mhard-float") set_cpp_flag("-mhard-float")
set_cpp_flag("-mfp32") set_cpp_flag("-mfp32")
set_cpp_flag("-mxgot")
endif() endif()
if(ARCH STREQUAL "mips64el") if(ARCH STREQUAL "mips64el")
set_cpp_flag("-EL")
set_cpp_flag("-march=mips64r2") set_cpp_flag("-march=mips64r2")
set_cpp_flag("-mabi=64") set_cpp_flag("-mabi=64")
set_cpp_flag("-fPIC") set_cpp_flag("-fPIC")
set_cpp_flag("-mxgot")
endif() endif()
if(SWIFTSHADER_LESS_DEBUG_INFO) if(SWIFTSHADER_LESS_DEBUG_INFO)
......
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