Skip to content

Commit

Permalink
[Android] RISCV64 Support Based on Clang 12
Browse files Browse the repository at this point in the history
Signed-off-by: McKnight22 <tao.wang.22@outlook.com>
  • Loading branch information
McKnight22 authored and unicornx committed Dec 28, 2022
1 parent caf2b42 commit 9a716ee
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ config("extra_warnings") {
"-Wtautological-type-limit-compare",
"-Wundefined-reinterpret-cast",
"-Wunneeded-internal-declaration",
"-Wunused-but-set-variable",
# "-Wunused-but-set-variable",
"-Wsuggest-destructor-override",
"-Wsuggest-override",

Expand Down
2 changes: 1 addition & 1 deletion gni/angle.gni
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ declare_args() {

if (current_cpu == "arm64" || current_cpu == "x64" ||
current_cpu == "mips64el" || current_cpu == "s390x" ||
current_cpu == "ppc64" || current_cpu == "loong64") {
current_cpu == "ppc64" || current_cpu == "loong64" || current_cpu == "riscv64") {
angle_64bit_current_cpu = true
} else if (current_cpu == "arm" || current_cpu == "x86" ||
current_cpu == "mipsel" || current_cpu == "s390" ||
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/preprocessor/preprocessor_tab_autogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
#endif
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunreachable-code"
# pragma clang diagnostic ignored "-Wunused-but-set-variable"
// # pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

#include "ExpressionParser.h"
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/translator/glslang_tab_autogen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
#endif
#if defined(__clang__)
# pragma clang diagnostic ignored "-Wunreachable-code"
# pragma clang diagnostic ignored "-Wunused-but-set-variable"
// # pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif

#include "GLSLANG/ShaderLang.h"
Expand Down
7 changes: 7 additions & 0 deletions src/libGLESv2/global_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ constexpr size_t kAndroidOpenGLTlsSlot = 3;
__asm__("mov %%fs:0, %0" : "=r"(__val)); \
__val; \
})
# elif (defined(__riscv) && (__riscv_xlen == 64))
# define ANGLE_ANDROID_GET_GL_TLS() \
({ \
void** __val; \
__asm__("mv %0, tp" : "=r"(__val)); \
__val; \
})
# else
# error unsupported architecture
# endif
Expand Down
2 changes: 1 addition & 1 deletion src/third_party/libXNVCtrl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config("libXNVCtrl_config") {
# XextAddDisplay which will cause a failure.
cflags = [
"-Wno-incompatible-pointer-types-discards-qualifiers",
"-Wno-deprecated-non-prototype",
#"-Wno-deprecated-non-prototype",
]
}

Expand Down
2 changes: 1 addition & 1 deletion third_party/astc-encoder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ source_set("astcenc") {
}

if (is_clang) {
cflags_cc = [ "-Wno-unused-but-set-variable" ]
#cflags_cc = [ "-Wno-unused-but-set-variable" ]
}
}

0 comments on commit 9a716ee

Please sign in to comment.