1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ChromiumをRISC-V向けにクロスビルドする

Last updated at Posted at 2025-10-27

概要

近年RISC-V移行の流れが盛んになってきている。
https://eetimes.itmedia.co.jp/ee/articles/2506/27/news072.html
Chromiumもその例に漏れずM139からRISC-Vでのビルドが可能になっている。(139.0.7231.0からRISC-Vのsysrootをインストールできるようになっている ので、未確認ではあるがこのバージョンからRISC-V向けビルドが可能なはずである)
ここではM143においてRISC-V向けにビルドする方法を解説する。

前提

  • Chromiumのソースコードをfetch済みである
    • fetch後以下のコマンドで143.0.7486.1にcheckoutすること
git checkout 143.0.7486.1
gclient sync

ビルド手順

依存関係・sysrootのインストール

以下のコマンドで依存関係及びdebian sysrootをインストールする。

cd src
./build/install-build-deps.sh
./build/linux/sysroot_scripts/install-sysroot.py --arch=riscv64

サンドボックス用RISC-Vパッチの適用

sandbox周りで以下のようなエラーが発生する。

エラーメッセージを表示
[24569/61591] CXX obj/sandbox/linux/sandbox_services/syscall_wrappers.o

FAILED: obj/sandbox/linux/sandbox_services/syscall_wrappers.o 

/usr/local/bin/ccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/sandbox/linux/sandbox_services/syscall_wrappers.o.d -DSANDBOX_IMPLEMENTATION -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-22-init-8940-g4d4cb757-84\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_INSTRUMENTED_WITH_ASAN=0 -DCR_LIBCXX_REVISION=c3fe874fc47fa69deabc42e9e013059b6bd708ab -DCR_SYSROOT_KEY=20250129T203412Z-1 -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../base/allocator/partition_allocator/src -Igen/base/allocator/partition_allocator/src -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wgnu -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-thread-safety-reference-return -Wno-nontrivial-memcall -Wno-uninitialized-const-pointer -Wexit-time-destructors -Wshadow -fno-delete-null-pointer-checks -fno-strict-overflow -fno-ident -fno-math-errno -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fno-sized-deallocation -fcrash-diagnostics-dir=../clang-crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=off -Wa,--crel,--allow-experimental-crel -fcomplete-member-pointers --target=riscv64-linux-gnu -mabi=lp64d -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes --warning-suppression-mappings=../../build/config/warning_suppression.txt -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Xclang -add-plugin -Xclang raw-ptr-plugin -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-to-stack-allocated -Xclang -plugin-arg-raw-ptr-plugin -Xclang disable-check-raw-ptr-to-stack-allocated-error -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../third_party/dawn/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../build/config/clang/chrome/test/fuzzing/webidl_fuzzing/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-span-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ref-fields -DUNSAFE_BUFFERS_BUILD -Xclang -add-plugin -Xclang unsafe-buffers -Xclang -plugin-arg-unsafe-buffers -Xclang ../../build/config/unsafe_buffers_paths.txt -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/sysprof-6 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/lib/riscv64-linux-gnu/glib-2.0/include -Wno-invalid-offsetof -Wenum-compare-conditional -Wno-nullability-completeness -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../build/linux/debian_trixie_riscv64-sysroot -fvisibility-inlines-hidden  -c ../../sandbox/linux/services/syscall_wrappers.cc -o obj/sandbox/linux/sandbox_services/syscall_wrappers.o

In file included from ../../sandbox/linux/services/syscall_wrappers.cc:30:

../../sandbox/linux/system_headers/linux_signal.h:65:2: error: "Unsupported platform"

    65 | #error "Unsupported platform"

       |  ^

