Skip to content

Commit 1acb6b0

Browse files
feat(protoc): Add support for building protoc-gen-grpc-java on the RISC-V platform
1 parent 2039266 commit 1acb6b0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

compiler/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ model {
5858
cppCompiler.executable = 'aarch64-linux-gnu-g++'
5959
linker.executable = 'aarch64-linux-gnu-g++'
6060
}
61+
target("riscv64") {
62+
cppCompiler.executable = 'riscv64-openEuler-linux-g++'
63+
linker.executable = 'riscv64-openEuler-linux-g++'
64+
}
6165
target("s390_64") {
6266
cppCompiler.executable = 's390x-linux-gnu-g++'
6367
linker.executable = 's390x-linux-gnu-g++'
@@ -74,6 +78,7 @@ model {
7478
x86_64 { architecture "x86_64" }
7579
ppcle_64 { architecture "ppcle_64" }
7680
aarch_64 { architecture "aarch_64" }
81+
riscv64 { architecture "riscv64" }
7782
s390_64 { architecture "s390_64" }
7883
loongarch_64 { architecture "loongarch_64" }
7984
}
@@ -85,6 +90,7 @@ model {
8590
'x86_64',
8691
'ppcle_64',
8792
'aarch_64',
93+
'riscv64',
8894
's390_64',
8995
'loongarch_64'
9096
]) {

compiler/check-artifact.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ checkArch ()
6161
assertEq "$format" "elf64-x86-64" $LINENO
6262
elif [[ "$ARCH" == aarch_64 ]]; then
6363
assertEq "$format" "elf64-little" $LINENO
64+
elif [[ "$ARCH" == riscv64 ]]; then
65+
assertEq "$format" "elf64-littleriscv" $LINENO
6466
elif [[ "$ARCH" == loongarch_64 ]]; then
6567
echo $format
6668
assertEq "$format" "elf64-loongarch" $LINENO
@@ -121,6 +123,9 @@ checkDependencies ()
121123
white_list="${white_list}\|libm\.so\.6"
122124
elif [[ "$ARCH" == aarch_64 ]]; then
123125
white_list="${white_list}\|ld-linux-aarch64\.so\.1"
126+
elif [[ "$ARCH" == riscv64 ]]; then
127+
dump_cmd='riscv64-linux-gnu-objdump -x '"$1"' |grep "NEEDED"'
128+
white_list="libatomic\.so\.1\|libm\.so\.6\|libc\.so\.6\|ld-linux-riscv64-lp64d\.so\.1"
124129
fi
125130
elif [[ "$OS" == osx ]]; then
126131
dump_cmd='otool -L '"$1"' | fgrep dylib'

0 commit comments

Comments
 (0)