Hi,
I am working on porting chromium browser to riscv64.
current_cpu="riscv64"
target_os="linux"
target_cpu="riscv64"
is_component_build = true
is_debug = false
symbol_level=0
v8_symbol_level=0
blink_symbol_level=0
# Disable broken features
use_gnome_keyring=false
enable_nacl = false
treat_warnings_as_errors = false
fatal_linker_warnings=false
enable_dav1d_decoder = false
enable_reading_list=false
enable_vr=false
enable_swiftshader=false
enable_libaom=false
# For custom clang
is_clang = true
clang_base_path = getenv("HOME") + "/riscv/_install"
clang_use_chrome_plugins = false
use_lld = false
I have added riscv64 into compiler gn:
+++ b/build/config/compiler/BUILD.gn
@@ -1163,6 +1163,12 @@ config("compiler_cpu_abi") {
cflags += [ "-m64" ]
ldflags += [ "-m64" ]
}
+ } else if (current_cpu == "riscv64") {
+ cflags += [
+ "-m64",
+ "-march=rv64gc",
+ "-mabi=lp64d",
+ ]
} else if (current_cpu == "s390x") {
I have also build a local copy of sysroot for riscv64 using debian port.
However, the build command was not taking my configurations and it is building for x86-64 (my host CPU) some how.
I would like to know how the cflags was passed within the build as some of the components did successfully build while now i'm getting error from borringssl.
FAILED: clang_x64_v8_riscv64/obj/third_party/boringssl/boringssl/ssl_cipher.o
../../../../riscv/_install/bin/clang++ -MMD -MF clang_x64_v8_riscv64/obj/third_party/boringssl/boringssl/ssl_cipher.o.d -DDCHECK_A
LWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARG
EFILE64_SOURCE -D_GNU_SOURCE -DCOMPONENT_BUILD -D_LIBCPP_ABI_UNSTABLE -D_LIBCPP_ABI_VERSION=Cr -D_LIBCPP_ENABLE_NODISCARD -D_LIBCP
P_DEBUG=0 -DCR_LIBCXX_REVISION=79a2e924d96e2fc1e4b937c42efd08898fa472d7 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DBOR
INGSSL_IMPLEMENTATION -DBORINGSSL_ALLOW_CXX_RUNTIME -DBORINGSSL_NO_STATIC_INITIALIZER -DOPENSSL_SMALL -DBORINGSSL_SHARED_LIBRARY -
I../.. -Iclang_x64_v8_riscv64/gen -I../../buildtools/third_party/libc++ -I../../third_party/boringssl/src/include -fno-delete-null
-pointer-checks -fno-ident -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -funwind-tables -fPIC -pthread -fcolo$
-diagnostics -fmerge-all-constants -fcrash-diagnostics-dir=../../tools/clang/crashreports -mllvm -instcombine-lower-dbg-declare=0
-ffp-contract=off -fcomplete-member-pointers -m64 -march=x86-64 -msse3 -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TI
MESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes -fno-omit-frame-pointer -g0 -ftrivial-auto-var-init=pattern -fvisibilit
y=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-
unused-but-set-variable -Wno-misleading-indentation -Wno-missing-field-initializers -Wno-unused-parameter -Wloop-analysis -Wno-unn
eeded-internal-declaration -Wenum-compare-conditional -Wno-psabi -Wno-ignored-pragma-optimize -O2 -fdata-sections -ffunction-secti
ons -fno-unique-section-names -std=c++17 -Wno-trigraphs -fno-aligned-new -fno-exceptions -fno-rtti -nostdinc++ -isystem../../build
tools/third_party/libc++/trunk/include -isystem../../buildtools/third_party/libc++abi/trunk/include --sysroot=../../build/linux/de
bian_sid_amd64-sysroot -fvisibility-inlines-hidden -c ../../third_party/boringssl/src/ssl/ssl_cipher.cc -o clang_x64_v8_riscv64/ob
j/third_party/boringssl/boringssl/ssl_cipher.o
clang++: error: invalid arch name 'x86-64', string must begin with rv32{i,e,g} or rv64{i,g}