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") {
]
} else if (target_cpu == "mipsel" && current_cpu == target_cpu) {
cflags += [
"-march=mipsel",
"-EL",
"-fPIC",
"-mhard-float",
"-mfp32",
"-mxgot",
]
if (mips_arch_variant == "r1") {
cflags += [
"-mcpu=mips32",
"-march=mips32",
]
} else {
cflags += [
"-mcpu=mips32r2",
"-march=mips32r2",
]
}
} else if (target_cpu == "mips64el" && current_cpu == target_cpu) {
cflags += [
"-march=mips64el",
"-mcpu=mips64r2",
"-EL",
"-arch=mips64r2",
"-mabi=64",
"-fPIC",
"-mxgot",
]
}
......
......@@ -475,15 +475,19 @@ else()
set_cpp_flag("-mtune=generic")
endif()
if(ARCH STREQUAL "mipsel")
set_cpp_flag("-EL")
set_cpp_flag("-march=mips32r2")
set_cpp_flag("-fPIC")
set_cpp_flag("-mhard-float")
set_cpp_flag("-mfp32")
set_cpp_flag("-mxgot")
endif()
if(ARCH STREQUAL "mips64el")
set_cpp_flag("-EL")
set_cpp_flag("-march=mips64r2")
set_cpp_flag("-mabi=64")
set_cpp_flag("-fPIC")
set_cpp_flag("-mxgot")
endif()
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