../../sandbox/linux/system_headers/linux_signal.h:70:15: error: use of undeclared identifier 'LINUX_SIGHUP'

    70 | static_assert(LINUX_SIGHUP == SIGHUP, "LINUX_SIGHUP == SIGHUP");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:71:15: error: use of undeclared identifier 'LINUX_SIGINT'

    71 | static_assert(LINUX_SIGINT == SIGINT, "LINUX_SIGINT == SIGINT");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:72:15: error: use of undeclared identifier 'LINUX_SIGQUIT'

    72 | static_assert(LINUX_SIGQUIT == SIGQUIT, "LINUX_SIGQUIT == SIGQUIT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:73:15: error: use of undeclared identifier 'LINUX_SIGABRT'

    73 | static_assert(LINUX_SIGABRT == SIGABRT, "LINUX_SIGABRT == SIGABRT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:74:15: error: use of undeclared identifier 'LINUX_SIGBUS'

    74 | static_assert(LINUX_SIGBUS == SIGBUS, "LINUX_SIGBUS == SIGBUS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:75:15: error: use of undeclared identifier 'LINUX_SIGUSR1'

    75 | static_assert(LINUX_SIGUSR1 == SIGUSR1, "LINUX_SIGUSR1 == SIGUSR1");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:76:15: error: use of undeclared identifier 'LINUX_SIGSEGV'

    76 | static_assert(LINUX_SIGSEGV == SIGSEGV, "LINUX_SIGSEGV == SIGSEGV");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:77:15: error: use of undeclared identifier 'LINUX_SIGUSR2'

    77 | static_assert(LINUX_SIGUSR2 == SIGUSR2, "LINUX_SIGUSR2 == SIGUSR2");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:78:15: error: use of undeclared identifier 'LINUX_SIGPIPE'

    78 | static_assert(LINUX_SIGPIPE == SIGPIPE, "LINUX_SIGPIPE == SIGPIPE");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:79:15: error: use of undeclared identifier 'LINUX_SIGTERM'

    79 | static_assert(LINUX_SIGTERM == SIGTERM, "LINUX_SIGTERM == SIGTERM");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:80:15: error: use of undeclared identifier 'LINUX_SIGCHLD'

    80 | static_assert(LINUX_SIGCHLD == SIGCHLD, "LINUX_SIGCHLD == SIGCHLD");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:81:15: error: use of undeclared identifier 'LINUX_SIGSYS'

    81 | static_assert(LINUX_SIGSYS == SIGSYS, "LINUX_SIGSYS == SIGSYS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:82:15: error: use of undeclared identifier 'LINUX_SIG_BLOCK'

    82 | static_assert(LINUX_SIG_BLOCK == SIG_BLOCK, "LINUX_SIG_BLOCK == SIG_BLOCK");

       |               ^~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:83:15: error: use of undeclared identifier 'LINUX_SIG_UNBLOCK'

    83 | static_assert(LINUX_SIG_UNBLOCK == SIG_UNBLOCK,

       |               ^~~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:85:15: error: use of undeclared identifier 'LINUX_SA_SIGINFO'

    85 | static_assert(LINUX_SA_SIGINFO == SA_SIGINFO, "LINUX_SA_SIGINFO == SA_SIGINFO");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:86:15: error: use of undeclared identifier 'LINUX_SA_NODEFER'

    86 | static_assert(LINUX_SA_NODEFER == SA_NODEFER, "LINUX_SA_NODEFER == SA_NODEFER");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:87:15: error: use of undeclared identifier 'LINUX_SA_RESTART'

    87 | static_assert(LINUX_SA_RESTART == SA_RESTART, "LINUX_SA_RESTART == SA_RESTART");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:88:15: error: use of undeclared identifier 'LINUX_SIG_DFL'

    88 | static_assert(LINUX_SIG_DFL == SIG_DFL, "LINUX_SIG_DFL == SIG_DFL");

       |               ^~~~~~~~~~~~~

19 errors generated.

[24583/61591] CXX obj/sandbox/linux/sandbox_services/namespace_sandbox.o

FAILED: obj/sandbox/linux/sandbox_services/namespace_sandbox.o 

/usr/local/bin/ccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/sandbox/linux/sandbox_services/namespace_sandbox.o.d -DSANDBOX_IMPLEMENTATION -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-22-init-8940-g4d4cb757-84\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_INSTRUMENTED_WITH_ASAN=0 -DCR_LIBCXX_REVISION=c3fe874fc47fa69deabc42e9e013059b6bd708ab -DCR_SYSROOT_KEY=20250129T203412Z-1 -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../base/allocator/partition_allocator/src -Igen/base/allocator/partition_allocator/src -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wgnu -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-thread-safety-reference-return -Wno-nontrivial-memcall -Wno-uninitialized-const-pointer -Wexit-time-destructors -Wshadow -fno-delete-null-pointer-checks -fno-strict-overflow -fno-ident -fno-math-errno -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fno-sized-deallocation -fcrash-diagnostics-dir=../clang-crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=off -Wa,--crel,--allow-experimental-crel -fcomplete-member-pointers --target=riscv64-linux-gnu -mabi=lp64d -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes --warning-suppression-mappings=../../build/config/warning_suppression.txt -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Xclang -add-plugin -Xclang raw-ptr-plugin -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-to-stack-allocated -Xclang -plugin-arg-raw-ptr-plugin -Xclang disable-check-raw-ptr-to-stack-allocated-error -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../third_party/dawn/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../build/config/clang/chrome/test/fuzzing/webidl_fuzzing/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-span-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ref-fields -DUNSAFE_BUFFERS_BUILD -Xclang -add-plugin -Xclang unsafe-buffers -Xclang -plugin-arg-unsafe-buffers -Xclang ../../build/config/unsafe_buffers_paths.txt -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/sysprof-6 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/lib/riscv64-linux-gnu/glib-2.0/include -Wno-invalid-offsetof -Wenum-compare-conditional -Wno-nullability-completeness -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../build/linux/debian_trixie_riscv64-sysroot -fvisibility-inlines-hidden  -c ../../sandbox/linux/services/namespace_sandbox.cc -o obj/sandbox/linux/sandbox_services/namespace_sandbox.o

In file included from ../../sandbox/linux/services/namespace_sandbox.cc:30:

../../sandbox/linux/system_headers/linux_signal.h:65:2: error: "Unsupported platform"

    65 | #error "Unsupported platform"

       |  ^

../../sandbox/linux/system_headers/linux_signal.h:70:15: error: use of undeclared identifier 'LINUX_SIGHUP'

    70 | static_assert(LINUX_SIGHUP == SIGHUP, "LINUX_SIGHUP == SIGHUP");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:71:15: error: use of undeclared identifier 'LINUX_SIGINT'

    71 | static_assert(LINUX_SIGINT == SIGINT, "LINUX_SIGINT == SIGINT");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:72:15: error: use of undeclared identifier 'LINUX_SIGQUIT'

    72 | static_assert(LINUX_SIGQUIT == SIGQUIT, "LINUX_SIGQUIT == SIGQUIT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:73:15: error: use of undeclared identifier 'LINUX_SIGABRT'

    73 | static_assert(LINUX_SIGABRT == SIGABRT, "LINUX_SIGABRT == SIGABRT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:74:15: error: use of undeclared identifier 'LINUX_SIGBUS'

    74 | static_assert(LINUX_SIGBUS == SIGBUS, "LINUX_SIGBUS == SIGBUS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:75:15: error: use of undeclared identifier 'LINUX_SIGUSR1'

    75 | static_assert(LINUX_SIGUSR1 == SIGUSR1, "LINUX_SIGUSR1 == SIGUSR1");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:76:15: error: use of undeclared identifier 'LINUX_SIGSEGV'

    76 | static_assert(LINUX_SIGSEGV == SIGSEGV, "LINUX_SIGSEGV == SIGSEGV");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:77:15: error: use of undeclared identifier 'LINUX_SIGUSR2'

    77 | static_assert(LINUX_SIGUSR2 == SIGUSR2, "LINUX_SIGUSR2 == SIGUSR2");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:78:15: error: use of undeclared identifier 'LINUX_SIGPIPE'

    78 | static_assert(LINUX_SIGPIPE == SIGPIPE, "LINUX_SIGPIPE == SIGPIPE");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:79:15: error: use of undeclared identifier 'LINUX_SIGTERM'

    79 | static_assert(LINUX_SIGTERM == SIGTERM, "LINUX_SIGTERM == SIGTERM");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:80:15: error: use of undeclared identifier 'LINUX_SIGCHLD'

    80 | static_assert(LINUX_SIGCHLD == SIGCHLD, "LINUX_SIGCHLD == SIGCHLD");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:81:15: error: use of undeclared identifier 'LINUX_SIGSYS'

    81 | static_assert(LINUX_SIGSYS == SIGSYS, "LINUX_SIGSYS == SIGSYS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:82:15: error: use of undeclared identifier 'LINUX_SIG_BLOCK'

    82 | static_assert(LINUX_SIG_BLOCK == SIG_BLOCK, "LINUX_SIG_BLOCK == SIG_BLOCK");

       |               ^~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:83:15: error: use of undeclared identifier 'LINUX_SIG_UNBLOCK'

    83 | static_assert(LINUX_SIG_UNBLOCK == SIG_UNBLOCK,

       |               ^~~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:85:15: error: use of undeclared identifier 'LINUX_SA_SIGINFO'

    85 | static_assert(LINUX_SA_SIGINFO == SA_SIGINFO, "LINUX_SA_SIGINFO == SA_SIGINFO");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:86:15: error: use of undeclared identifier 'LINUX_SA_NODEFER'

    86 | static_assert(LINUX_SA_NODEFER == SA_NODEFER, "LINUX_SA_NODEFER == SA_NODEFER");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:87:15: error: use of undeclared identifier 'LINUX_SA_RESTART'

    87 | static_assert(LINUX_SA_RESTART == SA_RESTART, "LINUX_SA_RESTART == SA_RESTART");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:88:15: error: use of undeclared identifier 'LINUX_SIG_DFL'

    88 | static_assert(LINUX_SIG_DFL == SIG_DFL, "LINUX_SIG_DFL == SIG_DFL");

       |               ^~~~~~~~~~~~~

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.

[24586/61591] CXX obj/sandbox/linux/sandbox_services/credentials.o

FAILED: obj/sandbox/linux/sandbox_services/credentials.o 

/usr/local/bin/ccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/sandbox/linux/sandbox_services/credentials.o.d -DSANDBOX_IMPLEMENTATION -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-22-init-8940-g4d4cb757-84\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_INSTRUMENTED_WITH_ASAN=0 -DCR_LIBCXX_REVISION=c3fe874fc47fa69deabc42e9e013059b6bd708ab -DCR_SYSROOT_KEY=20250129T203412Z-1 -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_56 -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_56 -I../.. -Igen -I../../buildtools/third_party/libc++ -I../../third_party/perfetto/include -Igen/third_party/perfetto/build_config -Igen/third_party/perfetto -I../../base/allocator/partition_allocator/src -Igen/base/allocator/partition_allocator/src -I../../third_party/abseil-cpp -I../../third_party/boringssl/src/include -I../../third_party/protobuf/src -Wall -Wextra -Wimplicit-fallthrough -Wextra-semi -Wunreachable-code-aggressive -Wgnu -Wno-gnu-anonymous-struct -Wno-gnu-conditional-omitted-operand -Wno-gnu-include-next -Wno-gnu-label-as-value -Wno-gnu-redeclared-enum -Wno-gnu-statement-expression -Wno-gnu-zero-variadic-macro-arguments -Wno-zero-length-array -Wthread-safety -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-thread-safety-reference-return -Wno-nontrivial-memcall -Wno-uninitialized-const-pointer -Wexit-time-destructors -Wshadow -fno-delete-null-pointer-checks -fno-strict-overflow -fno-ident -fno-math-errno -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fno-sized-deallocation -fcrash-diagnostics-dir=../clang-crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=off -Wa,--crel,--allow-experimental-crel -fcomplete-member-pointers --target=riscv64-linux-gnu -mabi=lp64d -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes --warning-suppression-mappings=../../build/config/warning_suppression.txt -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Xclang -add-plugin -Xclang raw-ptr-plugin -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-to-stack-allocated -Xclang -plugin-arg-raw-ptr-plugin -Xclang disable-check-raw-ptr-to-stack-allocated-error -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../third_party/dawn/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../build/config/clang/chrome/test/fuzzing/webidl_fuzzing/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-span-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ref-fields -DUNSAFE_BUFFERS_BUILD -Xclang -add-plugin -Xclang unsafe-buffers -Xclang -plugin-arg-unsafe-buffers -Xclang ../../build/config/unsafe_buffers_paths.txt -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/glib-2.0 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/include/sysprof-6 -isystem../../build/linux/debian_trixie_riscv64-sysroot/usr/lib/riscv64-linux-gnu/glib-2.0/include -Wno-invalid-offsetof -Wenum-compare-conditional -Wno-nullability-completeness -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../build/linux/debian_trixie_riscv64-sysroot -fvisibility-inlines-hidden  -c ../../sandbox/linux/services/credentials.cc -o obj/sandbox/linux/sandbox_services/credentials.o

In file included from ../../sandbox/linux/services/credentials.cc:35:

../../sandbox/linux/system_headers/linux_signal.h:65:2: error: "Unsupported platform"

    65 | #error "Unsupported platform"

       |  ^

../../sandbox/linux/system_headers/linux_signal.h:70:15: error: use of undeclared identifier 'LINUX_SIGHUP'

    70 | static_assert(LINUX_SIGHUP == SIGHUP, "LINUX_SIGHUP == SIGHUP");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:71:15: error: use of undeclared identifier 'LINUX_SIGINT'

    71 | static_assert(LINUX_SIGINT == SIGINT, "LINUX_SIGINT == SIGINT");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:72:15: error: use of undeclared identifier 'LINUX_SIGQUIT'

    72 | static_assert(LINUX_SIGQUIT == SIGQUIT, "LINUX_SIGQUIT == SIGQUIT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:73:15: error: use of undeclared identifier 'LINUX_SIGABRT'

    73 | static_assert(LINUX_SIGABRT == SIGABRT, "LINUX_SIGABRT == SIGABRT");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:74:15: error: use of undeclared identifier 'LINUX_SIGBUS'

    74 | static_assert(LINUX_SIGBUS == SIGBUS, "LINUX_SIGBUS == SIGBUS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:75:15: error: use of undeclared identifier 'LINUX_SIGUSR1'

    75 | static_assert(LINUX_SIGUSR1 == SIGUSR1, "LINUX_SIGUSR1 == SIGUSR1");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:76:15: error: use of undeclared identifier 'LINUX_SIGSEGV'

    76 | static_assert(LINUX_SIGSEGV == SIGSEGV, "LINUX_SIGSEGV == SIGSEGV");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:77:15: error: use of undeclared identifier 'LINUX_SIGUSR2'

    77 | static_assert(LINUX_SIGUSR2 == SIGUSR2, "LINUX_SIGUSR2 == SIGUSR2");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:78:15: error: use of undeclared identifier 'LINUX_SIGPIPE'

    78 | static_assert(LINUX_SIGPIPE == SIGPIPE, "LINUX_SIGPIPE == SIGPIPE");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:79:15: error: use of undeclared identifier 'LINUX_SIGTERM'

    79 | static_assert(LINUX_SIGTERM == SIGTERM, "LINUX_SIGTERM == SIGTERM");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:80:15: error: use of undeclared identifier 'LINUX_SIGCHLD'

    80 | static_assert(LINUX_SIGCHLD == SIGCHLD, "LINUX_SIGCHLD == SIGCHLD");

       |               ^~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:81:15: error: use of undeclared identifier 'LINUX_SIGSYS'

    81 | static_assert(LINUX_SIGSYS == SIGSYS, "LINUX_SIGSYS == SIGSYS");

       |               ^~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:82:15: error: use of undeclared identifier 'LINUX_SIG_BLOCK'

    82 | static_assert(LINUX_SIG_BLOCK == SIG_BLOCK, "LINUX_SIG_BLOCK == SIG_BLOCK");

       |               ^~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:83:15: error: use of undeclared identifier 'LINUX_SIG_UNBLOCK'

    83 | static_assert(LINUX_SIG_UNBLOCK == SIG_UNBLOCK,

       |               ^~~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:85:15: error: use of undeclared identifier 'LINUX_SA_SIGINFO'

    85 | static_assert(LINUX_SA_SIGINFO == SA_SIGINFO, "LINUX_SA_SIGINFO == SA_SIGINFO");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:86:15: error: use of undeclared identifier 'LINUX_SA_NODEFER'

    86 | static_assert(LINUX_SA_NODEFER == SA_NODEFER, "LINUX_SA_NODEFER == SA_NODEFER");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:87:15: error: use of undeclared identifier 'LINUX_SA_RESTART'

    87 | static_assert(LINUX_SA_RESTART == SA_RESTART, "LINUX_SA_RESTART == SA_RESTART");

       |               ^~~~~~~~~~~~~~~~

../../sandbox/linux/system_headers/linux_signal.h:88:15: error: use of undeclared identifier 'LINUX_SIG_DFL'

    88 | static_assert(LINUX_SIG_DFL == SIG_DFL, "LINUX_SIG_DFL == SIG_DFL");

       |               ^~~~~~~~~~~~~

fatal error: too many errors emitted, stopping now [-ferror-limit=]

20 errors generated.

[24594/61591] CXX obj/components/sync/model/model/syncable_service_based_bridge.o

ninja: build stopped: subcommand failed.

これを回避するために4935120 を以下のコマンドでCherry-pickしコンフリクトを解消する。

git fetch https://chromium.googlesource.com/chromium/src refs/changes/20/4935120/3 && git cherry-pick -m 1 FETCH_HEAD

143.0.7486.1で適用した際の差分を以下に示す。

差分を表示
diff --git a/sandbox/features.gni b/sandbox/features.gni
index 8aa52983f78f8..8c5db2c6fa6cf 100644
--- a/sandbox/features.gni
+++ b/sandbox/features.gni
@@ -9,10 +9,4 @@
 use_seccomp_bpf = (is_linux || is_chromeos || is_android) &&
                   (current_cpu == "x86" || current_cpu == "x64" ||
                    current_cpu == "arm" || current_cpu == "arm64" ||
-                   current_cpu == "mipsel" || current_cpu == "mips64el" ||
-                   current_cpu == "riscv64")
-
-# SSBD (Speculative Store Bypass Disable) is a mitigation of Spectre Variant 4.
-# As Spectre Variant 4 can be mitigated by site isolation, opt-out SSBD on site
-# isolation fully applied platform.
-disable_seccomp_ssbd = use_seccomp_bpf && !is_android
+                   current_cpu == "mipsel" || current_cpu == "mips64el")
diff --git a/sandbox/linux/bpf_dsl/linux_syscall_ranges.h b/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
index 3bf3cb2571ec6..1d0590b7dd6ce 100644
--- a/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
+++ b/sandbox/linux/bpf_dsl/linux_syscall_ranges.h
@@ -56,12 +56,6 @@
 #define MAX_PUBLIC_SYSCALL __NR_syscalls
 #define MAX_SYSCALL MAX_PUBLIC_SYSCALL
 
-#elif defined(__riscv)
-
-#define MIN_SYSCALL 0u
-#define MAX_PUBLIC_SYSCALL 1024u
-#define MAX_SYSCALL MAX_PUBLIC_SYSCALL
-
 #else
 #error "Unsupported architecture"
 #endif
diff --git a/sandbox/linux/bpf_dsl/seccomp_macros.h b/sandbox/linux/bpf_dsl/seccomp_macros.h
index 49fc9a67011a2..87d5825aa3ddb 100644
--- a/sandbox/linux/bpf_dsl/seccomp_macros.h
+++ b/sandbox/linux/bpf_dsl/seccomp_macros.h
@@ -343,48 +343,6 @@ struct regs_struct {
 #define SECCOMP_PT_PARM4(_regs) (_regs).regs[3]
 #define SECCOMP_PT_PARM5(_regs) (_regs).regs[4]
 #define SECCOMP_PT_PARM6(_regs) (_regs).regs[5]
-
-#elif defined(__riscv)
-struct regs_struct {
-  unsigned long regs[32];
-};
-
-#define SECCOMP_ARCH AUDIT_ARCH_RISCV64
-
-#define SECCOMP_REG(_ctx, _reg) ((_ctx)->uc_mcontext.__gregs[_reg])
-
-#define SECCOMP_RESULT(_ctx) SECCOMP_REG(_ctx, REG_A0)
-#define SECCOMP_SYSCALL(_ctx) SECCOMP_REG(_ctx, REG_A0+7)
-#define SECCOMP_IP(_ctx) (_ctx)->uc_mcontext.__gregs[REG_PC]
-#define SECCOMP_PARM1(_ctx) SECCOMP_REG(_ctx, REG_A0)
-#define SECCOMP_PARM2(_ctx) SECCOMP_REG(_ctx, REG_A0+1)
-#define SECCOMP_PARM3(_ctx) SECCOMP_REG(_ctx, REG_A0+2)
-#define SECCOMP_PARM4(_ctx) SECCOMP_REG(_ctx, REG_A0+3)
-#define SECCOMP_PARM5(_ctx) SECCOMP_REG(_ctx, REG_A0+4)
-#define SECCOMP_PARM6(_ctx) SECCOMP_REG(_ctx, REG_A0+5)
-#define SECCOMP_PARM7(_ctx) SECCOMP_REG(_ctx, REG_A0+6)
-
-#define SECCOMP_NR_IDX (offsetof(struct arch_seccomp_data, nr))
-#define SECCOMP_ARCH_IDX (offsetof(struct arch_seccomp_data, arch))
-#define SECCOMP_IP_MSB_IDX \
-  (offsetof(struct arch_seccomp_data, instruction_pointer) + 4)
-#define SECCOMP_IP_LSB_IDX \
-  (offsetof(struct arch_seccomp_data, instruction_pointer) + 0)
-#define SECCOMP_ARG_MSB_IDX(nr) \
-  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 4)
-#define SECCOMP_ARG_LSB_IDX(nr) \
-  (offsetof(struct arch_seccomp_data, args) + 8 * (nr) + 0)
-
-#define SECCOMP_PT_RESULT(_regs) (_regs).regs[REG_A0]
-#define SECCOMP_PT_SYSCALL(_regs) (_regs).regs[REG_A0+7]
-#define SECCOMP_PT_IP(_regs) (_regs).regs[REG_PC]
-#define SECCOMP_PT_PARM1(_regs) (_regs).regs[REG_A0]
-#define SECCOMP_PT_PARM2(_regs) (_regs).regs[REG_A0+1]
-#define SECCOMP_PT_PARM3(_regs) (_regs).regs[REG_A0+2]
-#define SECCOMP_PT_PARM4(_regs) (_regs).regs[REG_A0+3]
-#define SECCOMP_PT_PARM5(_regs) (_regs).regs[REG_A0+4]
-#define SECCOMP_PT_PARM6(_regs) (_regs).regs[REG_A0+5]
-#define SECCOMP_PT_PARM7(_regs) (_regs).regs[REG_A0+6]
 #else
 #error Unsupported target platform
 
diff --git a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
index b02b54764cd76..8e0e52ad4b892 100644
--- a/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
+++ b/sandbox/linux/integration_tests/bpf_dsl_seccomp_unittest.cc
@@ -22,7 +22,6 @@
 #include <sys/types.h>
 #include <sys/utsname.h>
 #include <unistd.h>
-#include <linux/elf.h>
 
 #include <array>
 #include <memory>
@@ -2034,15 +2033,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
     BPF_ASSERT_EQ(kTraceData, data);
 
     regs_struct regs;
-#if defined(__riscv)
-    iovec iov;
-    iov.iov_base = &regs;
-    iov.iov_len = sizeof(regs);
-    BPF_ASSERT_NE(-1, ptrace(PTRACE_GETREGSET, pid,
-                             reinterpret_case<void*>(NT_PRSTATUS), &iov));
-#else
     BPF_ASSERT_NE(-1, ptrace(PTRACE_GETREGS, pid, NULL, &regs));
-#endif
     switch (SECCOMP_PT_SYSCALL(regs)) {
       case __NR_write:
         // Skip writes to stdout, make it return kExpectedReturnValue.  Allow
@@ -2050,14 +2041,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
         if (SECCOMP_PT_PARM1(regs) == STDOUT_FILENO) {
           BPF_ASSERT_NE(-1, SetSyscall(pid, &regs, -1));
           SECCOMP_PT_RESULT(regs) = kExpectedReturnValue;
-#if defined(__riscv)
-          iov.iov_len = sizeof(regs);
-          BPF_ASSERT_NE(-1, ptrace(PTRACE_SETREGSET, pid,
-                                   reinterpret_cast<void*>(NT_PRSTATUS),
-                                   &iov));
-#else
           BPF_ASSERT_NE(-1, ptrace(PTRACE_SETREGS, pid, NULL, &regs));
-#endif
         }
         break;
 
@@ -2065,13 +2049,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
         // Rewrite to exit(kExpectedReturnValue).
         BPF_ASSERT_NE(-1, SetSyscall(pid, &regs, __NR_exit));
         SECCOMP_PT_PARM1(regs) = kExpectedReturnValue;
-#if defined(__riscv)
-        iov.iov_len = sizeof(regs);
-        BPF_ASSERT_NE(-1, ptrace(PTRACE_SETREGSET, pid,
-                                 reinterpret_cast<void*>(NT_PRSTATUS), &iov));
-#else
         BPF_ASSERT_NE(-1, ptrace(PTRACE_SETREGS, pid, NULL, &regs));
-#endif
         break;
 
       default:
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
index 006446fa327e1..56ba083eb81f8 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -59,9 +59,6 @@ bool IsBaselinePolicyAllowed(int sysno) {
 #endif
 #if defined(__mips__)
          SyscallSets::IsMipsPrivate(sysno) ||
-#endif
-#if defined(__riscv)
-         SyscallSets::IsRiscvPrivate(sysno) ||
 #endif
          SyscallSets::IsAllowedOperationOnFd(sysno);
   // clang-format on
@@ -200,7 +197,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
     return RestrictFcntlCommands();
 #endif
 
-#if !defined(__aarch64__) && !defined(__riscv)
+#if defined(__NR_fork)
   // fork() is never used as a system call (clone() is used instead), but we
   // have seen it in fallback code on Android.
   if (sysno == __NR_fork) {
@@ -262,7 +259,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
 
   // TODO(crbug.com/40528912): should i386 really be in this list?
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
   if (sysno == __NR_mmap)
     return RestrictMmapFlags();
 #endif
@@ -370,7 +367,7 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
   // Allow creating pipes, but don't allow weird flags to pipe2().
   // O_NOTIFICATION_PIPE (== O_EXCL) can be used to create
   // "notification pipes", which are rarely used.
-#if !defined(__aarch64__) && !defined(__riscv)
+#if defined(__NR_pipe)
   if (sysno == __NR_pipe) {
     return Allow();
   }
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
index 0a0ec6d9b4a09..34357796e84ea 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy_unittest.cc
@@ -275,7 +275,7 @@ BPF_TEST_C(BaselinePolicy, GetRandom, BaselinePolicy) {
 }
 
 // Not all architectures can restrict the domain for socketpair().
-#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__riscv)
+#if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
 BPF_DEATH_TEST_C(BaselinePolicy,
                  SocketpairWrongDomain,
                  DEATH_SEGV_MESSAGE(GetErrorMessageContentForTests()),
@@ -284,7 +284,7 @@ BPF_DEATH_TEST_C(BaselinePolicy,
   std::ignore = socketpair(AF_INET, SOCK_STREAM, 0, sv);
   _exit(1);
 }
-#endif  // defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || defined(__riscv)
+#endif  // defined(__x86_64__) || defined(__arm__) || defined(__aarch64__)
 
 BPF_TEST_C(BaselinePolicy, EPERM_open, BaselinePolicy) {
   errno = 0;
@@ -348,7 +348,7 @@ TEST_BASELINE_SIGSYS(__NR_sysinfo)
 TEST_BASELINE_SIGSYS(__NR_syslog)
 TEST_BASELINE_SIGSYS(__NR_timer_create)
 
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
 TEST_BASELINE_SIGSYS(__NR_inotify_init)
 TEST_BASELINE_SIGSYS(__NR_vserver)
 #endif
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
index bc844006bfc90..c160e6e454217 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
@@ -45,7 +45,6 @@
 #endif
 
 #if BUILDFLAG(IS_LINUX) && !defined(__arm__) && !defined(__aarch64__) && \
-    !defined(__riscv) &&                                      \
     !defined(PTRACE_GET_THREAD_AREA)
 // Also include asm/ptrace-abi.h since ptrace.h in older libc (for instance
 // the one in Ubuntu 16.04 LTS) is missing PTRACE_GET_THREAD_AREA.
@@ -490,10 +489,8 @@ ResultExpr RestrictPtrace() {
 #endif
   return Switch(request)
       .Cases({
-#if !defined(__aarch64__) && !defined(__riscv)
-                 PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA,
-#endif
 #if !defined(__aarch64__)
+                 PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GET_THREAD_AREA,
                  PTRACE_GETREGSET,
 #endif
 #if defined(__arm__)
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
index 1c694afaf89ab..d1367dfc30a5a 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions_unittests.cc
@@ -7,7 +7,6 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/elf.h>
-#include <asm/ptrace.h>
 #include <sched.h>
 #include <sys/mman.h>
 #include <sys/prctl.h>
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
index 0813e6daee16c..f3b9561aaf601 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
@@ -103,7 +103,7 @@ bool SyscallSets::IsUmask(int sysno) {
 // Both EPERM and ENOENT are valid errno unless otherwise noted in comment.
 bool SyscallSets::IsFileSystem(int sysno) {
   switch (sysno) {
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_access:  // EPERM not a valid errno.
     case __NR_chmod:
     case __NR_chown:
@@ -136,7 +136,7 @@ bool SyscallSets::IsFileSystem(int sysno) {
     case __NR_faccessat2:
     case __NR_fchmodat:
     case __NR_fchownat:  // Should be called chownat ?
-#if defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)
+#if defined(__x86_64__) || defined(__aarch64__)
     case __NR_newfstatat:  // fstatat(). EPERM not a valid errno.
 #elif defined(__i386__) || defined(__arm__) || \
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
@@ -241,7 +241,7 @@ bool SyscallSets::IsAllowedFileSystemAccessViaFd(int sysno) {
     case __NR_oldfstat:
 #endif
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_sync_file_range:  // EPERM not a valid errno.
 #elif defined(__arm__)
     case __NR_arm_sync_file_range:  // EPERM not a valid errno.
@@ -260,7 +260,7 @@ bool SyscallSets::IsDeniedFileSystemAccessViaFd(int sysno) {
 #if defined(__i386__) || defined(__arm__)
     case __NR_fchown32:
 #endif
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_getdents:    // EPERM not a valid errno.
 #endif
     case __NR_getdents64:  // EPERM not a valid errno.
@@ -339,7 +339,7 @@ bool SyscallSets::IsProcessPrivilegeChange(int sysno) {
 bool SyscallSets::IsProcessGroupOrSession(int sysno) {
   switch (sysno) {
     case __NR_setpgid:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_getpgrp:
 #endif
     case __NR_setsid:
@@ -373,7 +373,7 @@ bool SyscallSets::IsAllowedSignalHandling(int sysno) {
     case __NR_rt_sigqueueinfo:
     case __NR_rt_sigsuspend:
     case __NR_rt_tgsigqueueinfo:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_signalfd:
 #endif
     case __NR_signalfd4:
@@ -397,12 +397,12 @@ bool SyscallSets::IsAllowedOperationOnFd(int sysno) {
   switch (sysno) {
     case __NR_close:
     case __NR_dup:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_dup2:
 #endif
     case __NR_dup3:
 #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_shutdown:
 #endif
       return true;
@@ -441,7 +441,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
       return true;
     case __NR_clone:  // Should be parameter-restricted.
     case __NR_setns:  // Privileged.
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_fork:
 #endif
 #if defined(__i386__) || defined(__x86_64__)
@@ -452,7 +452,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
 #endif
     case __NR_set_tid_address:
     case __NR_unshare:
-#if !defined(__mips__) && !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__mips__) && !defined(__aarch64__)
     case __NR_vfork:
 #endif
     default:
@@ -477,7 +477,7 @@ bool SyscallSets::IsAllowedFutex(int sysno) {
 
 bool SyscallSets::IsAllowedEpoll(int sysno) {
   switch (sysno) {
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_epoll_create:
     case __NR_epoll_wait:
 #endif
@@ -499,7 +499,7 @@ bool SyscallSets::IsAllowedEpoll(int sysno) {
 bool SyscallSets::IsDeniedGetOrModifySocket(int sysno) {
   switch (sysno) {
 #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_accept:
     case __NR_accept4:
     case __NR_bind:
@@ -554,7 +554,7 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
     case __NR_mincore:
     case __NR_mlockall:
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_mmap:
 #endif
 #if defined(__i386__) || defined(__arm__) || \
@@ -587,7 +587,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
     case __NR__llseek:
 #endif
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_poll:
 #endif
     case __NR_ppoll:
@@ -608,7 +608,7 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
     case __NR_recv:
 #endif
 #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_recvfrom:  // Could specify source.
     case __NR_recvmsg:   // Could specify source.
 #endif
@@ -617,15 +617,6 @@ bool SyscallSets::IsAllowedGeneralIo(int sysno) {
 #endif
 #if defined(__i386__) || defined(__arm__) || defined(__mips__)
     case __NR__newselect:
-#endif
-#if defined(__arm__) || \
-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
-    case __NR_send:
-#endif
-#if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
-    case __NR_sendmsg:  // Could specify destination.
-    case __NR_sendto:   // Could specify destination.
 #endif
     case __NR_write:
     case __NR_writev:
@@ -699,7 +690,7 @@ bool SyscallSets::IsSeccomp(int sysno) {
 bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
   switch (sysno) {
     case __NR_sched_yield:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_pause:
 #endif
     case __NR_nanosleep:
@@ -783,7 +774,7 @@ bool SyscallSets::IsNuma(int sysno) {
     case __NR_getcpu:
     case __NR_mbind:
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_migrate_pages:
 #endif
     case __NR_move_pages:
@@ -818,7 +809,7 @@ bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
   switch (sysno) {
     case __NR_acct:  // Privileged.
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
 #endif
 #if defined(__i386__) || defined(__arm__)
@@ -853,7 +844,7 @@ bool SyscallSets::IsDebug(int sysno) {
 
 bool SyscallSets::IsGlobalSystemStatus(int sysno) {
   switch (sysno) {
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR__sysctl:
     case __NR_sysfs:
 #endif
@@ -871,7 +862,7 @@ bool SyscallSets::IsGlobalSystemStatus(int sysno) {
 
 bool SyscallSets::IsEventFd(int sysno) {
   switch (sysno) {
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_eventfd:
 #endif
     case __NR_eventfd2:
@@ -923,7 +914,6 @@ bool SyscallSets::IsKeyManagement(int sysno) {
 }
 
 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
-    defined(__riscv) ||                                                \
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
 bool SyscallSets::IsSystemVSemaphores(int sysno) {
   switch (sysno) {
@@ -943,7 +933,7 @@ bool SyscallSets::IsSystemVSemaphores(int sysno) {
 #endif
 
 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
-    defined(__aarch64__) || defined(__riscv) ||                     \
+    defined(__aarch64__) ||                                         \
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
 // These give a lot of ambient authority and bypass the setuid sandbox.
 bool SyscallSets::IsSystemVSharedMemory(int sysno) {
@@ -960,7 +950,6 @@ bool SyscallSets::IsSystemVSharedMemory(int sysno) {
 #endif
 
 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
-    defined(__riscv) ||                                                \
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
 bool SyscallSets::IsSystemVMessageQueue(int sysno) {
   switch (sysno) {
@@ -992,7 +981,6 @@ bool SyscallSets::IsSystemVIpc(int sysno) {
 
 bool SyscallSets::IsAnySystemV(int sysno) {
 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
-    defined(__riscv) ||                                                \
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
   return IsSystemVMessageQueue(sysno) || IsSystemVSemaphores(sysno) ||
          IsSystemVSharedMemory(sysno);
@@ -1030,7 +1018,7 @@ bool SyscallSets::IsAdvancedScheduler(int sysno) {
 bool SyscallSets::IsInotify(int sysno) {
   switch (sysno) {
     case __NR_inotify_add_watch:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_inotify_init:
 #endif
     case __NR_inotify_init1:
@@ -1165,7 +1153,7 @@ bool SyscallSets::IsMisc(int sysno) {
 #if defined(__x86_64__)
     case __NR_tuxcall:
 #endif
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_vserver:
 #endif
       return true;
@@ -1224,18 +1212,6 @@ bool SyscallSets::IsMipsMisc(int sysno) {
 }
 #endif  // defined(__mips__)
 
-#if defined(__riscv)
-bool SyscallSets::IsRiscvPrivate(int sysno) {
-  switch (sysno) {
-    case __NR_riscv_hwprobe:
-    case __NR_riscv_flush_icache:
-      return true;
-    default:
-      return false;
-  }
-}
-#endif  // defined(__riscv)
-
 bool SyscallSets::IsGoogle3Threading(int sysno) {
   switch (sysno) {
     case __NR_getitimer:
diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
index af841baac9ae5..fa49942cb8a9e 100644
--- a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
+++ b/sandbox/linux/seccomp-bpf-helpers/syscall_sets.h
@@ -52,7 +52,7 @@ class SANDBOX_EXPORT SyscallSets {
 #endif
 
 #if defined(__x86_64__) || defined(__arm__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
   static bool IsNetworkSocketInformation(int sysno);
 #endif
 
@@ -80,21 +80,18 @@ class SANDBOX_EXPORT SyscallSets {
   static bool IsAsyncIo(int sysno);
   static bool IsKeyManagement(int sysno);
 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \
-    defined(__riscv)
+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
   static bool IsSystemVSemaphores(int sysno);
 #endif
 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
     defined(__aarch64__) ||                                         \
-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \
-    defined(__riscv)
+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
   // These give a lot of ambient authority and bypass the setuid sandbox.
   static bool IsSystemVSharedMemory(int sysno);
 #endif
 
 #if defined(__x86_64__) || defined(__arm__) || defined(__aarch64__) || \
-    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS)) || \
-    defined(__riscv)
+    (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_64_BITS))
   static bool IsSystemVMessageQueue(int sysno);
 #endif
 
@@ -121,9 +118,6 @@ class SANDBOX_EXPORT SyscallSets {
   static bool IsMipsPrivate(int sysno);
   static bool IsMipsMisc(int sysno);
 #endif  // defined(__mips__)
-#if defined(__riscv)
-  static bool IsRiscvPrivate(int sysno);
-#endif
   static bool IsGoogle3Threading(int sysno);
 };
 
diff --git a/sandbox/linux/seccomp-bpf/syscall.cc b/sandbox/linux/seccomp-bpf/syscall.cc
index ab72f9d697ba9..b0cdc71b8f972 100644
--- a/sandbox/linux/seccomp-bpf/syscall.cc
+++ b/sandbox/linux/seccomp-bpf/syscall.cc
@@ -19,7 +19,7 @@ namespace sandbox {
 namespace {
 
 #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
-    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY)
+    defined(ARCH_CPU_MIPS_FAMILY)
 // Number that's not currently used by any Linux kernel ABIs.
 const int kInvalidSyscallNumber = 0x351d3;
 #else
@@ -309,28 +309,6 @@ asm(// We need to be able to tell the kernel exactly where we made a
     "2:ret\n"
     ".cfi_endproc\n"
     ".size SyscallAsm, .-SyscallAsm\n"
-#elif defined(__riscv)
-    ".text\n"
-    ".align 2\n"
-    ".type SyscallAsm, %function\n"
-    "SyscallAsm:\n"
-    ".cfi_startproc\n"
-    "bgez a0,1f\n"
-    "lla a0,2f\n"
-    "j 2f\n"
-    "1:mv a7, a0\n"
-    "ld a0, (a1)\n"
-    "ld a2, 16(a1)\n"
-    "ld a3, 24(a1)\n"
-    "ld a4, 32(a1)\n"
-    "ld a5, 40(a1)\n"
-    "ld a6, 48(a1)\n"
-    "ld a1, 8(a1)\n"
-    // Enter the kernel
-    "scall\n"
-    "2:ret\n"
-    ".cfi_endproc\n"
-    ".size SyscallAsm, .-SyscallAsm\n"
 #endif
     );  // asm
 
@@ -342,10 +320,6 @@ intptr_t SyscallAsm(intptr_t nr, const intptr_t args[6]);
 extern "C" {
 intptr_t SyscallAsm(intptr_t nr, const intptr_t args[8]);
 }
-#elif defined(__riscv)
-extern "C" {
-intptr_t SyscallAsm(intptr_t nr, const intptr_t args[7]);
-}
 #endif
 
 }  // namespace
@@ -378,10 +352,6 @@ intptr_t Syscall::Call(int nr,
   //                 where that makes sense.
 #if defined(__mips__)
   const intptr_t args[8] = {p0, p1, p2, p3, p4, p5, p6, p7};
-#elif defined(__riscv)
-  DCHECK_EQ(p7, 0) << " Support for syscalls with more than seven arguments "
-                      "not added for this architecture";
-  const intptr_t args[7] = {p0, p1, p2, p3, p4, p5, p6};
 #else
   DCHECK_EQ(p6, 0) << " Support for syscalls with more than six arguments not "
                       "added for this architecture";
@@ -456,8 +426,6 @@ intptr_t Syscall::Call(int nr,
     ret = inout;
   }
 
-#elif defined(__riscv)
-  intptr_t ret = SyscallAsm(nr, args);
 #else
 #error "Unimplemented architecture"
 #endif
diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
index bca98f0a4ba23..9fbefe3e8b7bc 100644
--- a/sandbox/linux/seccomp-bpf/trap.cc
+++ b/sandbox/linux/seccomp-bpf/trap.cc
@@ -221,18 +221,6 @@ void Trap::SigSys(int nr, LinuxSigInfo* info, ucontext_t* ctx) {
                        SECCOMP_PARM6(ctx),
                        SECCOMP_PARM7(ctx),
                        SECCOMP_PARM8(ctx));
-#elif defined(__riscv)
-    // RISC-V supports up to seven arguments for syscall.
-    // However, seccomp bpf can filter only up to six arguments, so using seven
-    // arguments has sense only when using UnsafeTrap() handler.
-    rc = Syscall::Call(SECCOMP_SYSCALL(ctx),
-                       SECCOMP_PARM1(ctx),
-                       SECCOMP_PARM2(ctx),
-                       SECCOMP_PARM3(ctx),
-                       SECCOMP_PARM4(ctx),
-                       SECCOMP_PARM5(ctx),
-                       SECCOMP_PARM6(ctx),
-                       SECCOMP_PARM7(ctx));
 #else
     rc = Syscall::Call(SECCOMP_SYSCALL(ctx),
                        SECCOMP_PARM1(ctx),
diff --git a/sandbox/linux/services/credentials.cc b/sandbox/linux/services/credentials.cc
index 36ddff923b484..baeb313a6d958 100644
--- a/sandbox/linux/services/credentials.cc
+++ b/sandbox/linux/services/credentials.cc
@@ -85,7 +85,7 @@ bool ChrootToSafeEmptyDir() {
   alignas(16) std::array<char, PTHREAD_STACK_MIN_CONST> stack_buf;
 
 #if defined(ARCH_CPU_X86_FAMILY) || defined(ARCH_CPU_ARM_FAMILY) || \
-    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY)
+    defined(ARCH_CPU_MIPS_FAMILY)
   // SAFETY: This is the `stack` argument of `clone(2)`. Because the stack grows
   // downward on these architectures, this is the topmost address of the memory
   // space for the stack, and the address will not be dereferenced.
diff --git a/sandbox/linux/services/syscall_wrappers.cc b/sandbox/linux/services/syscall_wrappers.cc
index 7f5efdfaba2d5..ecc897e27c63c 100644
--- a/sandbox/linux/services/syscall_wrappers.cc
+++ b/sandbox/linux/services/syscall_wrappers.cc
@@ -68,7 +68,7 @@ long sys_clone(unsigned long flags,
 #if defined(ARCH_CPU_X86_64)
   return syscall(__NR_clone, flags, child_stack, ptid, ctid, tls);
 #elif defined(ARCH_CPU_X86) || defined(ARCH_CPU_ARM_FAMILY) || \
-    defined(ARCH_CPU_MIPS_FAMILY) || defined(ARCH_CPU_RISCV_FAMILY)
+    defined(ARCH_CPU_MIPS_FAMILY)
   // CONFIG_CLONE_BACKWARDS defined.
   return syscall(__NR_clone, flags, child_stack, ptid, tls, ctid);
 #endif
diff --git a/sandbox/linux/syscall_broker/broker_process.cc b/sandbox/linux/syscall_broker/broker_process.cc
index 23945954a7216..9845f875091c6 100644
--- a/sandbox/linux/syscall_broker/broker_process.cc
+++ b/sandbox/linux/syscall_broker/broker_process.cc
@@ -120,46 +120,44 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const {
   // and are default disabled in Android. So, we should refuse to broker them
   // to be consistent with the platform's restrictions.
   switch (sysno) {
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_access:
 #endif
     case __NR_faccessat:
     case __NR_faccessat2:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_ACCESS);
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_mkdir:
 #endif
     case __NR_mkdirat:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_MKDIR);
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_open:
 #endif
     case __NR_openat:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_OPEN);
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_readlink:
 #endif
     case __NR_readlinkat:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_READLINK);
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_rename:
 #endif
-#ifdef __NR_renameat
     case __NR_renameat:
-#endif
     case __NR_renameat2:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_RENAME);
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_rmdir:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_RMDIR);
 #endif
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_stat:
     case __NR_lstat:
 #endif
@@ -169,7 +167,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const {
 #if defined(__NR_fstatat64)
     case __NR_fstatat64:
 #endif
-#if defined(__x86_64__) || defined(__aarch64__) || defined(__riscv)
+#if defined(__x86_64__) || defined(__aarch64__)
     case __NR_newfstatat:
 #endif
       return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT);
@@ -184,7 +182,7 @@ bool BrokerProcess::IsSyscallBrokerable(int sysno, bool fast_check) const {
       return !fast_check || policy_->allowed_command_set.test(COMMAND_STAT);
 #endif
 
-#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID) && !defined(__riscv)
+#if !defined(__aarch64__) && !BUILDFLAG(IS_ANDROID)
     case __NR_unlink:
       return !fast_check || policy_->allowed_command_set.test(COMMAND_UNLINK);
 #endif
diff --git a/sandbox/linux/system_headers/linux_seccomp.h b/sandbox/linux/system_headers/linux_seccomp.h
index dec2afc744985..8690a96eb01b1 100644
--- a/sandbox/linux/system_headers/linux_seccomp.h
+++ b/sandbox/linux/system_headers/linux_seccomp.h
@@ -39,10 +39,6 @@
 #define EM_AARCH64 183
 #endif
 
-#ifndef EM_RISCV
-#define EM_RISCV 243
-#endif
-
 #ifndef __AUDIT_ARCH_64BIT
 #define __AUDIT_ARCH_64BIT 0x80000000
 #endif
@@ -75,10 +71,6 @@
 #define AUDIT_ARCH_AARCH64 (EM_AARCH64 | __AUDIT_ARCH_64BIT | __AUDIT_ARCH_LE)
 #endif
 
-#ifndef AUDIT_ARCH_RISCV64
-#define AUDIT_ARCH_RISCV64 (EM_RISCV|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
-#endif
-
 // For prctl.h
 #ifndef PR_SET_SECCOMP
 #define PR_SET_SECCOMP               22
diff --git a/sandbox/linux/system_headers/linux_signal.h b/sandbox/linux/system_headers/linux_signal.h
index 2ffe30973cd32..69ccaf1081578 100644
--- a/sandbox/linux/system_headers/linux_signal.h
+++ b/sandbox/linux/system_headers/linux_signal.h
@@ -13,7 +13,7 @@
 // (not undefined, but defined different values and in different memory
 // layouts). So, fill the gap here.
 #if defined(__i386__) || defined(__x86_64__) || defined(__arm__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
 
 #define LINUX_SIGHUP 1
 #define LINUX_SIGINT 2
diff --git a/sandbox/linux/system_headers/linux_stat.h b/sandbox/linux/system_headers/linux_stat.h
index 74977adb53caf..3aae8cbced775 100644
--- a/sandbox/linux/system_headers/linux_stat.h
+++ b/sandbox/linux/system_headers/linux_stat.h
@@ -150,7 +150,7 @@ struct kernel_stat {
   int st_blocks;
   int st_pad4[14];
 };
-#elif defined(__aarch64__) || defined(__riscv)
+#elif defined(__aarch64__)
 struct kernel_stat {
   unsigned long st_dev;
   unsigned long st_ino;
diff --git a/sandbox/linux/system_headers/linux_syscalls.h b/sandbox/linux/system_headers/linux_syscalls.h
index d460cb7e7f1db..450fe3b5427a6 100644
--- a/sandbox/linux/system_headers/linux_syscalls.h
+++ b/sandbox/linux/system_headers/linux_syscalls.h
@@ -44,8 +44,4 @@
 #include "sandbox/linux/system_headers/arm64_linux_syscalls.h"
 #endif
 
-#if defined(__riscv) && __riscv_xlen == 64
-#include "sandbox/linux/system_headers/riscv64_linux_syscalls.h"
-#endif
-
 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
diff --git a/sandbox/linux/system_headers/riscv64_linux_syscalls.h b/sandbox/linux/system_headers/riscv64_linux_syscalls.h
deleted file mode 100644
index 50e043d0ab91b..0000000000000
--- a/sandbox/linux/system_headers/riscv64_linux_syscalls.h
+++ /dev/null
@@ -1,1226 +0,0 @@
-// Copyright 2014 The Chromium Authors
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_
-#define SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_
-
-#include <asm-generic/unistd.h>
-
-#if !defined(__NR_io_setup)
-#define __NR_io_setup 0
-#endif
-
-#if !defined(__NR_io_destroy)
-#define __NR_io_destroy 1
-#endif
-
-#if !defined(__NR_io_submit)
-#define __NR_io_submit 2
-#endif
-
-#if !defined(__NR_io_cancel)
-#define __NR_io_cancel 3
-#endif
-
-#if !defined(__NR_io_getevents)
-#define __NR_io_getevents 4
-#endif
-
-#if !defined(__NR_setxattr)
-#define __NR_setxattr 5
-#endif
-
-#if !defined(__NR_lsetxattr)
-#define __NR_lsetxattr 6
-#endif
-
-#if !defined(__NR_fsetxattr)
-#define __NR_fsetxattr 7
-#endif
-
-#if !defined(__NR_getxattr)
-#define __NR_getxattr 8
-#endif
-
-#if !defined(__NR_lgetxattr)
-#define __NR_lgetxattr 9
-#endif
-
-#if !defined(__NR_fgetxattr)
-#define __NR_fgetxattr 10
-#endif
-
-#if !defined(__NR_listxattr)
-#define __NR_listxattr 11
-#endif
-
-#if !defined(__NR_llistxattr)
-#define __NR_llistxattr 12
-#endif
-
-#if !defined(__NR_flistxattr)
-#define __NR_flistxattr 13
-#endif
-
-#if !defined(__NR_removexattr)
-#define __NR_removexattr 14
-#endif
-
-#if !defined(__NR_lremovexattr)
-#define __NR_lremovexattr 15
-#endif
-
-#if !defined(__NR_fremovexattr)
-#define __NR_fremovexattr 16
-#endif
-
-#if !defined(__NR_getcwd)
-#define __NR_getcwd 17
-#endif
-
-#if !defined(__NR_lookup_dcookie)
-#define __NR_lookup_dcookie 18
-#endif
-
-#if !defined(__NR_eventfd2)
-#define __NR_eventfd2 19
-#endif
-
-#if !defined(__NR_epoll_create1)
-#define __NR_epoll_create1 20
-#endif
-
-#if !defined(__NR_epoll_ctl)
-#define __NR_epoll_ctl 21
-#endif
-
-#if !defined(__NR_epoll_pwait)
-#define __NR_epoll_pwait 22
-#endif
-
-#if !defined(__NR_dup)
-#define __NR_dup 23
-#endif
-
-#if !defined(__NR_dup3)
-#define __NR_dup3 24
-#endif
-
-#if !defined(__NR_fcntl)
-#define __NR_fcntl 25
-#endif
-
-#if !defined(__NR_inotify_init1)
-#define __NR_inotify_init1 26
-#endif
-
-#if !defined(__NR_inotify_add_watch)
-#define __NR_inotify_add_watch 27
-#endif
-
-#if !defined(__NR_inotify_rm_watch)
-#define __NR_inotify_rm_watch 28
-#endif
-
-#if !defined(__NR_ioctl)
-#define __NR_ioctl 29
-#endif
-
-#if !defined(__NR_ioprio_set)
-#define __NR_ioprio_set 30
-#endif
-
-#if !defined(__NR_ioprio_get)
-#define __NR_ioprio_get 31
-#endif
-
-#if !defined(__NR_flock)
-#define __NR_flock 32
-#endif
-
-#if !defined(__NR_mknodat)
-#define __NR_mknodat 33
-#endif
-
-#if !defined(__NR_mkdirat)
-#define __NR_mkdirat 34
-#endif
-
-#if !defined(__NR_unlinkat)
-#define __NR_unlinkat 35
-#endif
-
-#if !defined(__NR_symlinkat)
-#define __NR_symlinkat 36
-#endif
-
-#if !defined(__NR_linkat)
-#define __NR_linkat 37
-#endif
-
-#if !defined(__NR_renameat)
-#define __NR_renameat 38
-#endif
-
-#if !defined(__NR_umount2)
-#define __NR_umount2 39
-#endif
-
-#if !defined(__NR_mount)
-#define __NR_mount 40
-#endif
-
-#if !defined(__NR_pivot_root)
-#define __NR_pivot_root 41
-#endif
-
-#if !defined(__NR_nfsservctl)
-#define __NR_nfsservctl 42
-#endif
-
-#if !defined(__NR_statfs)
-#define __NR_statfs 43
-#endif
-
-#if !defined(__NR_fstatfs)
-#define __NR_fstatfs 44
-#endif
-
-#if !defined(__NR_truncate)
-#define __NR_truncate 45
-#endif
-
-#if !defined(__NR_ftruncate)
-#define __NR_ftruncate 46
-#endif
-
-#if !defined(__NR_fallocate)
-#define __NR_fallocate 47
-#endif
-
-#if !defined(__NR_faccessat)
-#define __NR_faccessat 48
-#endif
-
-#if !defined(__NR_chdir)
-#define __NR_chdir 49
-#endif
-
-#if !defined(__NR_fchdir)
-#define __NR_fchdir 50
-#endif
-
-#if !defined(__NR_chroot)
-#define __NR_chroot 51
-#endif
-
-#if !defined(__NR_fchmod)
-#define __NR_fchmod 52
-#endif
-
-#if !defined(__NR_fchmodat)
-#define __NR_fchmodat 53
-#endif
-
-#if !defined(__NR_fchownat)
-#define __NR_fchownat 54
-#endif
-
-#if !defined(__NR_fchown)
-#define __NR_fchown 55
-#endif
-
-#if !defined(__NR_openat)
-#define __NR_openat 56
-#endif
-
-#if !defined(__NR_close)
-#define __NR_close 57
-#endif
-
-#if !defined(__NR_vhangup)
-#define __NR_vhangup 58
-#endif
-
-#if !defined(__NR_pipe2)
-#define __NR_pipe2 59
-#endif
-
-#if !defined(__NR_quotactl)
-#define __NR_quotactl 60
-#endif
-
-#if !defined(__NR_getdents64)
-#define __NR_getdents64 61
-#endif
-
-#if !defined(__NR_lseek)
-#define __NR_lseek 62
-#endif
-
-#if !defined(__NR_read)
-#define __NR_read 63
-#endif
-
-#if !defined(__NR_write)
-#define __NR_write 64
-#endif
-
-#if !defined(__NR_readv)
-#define __NR_readv 65
-#endif
-
-#if !defined(__NR_writev)
-#define __NR_writev 66
-#endif
-
-#if !defined(__NR_pread64)
-#define __NR_pread64 67
-#endif
-
-#if !defined(__NR_pwrite64)
-#define __NR_pwrite64 68
-#endif
-
-#if !defined(__NR_preadv)
-#define __NR_preadv 69
-#endif
-
-#if !defined(__NR_pwritev)
-#define __NR_pwritev 70
-#endif
-
-#if !defined(__NR_sendfile)
-#define __NR_sendfile 71
-#endif
-
-#if !defined(__NR_pselect6)
-#define __NR_pselect6 72
-#endif
-
-#if !defined(__NR_ppoll)
-#define __NR_ppoll 73
-#endif
-
-#if !defined(__NR_signalfd4)
-#define __NR_signalfd4 74
-#endif
-
-#if !defined(__NR_vmsplice)
-#define __NR_vmsplice 75
-#endif
-
-#if !defined(__NR_splice)
-#define __NR_splice 76
-#endif
-
-#if !defined(__NR_tee)
-#define __NR_tee 77
-#endif
-
-#if !defined(__NR_readlinkat)
-#define __NR_readlinkat 78
-#endif
-
-#if !defined(__NR_newfstatat)
-#define __NR_newfstatat 79
-#endif
-
-#if !defined(__NR_fstat)
-#define __NR_fstat 80
-#endif
-
-#if !defined(__NR_sync)
-#define __NR_sync 81
-#endif
-
-#if !defined(__NR_fsync)
-#define __NR_fsync 82
-#endif
-
-#if !defined(__NR_fdatasync)
-#define __NR_fdatasync 83
-#endif
-
-#if !defined(__NR_sync_file_range)
-#define __NR_sync_file_range 84
-#endif
-
-#if !defined(__NR_timerfd_create)
-#define __NR_timerfd_create 85
-#endif
-
-#if !defined(__NR_timerfd_settime)
-#define __NR_timerfd_settime 86
-#endif
-
-#if !defined(__NR_timerfd_gettime)
-#define __NR_timerfd_gettime 87
-#endif
-
-#if !defined(__NR_utimensat)
-#define __NR_utimensat 88
-#endif
-
-#if !defined(__NR_acct)
-#define __NR_acct 89
-#endif
-
-#if !defined(__NR_capget)
-#define __NR_capget 90
-#endif
-
-#if !defined(__NR_capset)
-#define __NR_capset 91
-#endif
-
-#if !defined(__NR_personality)
-#define __NR_personality 92
-#endif
-
-#if !defined(__NR_exit)
-#define __NR_exit 93
-#endif
-
-#if !defined(__NR_exit_group)
-#define __NR_exit_group 94
-#endif
-
-#if !defined(__NR_waitid)
-#define __NR_waitid 95
-#endif
-
-#if !defined(__NR_set_tid_address)
-#define __NR_set_tid_address 96
-#endif
-
-#if !defined(__NR_unshare)
-#define __NR_unshare 97
-#endif
-
-#if !defined(__NR_futex)
-#define __NR_futex 98
-#endif
-
-#if !defined(__NR_set_robust_list)
-#define __NR_set_robust_list 99
-#endif
-
-#if !defined(__NR_get_robust_list)
-#define __NR_get_robust_list 100
-#endif
-
-#if !defined(__NR_nanosleep)
-#define __NR_nanosleep 101
-#endif
-
-#if !defined(__NR_getitimer)
-#define __NR_getitimer 102
-#endif
-
-#if !defined(__NR_setitimer)
-#define __NR_setitimer 103
-#endif
-
-#if !defined(__NR_kexec_load)
-#define __NR_kexec_load 104
-#endif
-
-#if !defined(__NR_init_module)
-#define __NR_init_module 105
-#endif
-
-#if !defined(__NR_delete_module)
-#define __NR_delete_module 106
-#endif
-
-#if !defined(__NR_timer_create)
-#define __NR_timer_create 107
-#endif
-
-#if !defined(__NR_timer_gettime)
-#define __NR_timer_gettime 108
-#endif
-
-#if !defined(__NR_timer_getoverrun)
-#define __NR_timer_getoverrun 109
-#endif
-
-#if !defined(__NR_timer_settime)
-#define __NR_timer_settime 110
-#endif
-
-#if !defined(__NR_timer_delete)
-#define __NR_timer_delete 111
-#endif
-
-#if !defined(__NR_clock_settime)
-#define __NR_clock_settime 112
-#endif
-
-#if !defined(__NR_clock_gettime)
-#define __NR_clock_gettime 113
-#endif
-
-#if !defined(__NR_clock_getres)
-#define __NR_clock_getres 114
-#endif
-
-#if !defined(__NR_clock_nanosleep)
-#define __NR_clock_nanosleep 115
-#endif
-
-#if !defined(__NR_syslog)
-#define __NR_syslog 116
-#endif
-
-#if !defined(__NR_ptrace)
-#define __NR_ptrace 117
-#endif
-
-#if !defined(__NR_sched_setparam)
-#define __NR_sched_setparam 118
-#endif
-
-#if !defined(__NR_sched_setscheduler)
-#define __NR_sched_setscheduler 119
-#endif
-
-#if !defined(__NR_sched_getscheduler)
-#define __NR_sched_getscheduler 120
-#endif
-
-#if !defined(__NR_sched_getparam)
-#define __NR_sched_getparam 121
-#endif
-
-#if !defined(__NR_sched_setaffinity)
-#define __NR_sched_setaffinity 122
-#endif
-
-#if !defined(__NR_sched_getaffinity)
-#define __NR_sched_getaffinity 123
-#endif
-
-#if !defined(__NR_sched_yield)
-#define __NR_sched_yield 124
-#endif
-
-#if !defined(__NR_sched_get_priority_max)
-#define __NR_sched_get_priority_max 125
-#endif
-
-#if !defined(__NR_sched_get_priority_min)
-#define __NR_sched_get_priority_min 126
-#endif
-
-#if !defined(__NR_sched_rr_get_interval)
-#define __NR_sched_rr_get_interval 127
-#endif
-
-#if !defined(__NR_restart_syscall)
-#define __NR_restart_syscall 128
-#endif
-
-#if !defined(__NR_kill)
-#define __NR_kill 129
-#endif
-
-#if !defined(__NR_tkill)
-#define __NR_tkill 130
-#endif
-
-#if !defined(__NR_tgkill)
-#define __NR_tgkill 131
-#endif
-
-#if !defined(__NR_sigaltstack)
-#define __NR_sigaltstack 132
-#endif
-
-#if !defined(__NR_rt_sigsuspend)
-#define __NR_rt_sigsuspend 133
-#endif
-
-#if !defined(__NR_rt_sigaction)
-#define __NR_rt_sigaction 134
-#endif
-
-#if !defined(__NR_rt_sigprocmask)
-#define __NR_rt_sigprocmask 135
-#endif
-
-#if !defined(__NR_rt_sigpending)
-#define __NR_rt_sigpending 136
-#endif
-
-#if !defined(__NR_rt_sigtimedwait)
-#define __NR_rt_sigtimedwait 137
-#endif
-
-#if !defined(__NR_rt_sigqueueinfo)
-#define __NR_rt_sigqueueinfo 138
-#endif
-
-#if !defined(__NR_rt_sigreturn)
-#define __NR_rt_sigreturn 139
-#endif
-
-#if !defined(__NR_setpriority)
-#define __NR_setpriority 140
-#endif
-
-#if !defined(__NR_getpriority)
-#define __NR_getpriority 141
-#endif
-
-#if !defined(__NR_reboot)
-#define __NR_reboot 142
-#endif
-
-#if !defined(__NR_setregid)
-#define __NR_setregid 143
-#endif
-
-#if !defined(__NR_setgid)
-#define __NR_setgid 144
-#endif
-
-#if !defined(__NR_setreuid)
-#define __NR_setreuid 145
-#endif
-
-#if !defined(__NR_setuid)
-#define __NR_setuid 146
-#endif
-
-#if !defined(__NR_setresuid)
-#define __NR_setresuid 147
-#endif
-
-#if !defined(__NR_getresuid)
-#define __NR_getresuid 148
-#endif
-
-#if !defined(__NR_setresgid)
-#define __NR_setresgid 149
-#endif
-
-#if !defined(__NR_getresgid)
-#define __NR_getresgid 150
-#endif
-
-#if !defined(__NR_setfsuid)
-#define __NR_setfsuid 151
-#endif
-
-#if !defined(__NR_setfsgid)
-#define __NR_setfsgid 152
-#endif
-
-#if !defined(__NR_times)
-#define __NR_times 153
-#endif
-
-#if !defined(__NR_setpgid)
-#define __NR_setpgid 154
-#endif
-
-#if !defined(__NR_getpgid)
-#define __NR_getpgid 155
-#endif
-
-#if !defined(__NR_getsid)
-#define __NR_getsid 156
-#endif
-
-#if !defined(__NR_setsid)
-#define __NR_setsid 157
-#endif
-
-#if !defined(__NR_getgroups)
-#define __NR_getgroups 158
-#endif
-
-#if !defined(__NR_setgroups)
-#define __NR_setgroups 159
-#endif
-
-#if !defined(__NR_uname)
-#define __NR_uname 160
-#endif
-
-#if !defined(__NR_sethostname)
-#define __NR_sethostname 161
-#endif
-
-#if !defined(__NR_setdomainname)
-#define __NR_setdomainname 162
-#endif
-
-#if !defined(__NR_getrlimit)
-#define __NR_getrlimit 163
-#endif
-
-#if !defined(__NR_setrlimit)
-#define __NR_setrlimit 164
-#endif
-
-#if !defined(__NR_getrusage)
-#define __NR_getrusage 165
-#endif
-
-#if !defined(__NR_umask)
-#define __NR_umask 166
-#endif
-
-#if !defined(__NR_prctl)
-#define __NR_prctl 167
-#endif
-
-#if !defined(__NR_getcpu)
-#define __NR_getcpu 168
-#endif
-
-#if !defined(__NR_gettimeofday)
-#define __NR_gettimeofday 169
-#endif
-
-#if !defined(__NR_settimeofday)
-#define __NR_settimeofday 170
-#endif
-
-#if !defined(__NR_adjtimex)
-#define __NR_adjtimex 171
-#endif
-
-#if !defined(__NR_getpid)
-#define __NR_getpid 172
-#endif
-
-#if !defined(__NR_getppid)
-#define __NR_getppid 173
-#endif
-
-#if !defined(__NR_getuid)
-#define __NR_getuid 174
-#endif
-
-#if !defined(__NR_geteuid)
-#define __NR_geteuid 175
-#endif
-
-#if !defined(__NR_getgid)
-#define __NR_getgid 176
-#endif
-
-#if !defined(__NR_getegid)
-#define __NR_getegid 177
-#endif
-
-#if !defined(__NR_gettid)
-#define __NR_gettid 178
-#endif
-
-#if !defined(__NR_sysinfo)
-#define __NR_sysinfo 179
-#endif
-
-#if !defined(__NR_mq_open)
-#define __NR_mq_open 180
-#endif
-
-#if !defined(__NR_mq_unlink)
-#define __NR_mq_unlink 181
-#endif
-
-#if !defined(__NR_mq_timedsend)
-#define __NR_mq_timedsend 182
-#endif
-
-#if !defined(__NR_mq_timedreceive)
-#define __NR_mq_timedreceive 183
-#endif
-
-#if !defined(__NR_mq_notify)
-#define __NR_mq_notify 184
-#endif
-
-#if !defined(__NR_mq_getsetattr)
-#define __NR_mq_getsetattr 185
-#endif
-
-#if !defined(__NR_msgget)
-#define __NR_msgget 186
-#endif
-
-#if !defined(__NR_msgctl)
-#define __NR_msgctl 187
-#endif
-
-#if !defined(__NR_msgrcv)
-#define __NR_msgrcv 188
-#endif
-
-#if !defined(__NR_msgsnd)
-#define __NR_msgsnd 189
-#endif
-
-#if !defined(__NR_semget)
-#define __NR_semget 190
-#endif
-
-#if !defined(__NR_semctl)
-#define __NR_semctl 191
-#endif
-
-#if !defined(__NR_semtimedop)
-#define __NR_semtimedop 192
-#endif
-
-#if !defined(__NR_semop)
-#define __NR_semop 193
-#endif
-
-#if !defined(__NR_shmget)
-#define __NR_shmget 194
-#endif
-
-#if !defined(__NR_shmctl)
-#define __NR_shmctl 195
-#endif
-
-#if !defined(__NR_shmat)
-#define __NR_shmat 196
-#endif
-
-#if !defined(__NR_shmdt)
-#define __NR_shmdt 197
-#endif
-
-#if !defined(__NR_socket)
-#define __NR_socket 198
-#endif
-
-#if !defined(__NR_socketpair)
-#define __NR_socketpair 199
-#endif
-
-#if !defined(__NR_bind)
-#define __NR_bind 200
-#endif
-
-#if !defined(__NR_listen)
-#define __NR_listen 201
-#endif
-
-#if !defined(__NR_accept)
-#define __NR_accept 202
-#endif
-
-#if !defined(__NR_connect)
-#define __NR_connect 203
-#endif
-
-#if !defined(__NR_getsockname)
-#define __NR_getsockname 204
-#endif
-
-#if !defined(__NR_getpeername)
-#define __NR_getpeername 205
-#endif
-
-#if !defined(__NR_sendto)
-#define __NR_sendto 206
-#endif
-
-#if !defined(__NR_recvfrom)
-#define __NR_recvfrom 207
-#endif
-
-#if !defined(__NR_setsockopt)
-#define __NR_setsockopt 208
-#endif
-
-#if !defined(__NR_getsockopt)
-#define __NR_getsockopt 209
-#endif
-
-#if !defined(__NR_shutdown)
-#define __NR_shutdown 210
-#endif
-
-#if !defined(__NR_sendmsg)
-#define __NR_sendmsg 211
-#endif
-
-#if !defined(__NR_recvmsg)
-#define __NR_recvmsg 212
-#endif
-
-#if !defined(__NR_readahead)
-#define __NR_readahead 213
-#endif
-
-#if !defined(__NR_brk)
-#define __NR_brk 214
-#endif
-
-#if !defined(__NR_munmap)
-#define __NR_munmap 215
-#endif
-
-#if !defined(__NR_mremap)
-#define __NR_mremap 216
-#endif
-
-#if !defined(__NR_add_key)
-#define __NR_add_key 217
-#endif
-
-#if !defined(__NR_request_key)
-#define __NR_request_key 218
-#endif
-
-#if !defined(__NR_keyctl)
-#define __NR_keyctl 219
-#endif
-
-#if !defined(__NR_clone)
-#define __NR_clone 220
-#endif
-
-#if !defined(__NR_execve)
-#define __NR_execve 221
-#endif
-
-#if !defined(__NR_mmap)
-#define __NR_mmap 222
-#endif
-
-#if !defined(__NR_fadvise64)
-#define __NR_fadvise64 223
-#endif
-
-#if !defined(__NR_swapon)
-#define __NR_swapon 224
-#endif
-
-#if !defined(__NR_swapoff)
-#define __NR_swapoff 225
-#endif
-
-#if !defined(__NR_mprotect)
-#define __NR_mprotect 226
-#endif
-
-#if !defined(__NR_msync)
-#define __NR_msync 227
-#endif
-
-#if !defined(__NR_mlock)
-#define __NR_mlock 228
-#endif
-
-#if !defined(__NR_munlock)
-#define __NR_munlock 229
-#endif
-
-#if !defined(__NR_mlockall)
-#define __NR_mlockall 230
-#endif
-
-#if !defined(__NR_munlockall)
-#define __NR_munlockall 231
-#endif
-
-#if !defined(__NR_mincore)
-#define __NR_mincore 232
-#endif
-
-#if !defined(__NR_madvise)
-#define __NR_madvise 233
-#endif
-
-#if !defined(__NR_remap_file_pages)
-#define __NR_remap_file_pages 234
-#endif
-
-#if !defined(__NR_mbind)
-#define __NR_mbind 235
-#endif
-
-#if !defined(__NR_get_mempolicy)
-#define __NR_get_mempolicy 236
-#endif
-
-#if !defined(__NR_set_mempolicy)
-#define __NR_set_mempolicy 237
-#endif
-
-#if !defined(__NR_migrate_pages)
-#define __NR_migrate_pages 238
-#endif
-
-#if !defined(__NR_move_pages)
-#define __NR_move_pages 239
-#endif
-
-#if !defined(__NR_rt_tgsigqueueinfo)
-#define __NR_rt_tgsigqueueinfo 240
-#endif
-
-#if !defined(__NR_perf_event_open)
-#define __NR_perf_event_open 241
-#endif
-
-#if !defined(__NR_accept4)
-#define __NR_accept4 242
-#endif
-
-#if !defined(__NR_recvmmsg)
-#define __NR_recvmmsg 243
-#endif
-
-#if !defined(__NR_riscv_hwprobe)
-#define __NR_riscv_hwprobe 258
-#endif
-
-#if !defined(__NR_riscv_flush_icache)
-#define __NR_riscv_flush_icache 259
-#endif
-
-#if !defined(__NR_wait4)
-#define __NR_wait4 260
-#endif
-
-#if !defined(__NR_prlimit64)
-#define __NR_prlimit64 261
-#endif
-
-#if !defined(__NR_fanotify_init)
-#define __NR_fanotify_init 262
-#endif
-
-#if !defined(__NR_fanotify_mark)
-#define __NR_fanotify_mark 263
-#endif
-
-#if !defined(__NR_name_to_handle_at)
-#define __NR_name_to_handle_at 264
-#endif
-
-#if !defined(__NR_open_by_handle_at)
-#define __NR_open_by_handle_at 265
-#endif
-
-#if !defined(__NR_clock_adjtime)
-#define __NR_clock_adjtime 266
-#endif
-
-#if !defined(__NR_syncfs)
-#define __NR_syncfs 267
-#endif
-
-#if !defined(__NR_setns)
-#define __NR_setns 268
-#endif
-
-#if !defined(__NR_sendmmsg)
-#define __NR_sendmmsg 269
-#endif
-
-#if !defined(__NR_process_vm_readv)
-#define __NR_process_vm_readv 270
-#endif
-
-#if !defined(__NR_process_vm_writev)
-#define __NR_process_vm_writev 271
-#endif
-
-#if !defined(__NR_kcmp)
-#define __NR_kcmp 272
-#endif
-
-#if !defined(__NR_finit_module)
-#define __NR_finit_module 273
-#endif
-
-#if !defined(__NR_sched_setattr)
-#define __NR_sched_setattr 274
-#endif
-
-#if !defined(__NR_sched_getattr)
-#define __NR_sched_getattr 275
-#endif
-
-#if !defined(__NR_renameat2)
-#define __NR_renameat2 276
-#endif
-
-#if !defined(__NR_seccomp)
-#define __NR_seccomp 277
-#endif
-
-#if !defined(__NR_getrandom)
-#define __NR_getrandom 278
-#endif
-
-#if !defined(__NR_memfd_create)
-#define __NR_memfd_create 279
-#endif
-
-#if !defined(__NR_bpf)
-#define __NR_bpf 280
-#endif
-
-#if !defined(__NR_execveat)
-#define __NR_execveat 281
-#endif
-
-#if !defined(__NR_userfaultfd)
-#define __NR_userfaultfd 282
-#endif
-
-#if !defined(__NR_membarrier)
-#define __NR_membarrier 283
-#endif
-
-#if !defined(__NR_mlock2)
-#define __NR_mlock2 284
-#endif
-
-#if !defined(__NR_copy_file_range)
-#define __NR_copy_file_range 285
-#endif
-
-#if !defined(__NR_preadv2)
-#define __NR_preadv2 286
-#endif
-
-#if !defined(__NR_pwritev2)
-#define __NR_pwritev2 287
-#endif
-
-#if !defined(__NR_pkey_mprotect)
-#define __NR_pkey_mprotect 288
-#endif
-
-#if !defined(__NR_pkey_alloc)
-#define __NR_pkey_alloc 289
-#endif
-
-#if !defined(__NR_pkey_free)
-#define __NR_pkey_free 290
-#endif
-
-#if !defined(__NR_statx)
-#define __NR_statx 291
-#endif
-
-#if !defined(__NR_io_pgetevents)
-#define __NR_io_pgetevents 292
-#endif
-
-#if !defined(__NR_rseq)
-#define __NR_rseq 293
-#endif
-
-#if !defined(__NR_kexec_file_load)
-#define __NR_kexec_file_load 294
-#endif
-
-#if !defined(__NR_pidfd_send_signal)
-#define __NR_pidfd_send_signal 424
-#endif
-
-#if !defined(__NR_io_uring_setup)
-#define __NR_io_uring_setup 425
-#endif
-
-#if !defined(__NR_io_uring_enter)
-#define __NR_io_uring_enter 426
-#endif
-
-#if !defined(__NR_io_uring_register)
-#define __NR_io_uring_register 427
-#endif
-
-#if !defined(__NR_open_tree)
-#define __NR_open_tree 428
-#endif
-
-#if !defined(__NR_move_mount)
-#define __NR_move_mount 429
-#endif
-
-#if !defined(__NR_fsopen)
-#define __NR_fsopen 430
-#endif
-
-#if !defined(__NR_fsconfig)
-#define __NR_fsconfig 431
-#endif
-
-#if !defined(__NR_fsmount)
-#define __NR_fsmount 432
-#endif
-
-#if !defined(__NR_fspick)
-#define __NR_fspick 433
-#endif
-
-#if !defined(__NR_pidfd_open)
-#define __NR_pidfd_open 434
-#endif
-
-#if !defined(__NR_clone3)
-#define __NR_clone3 435
-#endif
-
-#if !defined(__NR_close_range)
-#define __NR_close_range 436
-#endif
-
-#if !defined(__NR_openat2)
-#define __NR_openat2 437
-#endif
-
-#if !defined(__NR_pidfd_getfd)
-#define __NR_pidfd_getfd 438
-#endif
-
-#if !defined(__NR_faccessat2)
-#define __NR_faccessat2 439
-#endif
-
-#if !defined(__NR_process_madvise)
-#define __NR_process_madvise 440
-#endif
-
-#if !defined(__NR_epoll_pwait2)
-#define __NR_epoll_pwait2 441
-#endif
-
-#if !defined(__NR_mount_setattr)
-#define __NR_mount_setattr 442
-#endif
-
-#if !defined(__NR_quotactl_path)
-#define __NR_quotactl_path 443
-#endif
-
-#if !defined(__NR_landlock_create_ruleset)
-#define __NR_landlock_create_ruleset 444
-#endif
-
-#if !defined(__NR_landlock_add_rule)
-#define __NR_landlock_add_rule 445
-#endif
-
-#if !defined(__NR_landlock_restrict_self)
-#define __NR_landlock_restrict_self 446
-#endif
-
-#endif  // SANDBOX_LINUX_SYSTEM_HEADERS_RISCV64_LINUX_SYSCALLS_H_
diff --git a/sandbox/policy/linux/bpf_cdm_policy_linux.cc b/sandbox/policy/linux/bpf_cdm_policy_linux.cc
index 482ce1d8149ce..433720fa9dd0f 100644
--- a/sandbox/policy/linux/bpf_cdm_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_cdm_policy_linux.cc
@@ -33,7 +33,7 @@ ResultExpr CdmProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_ftruncate:
     case __NR_fallocate:
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
 #endif
 #if defined(__i386__) || defined(__arm__)
diff --git a/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc b/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
index 7d3290a61d2e7..1ea2f0f6bee56 100644
--- a/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_cros_amd_gpu_policy_linux.cc
@@ -39,7 +39,7 @@ ResultExpr CrosAmdGpuProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_sched_setscheduler:
     case __NR_sysinfo:
     case __NR_uname:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_readlink:
     case __NR_stat:
 #endif
diff --git a/sandbox/policy/linux/bpf_gpu_policy_linux.cc b/sandbox/policy/linux/bpf_gpu_policy_linux.cc
index a84e6089c3a0c..41cf2e902e141 100644
--- a/sandbox/policy/linux/bpf_gpu_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_gpu_policy_linux.cc
@@ -73,7 +73,7 @@ ResultExpr GpuProcessPolicy::EvaluateSyscall(int sysno) const {
     (defined(ARCH_CPU_MIPS_FAMILY) && defined(ARCH_CPU_32_BITS))
     case __NR_ftruncate64:
 #endif
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_getdents:
 #endif
     case __NR_getdents64:
diff --git a/sandbox/policy/linux/bpf_network_policy_linux.cc b/sandbox/policy/linux/bpf_network_policy_linux.cc
index 297e48abf24ff..19d1f5d106ac2 100644
--- a/sandbox/policy/linux/bpf_network_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_network_policy_linux.cc
@@ -259,7 +259,7 @@ ResultExpr NetworkProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_fdatasync:
     case __NR_fsync:
     case __NR_mremap:
-#if !defined(__aarch64__) && !defined(__riscv)
+#if !defined(__aarch64__)
     case __NR_getdents:
 #endif
     case __NR_getdents64:
diff --git a/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc b/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
index 36acee528ce6f..bff338a903e58 100644
--- a/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_print_compositor_policy_linux.cc
@@ -33,7 +33,7 @@ ResultExpr PrintCompositorProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_fdatasync:
     case __NR_fsync:
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined (__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
 #endif
 #if defined(__i386__) || defined(__arm__)
diff --git a/sandbox/policy/linux/bpf_renderer_policy_linux.cc b/sandbox/policy/linux/bpf_renderer_policy_linux.cc
index 02ca6f0c61d59..8709f5e70a90a 100644
--- a/sandbox/policy/linux/bpf_renderer_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_renderer_policy_linux.cc
@@ -86,7 +86,7 @@ ResultExpr RendererProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_ftruncate64:
 #endif
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
     case __NR_setrlimit:
 // We allow setrlimit to dynamically adjust the address space limit as
diff --git a/sandbox/policy/linux/bpf_service_policy_linux.cc b/sandbox/policy/linux/bpf_service_policy_linux.cc
index 3f42eabba94c7..32754e67be3d6 100644
--- a/sandbox/policy/linux/bpf_service_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_service_policy_linux.cc
@@ -26,7 +26,7 @@ ResultExpr ServiceProcessPolicy::EvaluateSyscall(int sysno) const {
       return RestrictIoctl();
       // Allow the system calls below.
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
 #endif
 #if defined(__i386__) || defined(__arm__)
diff --git a/sandbox/policy/linux/bpf_utility_policy_linux.cc b/sandbox/policy/linux/bpf_utility_policy_linux.cc
index ed1106898ec33..e299ce998b9bd 100644
--- a/sandbox/policy/linux/bpf_utility_policy_linux.cc
+++ b/sandbox/policy/linux/bpf_utility_policy_linux.cc
@@ -34,7 +34,7 @@ ResultExpr UtilityProcessPolicy::EvaluateSyscall(int sysno) const {
     case __NR_fdatasync:
     case __NR_fsync:
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
-    defined(__aarch64__) || defined(__riscv)
+    defined(__aarch64__)
     case __NR_getrlimit:
 #endif
 #if defined(__i386__) || defined(__arm__)

FFmpegのセットアップ

以下のコマンドでRISC-V向けにFFmpegをセットアップする

export PATH=$PWD/third_party/llvm-build/Release+Asserts/bin:$PATH
media/ffmpeg/scripts/build_ffmpeg.py linux riscv64
cd third_party/ffmpeg
chromium/scripts/copy_config.sh
../../media/ffmpeg/scripts/generate_gn.py
cd ../..

third_party/swiftshaderにパッチを当てる

third_party/swiftshaderをビルドしている際に以下のようなLLVMのバージョン起因(と思われる)のビルドエラーが発生する。

エラーメッセージを表示
FAILED: obj/third_party/swiftshader/src/Reactor/swiftshader_llvm_reactor/LLVMJIT.o 

/usr/local/bin/ccache ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/swiftshader/src/Reactor/swiftshader_llvm_reactor/LLVMJIT.o.d -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_GNU_SOURCE -DCR_CLANG_REVISION=\"llvmorg-22-init-8940-g4d4cb757-84\" -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_INSTRUMENTED_WITH_ASAN=0 -DCR_LIBCXX_REVISION=c3fe874fc47fa69deabc42e9e013059b6bd708ab -DCR_SYSROOT_KEY=20250129T203412Z-1 -DDCHECK_ALWAYS_ON=1 -DUSE_UDEV -DUSE_AURA=1 -DUSE_GLIB=1 -DUSE_OZONE=1 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -I../../third_party/swiftshader/third_party/llvm-10.0/llvm/include -I../../third_party/swiftshader/third_party/llvm-10.0/configs/common/include -I../../third_party/swiftshader/third_party/llvm-10.0/configs/linux/include -I../.. -Igen -I../../buildtools/third_party/libc++ -fno-delete-null-pointer-checks -fno-strict-overflow -fno-ident -fno-math-errno -fno-strict-aliasing -fstack-protector -funwind-tables -fPIC -pthread -fcolor-diagnostics -fmerge-all-constants -fno-sized-deallocation -fcrash-diagnostics-dir=../clang-crashreports -mllvm -instcombine-lower-dbg-declare=0 -mllvm -split-threshold-for-reg-with-hint=0 -ffp-contract=off -Wa,--crel,--allow-experimental-crel -fcomplete-member-pointers --target=riscv64-linux-gnu -mabi=lp64d -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -ffile-compilation-dir=. -no-canonical-prefixes --warning-suppression-mappings=../../build/config/warning_suppression.txt -ftrivial-auto-var-init=pattern -O2 -fdata-sections -ffunction-sections -fno-unique-section-names -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-stack-allocated -Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc -Xclang -add-plugin -Xclang raw-ptr-plugin -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-to-stack-allocated -Xclang -plugin-arg-raw-ptr-plugin -Xclang disable-check-raw-ptr-to-stack-allocated-error -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../third_party/dawn/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang raw-ptr-exclude-path=../../build/config/clang/chrome/test/fuzzing/webidl_fuzzing/ -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ptr-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-span-fields -Xclang -plugin-arg-raw-ptr-plugin -Xclang check-raw-ref-fields -DUNSAFE_BUFFERS_BUILD -Xclang -add-plugin -Xclang unsafe-buffers -Xclang -plugin-arg-unsafe-buffers -Xclang ../../build/config/unsafe_buffers_paths.txt -Wall -Wno-unused-variable -Wno-c++11-narrowing -Wno-unused-but-set-variable -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wloop-analysis -Wno-unneeded-internal-declaration -Wno-cast-function-type -Wno-thread-safety-reference-return -Wno-nontrivial-memcall -Wno-uninitialized-const-pointer -Wexit-time-destructors -Wno-exit-time-destructors -Wno-shadow -Os -Wno-unused-local-typedef -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include --sysroot=../../build/linux/debian_trixie_riscv64-sysroot -fvisibility-inlines-hidden -Wno-invalid-offsetof -Wenum-compare-conditional -Wno-nullability-completeness  -c ../../third_party/swiftshader/src/Reactor/LLVMJIT.cpp -o obj/third_party/swiftshader/src/Reactor/swiftshader_llvm_reactor/LLVMJIT.o

../../third_party/swiftshader/src/Reactor/LLVMJIT.cpp:815:83: error: no member named 'Create' in 'llvm::jitlink::InProcessMemoryManager'

   815 |                  , objectLayer(session, llvm::cantFail(llvm::jitlink::InProcessMemoryManager::Create()))

       |                                                                                           ~~~~~~^

1 error generated.

[17072/89392] CXX obj/third_party/swiftshader/third_party/llvm-10.0/swiftshader_llvm_debuginfo/DWARFContext.o

ninja: build stopped: subcommand failed.

これを回避するために//third_party/swiftshader/src/Reactor/BUILD.gnに以下のパッチを当てる。

diff --git a/src/Reactor/BUILD.gn b/src/Reactor/BUILD.gn
index 67dfeb0ec..dcb13614a 100644
--- a/src/Reactor/BUILD.gn
+++ b/src/Reactor/BUILD.gn
@@ -307,7 +307,7 @@ if (supports_subzero) {
 
 if (supports_llvm) {
   swiftshader_source_set("swiftshader_llvm_reactor") {
-    llvm_dir = "../../third_party/llvm-10.0"
+    llvm_dir = "../../third_party/llvm-16.0"
 
     deps = [
       ":swiftshader_reactor_base",

ビルド実行

gn genを実行する

gn gen out/Default

GN変数に以下を設定する

# Set build arguments here. See `gn help buildargs`.
target_cpu = "riscv64"
target_os = "linux"
cc_wrapper = "/usr/local/bin/ccache"
is_debug = false
symbol_level = 0
treat_warnings_as_errors = false
use_v8_context_snapshot = false

use_v8_context_snapshot = falseは以下のリンカーエラーを回避するため設定している。
本来はリンカーエラーを解消するべきだが方法がよくわからないため暫定でこのような対処をしている。

エラーメッセージを表示
ninja: Entering directory `out/Default/'
[20/2177] LINK clang_x64_v8_riscv64/v8_context_snapshot_generator
FAILED: clang_x64_v8_riscv64/v8_context_snapshot_generator 
"python3" "../../build/toolchain/gcc_link_wrapper.py" --output="clang_x64_v8_riscv64/v8_context_snapshot_generator" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id=fast -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--undefined-version -Wl,--no-call-graph-profile-sort --target=x86_64-unknown-linux-gnu -no-canonical-prefixes -Wl,--gc-sections -Wl,-z,defs -Wl,--as-needed -nostdlib++ --sysroot=../../build/linux/debian_bullseye_amd64-sysroot -rdynamic -pie -Wl,--disable-new-dtags -Wl,--icf=none -o "clang_x64_v8_riscv64/v8_context_snapshot_generator" -Wl,--start-group @"clang_x64_v8_riscv64/v8_context_snapshot_generator.rsp" -Wl,--end-group     ../../third_party/llvm-build/Release+Asserts/lib/clang/22/lib/x86_64-unknown-linux-gnu/libclang_rt.builtins.a -ldl -lpthread -lrt -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lgthread-2.0 -lnspr4 -lnss3 -lnssutil3 -lplc4 -lplds4 -lsmime3 -ldbus-1 -lgio-2.0 -lresolv -lexpat -luuid -lX11 -lXcomposite -lXdamage -lXext -lXfixes -lXrandr -lXrender -lXtst -lgbm -ldrm -lxcb -lxkbcommon -lXi -lpci -lffi_pic -lcairo -lharfbuzz -lpango-1.0 -lpangocairo-1.0 -ludev -lasound -lm -lz -Wl,--start-group clang_x64_v8_riscv64/obj/third_party/rust/cxx/v1/lib/libcxx_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/foldhash/v0_2/lib/libfoldhash_lib.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_std.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_alloc.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins_compiler_builtins.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore_core.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libprofiler_builtins_profiler_builtins.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if_cfg_if.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core_rustc_std_workspace_core.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown_hashbrown.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc_rustc_std_workspace_alloc.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort_panic_abort.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind_panic_unwind.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_66-unknown-linux-gnu/lib/libunwind_unwind.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc_libc.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle_rustc_demangle.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect_std_detect.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line_addr2line.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli_gimli.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide_miniz_oxide.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler2_adler2.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject_object.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr_memchr.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts_getopts.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_std_rustc_std_workspace_std.rlib clang_x64_v8_riscv64/local_rustc_sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libtest_test.rlib clang_x64_v8_riscv64/obj/build/rust/allocator/libbuild_srust_sallocator_callocator.rlib clang_x64_v8_riscv64/obj/build/rust/allocator/liballoc_error_handler_impl_ffi.rlib clang_x64_v8_riscv64/obj/build/rust/allocator/liballocator_impls_ffi.rlib clang_x64_v8_riscv64/obj/base/libbase_crust_ulogger.rlib clang_x64_v8_riscv64/obj/base/libbase_clogging_ulog_useverity_ubindgen.rlib clang_x64_v8_riscv64/obj/third_party/rust/log/v0_4/lib/liblog_lib.rlib clang_x64_v8_riscv64/obj/build/rust/chromium_prelude/libchromium.rlib clang_x64_v8_riscv64/obj/third_party/rust/serde_json_lenient/v0_2/wrapper/lib_tprserde_ujson_ulenient_sv0_u2_swrapper_cwrapper.rlib clang_x64_v8_riscv64/obj/third_party/rust/serde/v1/lib/libserde_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/serde_core/v1/lib/libserde_core_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/serde_json_lenient/v0_2/lib/libserde_json_lenient_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/itoa/v1/lib/libitoa_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/memchr/v2/lib/libmemchr_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/ryu/v1/lib/libryu_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/temporal_capi/v0_1/lib/libtemporal_capi_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/diplomat_runtime/v0_13/lib/libdiplomat_runtime_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_calendar/v2/lib/libicu_calendar_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/calendrical_calculations/v0_2/lib/libcalendrical_calculations_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/core_maths/v0_1/lib/libcore_maths_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/libm/v0_2/lib/liblibm_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_calendar_data/v2/lib/libicu_calendar_data_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_locale/v2/lib/libicu_locale_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_collections/v2/lib/libicu_collections_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/potential_utf/v0_1/lib/libpotential_utf_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/zerovec/v0_11/lib/libzerovec_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/yoke/v0_8/lib/libyoke_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/stable_deref_trait/v1/lib/libstable_deref_trait_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/zerofrom/v0_1/lib/libzerofrom_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_locale_core/v2/lib/libicu_locale_core_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/litemap/v0_8/lib/liblitemap_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/tinystr/v0_8/lib/libtinystr_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/writeable/v0_6/lib/libwriteable_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/either/v1/lib/libeither_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_locale_data/v2/lib/libicu_locale_data_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/icu_provider/v2/lib/libicu_provider_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/zerotrie/v0_2/lib/libzerotrie_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/num_traits/v0_2/lib/libnum_traits_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/temporal_rs/v0_1/lib/libtemporal_rs_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/ixdtf/v0_6/lib/libixdtf_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/timezone_provider/v0_1/lib/libtimezone_provider_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/zoneinfo64/v0_2/lib/libzoneinfo64_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/resb/v0_1/lib/libresb_lib.rlib clang_x64_v8_riscv64/obj/skia/libskia_cbridge_urust_uside.rlib clang_x64_v8_riscv6Reda/obj/third_party/rust/font_types/v0_10/lib/libfont_types_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/bytemuck/v1/lib/libbytemuck_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/read_fonts/v0_35/lib/libread_fonts_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/skrifa/v0_37/lib/libskrifa_lib.rlib clang_x64_v8_riscv64/obj/skia/libskia_crust_upng_uffi.rlib clang_x64_v8_riscv64/obj/third_party/rust/png/v0_18/lib/libpng_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/bitflags/v2/lib/libbitflags_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/crc32fast/v1/lib/libcrc32fast_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/cfg_if/v1/lib/libcfg_if_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/fdeflate/v0_3/lib/libfdeflate_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/simd_adler32/v0_3/lib/libsimd_adler32_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/flate2/v1/lib/libflate2_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/miniz_oxide/v0_8/lib/libminiz_oxide_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/adler2/v2/lib/libadler2_lib.rlib clang_x64_v8_riscv64/obj/third_party/fontconfig/libthird_uparty_sfontconfig_cfontconfig_ufontations_uffi.rlib clang_x64_v8_riscv64/obj/third_party/fontconfig/libfcint_bindings.rlib clang_x64_v8_riscv64/obj/third_party/fontconfig/libfontconfig_bindings.rlib clang_x64_v8_riscv64/obj/third_party/rust/libc/v0_2/lib/liblibc_lib.rlib clang_x64_v8_riscv64/obj/media/filters/libmedia_sfilters_csymphonia_uglue.rlib clang_x64_v8_riscv64/obj/third_party/rust/symphonia/v0_5/lib/libsymphonia_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/lazy_static/v1/lib/liblazy_static_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/symphonia_bundle_flac/v0_5/lib/libsymphonia_bundle_flac_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/symphonia_core/v0_5/lib/libsymphonia_core_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/arrayvec/v0_7/lib/libarrayvec_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/bitflags/v1/lib/libbitflags_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/symphonia_metadata/v0_5/lib/libsymphonia_metadata_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/encoding_rs/v0_8/lib/libencoding_rs_lib.rlib clang_x64_v8_riscv64/obj/third_party/rust/symphonia_utils_xiph/v0_5/lib/libsymphonia_utils_xiph_lib.rlib clang_x64_v8_riscv64/obj/third_party/blink/common/rust_crash/libthird_uparty_sblink_scommon_srust_ucrash_crs.rlib clang_x64_v8_riscv64/obj/third_party/crabbyavif/libthird_uparty_scrabbyavif_ccrabbyavif.rlib clang_x64_v8_riscv64/obj/third_party/crabbyavif/libdav1d_sys.rlib clang_x64_v8_riscv64/obj/third_party/crabbyavif/liblibyuv_sys.rlib clang_x64_v8_riscv64/obj/third_party/blink/renderer/platform/libthird_uparty_sblink_srenderer_splatform_cfont_uformat_ucheck.rlib clang_x64_v8_riscv64/obj/third_party/rust/xml/v1/lib/libxml_lib.rlib -Wl,--end-group 
ld.lld: error: undefined symbol: av_frame_alloc
>>> referenced by ffmpeg_decoding_loop.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_decoding_loop.o:(media::FFmpegDecodingLoop::FFmpegDecodingLoop(AVCodecContext*, bool))

ld.lld: error: undefined symbol: av_frame_free
>>> referenced by ffmpeg_decoding_loop.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_decoding_loop.o:(media::FFmpegDecodingLoop::~FFmpegDecodingLoop())

ld.lld: error: undefined symbol: av_rescale_q
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::ConvertFromTimeBase(AVRational const&, long))
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::ConvertToTimeBase(AVRational const&, base::TimeDelta const&))

ld.lld: error: undefined symbol: avcodec_send_packet
>>> referenced by ffmpeg_decoding_loop.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_decoding_loop.o:(media::FFmpegDecodingLoop::DecodePacket(AVPacket const*, base::RepeatingCallback<bool (AVFrame*)>))

ld.lld: error: undefined symbol: avcodec_receive_frame
>>> referenced by ffmpeg_decoding_loop.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_decoding_loop.o:(media::FFmpegDecodingLoop::DecodePacket(AVPacket const*, base::RepeatingCallback<bool (AVFrame*)>))

ld.lld: error: undefined symbol: av_frame_unref
>>> referenced by ffmpeg_decoding_loop.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_decoding_loop.o:(media::FFmpegDecodingLoop::DecodePacket(AVPacket const*, base::RepeatingCallback<bool (AVFrame*)>))

ld.lld: error: undefined symbol: av_malloc
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::AudioDecoderConfigToAVCodecContext(media::AudioDecoderConfig const&, AVCodecContext*))
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::VideoDecoderConfigToAVCodecContext(media::VideoDecoderConfig const&, AVCodecContext*))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::GetAudioBuffer(AVCodecContext*, AVFrame*, int))

ld.lld: error: undefined symbol: av_strdup
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::AudioDecoderConfigToAVCodecContext(media::AudioDecoderConfig const&, AVCodecContext*))
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::VideoDecoderConfigToAVCodecContext(media::VideoDecoderConfig const&, AVCodecContext*))

ld.lld: error: undefined symbol: av_strerror
>>> referenced by ffmpeg_common.cc
>>>               clang_x64_v8_riscv64/obj/media/ffmpeg/ffmpeg/ffmpeg_common.o:(media::AVErrorToString(int))

ld.lld: error: undefined symbol: av_image_check_size
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext*, AVFrame*, int))

ld.lld: error: undefined symbol: av_buffer_create
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::GetVideoBuffer(AVCodecContext*, AVFrame*, int))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::GetAudioBuffer(AVCodecContext*, AVFrame*, int))

ld.lld: error: undefined symbol: avcodec_free_context
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced 7 more times

ld.lld: error: undefined symbol: avcodec_alloc_context3
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::ConfigureDecoder(media::AudioDecoderConfig const&))

ld.lld: error: undefined symbol: avcodec_find_decoder
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x6KA_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::ConfigureDecoder(media::AudioDecoderConfig const&))

ld.lld: error: undefined symbol: avcodec_open2
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::ConfigureDecoder(media::VideoDecoderConfig const&, bool))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::ConfigureDecoder(media::AudioDecoderConfig const&))

ld.lld: error: undefined symbol: av_packet_alloc
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::FFmpegDecode(media::DecoderBuffer const&))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::FFmpegDecode(media::DecoderBuffer const&))

ld.lld: error: undefined symbol: av_packet_free
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::FFmpegDecode(media::DecoderBuffer const&))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::FFmpegDecode(media::DecoderBuffer const&))

ld.lld: error: undefined symbol: avcodec_flush_buffers
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::Reset(base::OnceCallback<void ()>))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::Reset(base::OnceCallback<void ()>))

ld.lld: error: undefined symbol: av_buffer_get_opaque
>>> referenced by ffmpeg_video_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_video_decoder.o:(media::FFmpegVideoDecoder::OnNewFrame(AVFrame*))
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::OnNewFrame(media::DecoderBuffer const&, bool*, AVFrame*))

ld.lld: error: undefined symbol: av_dict_set
>>> referenced by ffmpeg_audio_decoder.cc
>>>               clang_x64_v8_riscv64/obj/media/filters/filters/ffmpeg_audio_decoder.o:(media::FFmpegAudioDecoder::ConfigureDecoder(media::AudioDecoderConfig const&))

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
[45/2177] CXX obj/chrome/browser/browser/chrome_content_browser_client.o
ninja: build stopped: subcommand failed.

以下のコマンドでビルドする

gn gen out/Default
autoninja -C out/Default chrome

動作確認

エミュレータを起動し、ビルド成果物をコピーし起動すると以下の画像のように起動することが確認できる。
エミュレータの起動方法は以下を参考にすると良い。
QEMU上でRISC-V向けDebianを動かす - Qiita
startup.png

今後の展望

  • 実機上での動作確認

参考リンク

https://www.kxxt.dev/blog/cross-compile-chromium-for-riscv/

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?