cef for loongarch64(交叉编译)
- 编译平台:x86_64
- 目标平台:loongarch64
git clone https://github.com/loongson/llvm-project.git
cd llvm-project
cmake -S llvm -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang" -DCMAKE_INSTALL_PREFIX=/opt/loongarch64/toolchain -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-linux-gnu;loongarch64-linux-gnu"
cd build
ninja && ninja install
git clone https://github.com/loongson/binutils-gdb.git
cd binutils-gdb
mkdir build
cd build
../configure --prefix=/opt/loongarch64/toolchain --target=x86_64-linux-gnu --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
make && make install
rm ./* -rf
../configure --prefix=/opt/loongarch64/toolchain --target=loongarch64-linux-gnu --with-sysroot --disable-nls --enable-shared --enable-64-bit-bfd --disable-werror
make && make install
mkdir -p /opt/loongarch64/sysroot
tar xvf loongarch64-clfs-system-x.x.tar.bz2 -C /opt/loongarch64/sysroot
export PATH=$PATH:/opt/loongarch64/toolchain/bin
.
└── code
├── automate
├── cef
├── chromium
└── depot_tools
automate/
└── automate-git.py
python automate-git.py --url=https://github.com/loongson/cef.git --download-dir=/path/to/code --depot-tools-dir=/path/to/code/depot_tools --branch=4844 --no-build --no-distrib
export PATH=$PATH:/path/to/code/depot_tools
cd /path/to/code/chromium/src/cef
GN_DEFINES='target_cpu="loong64" clang_use_chrome_plugins=false enable_swiftshader=false angle_enable_swiftshader=false enable_swiftshader_vulkan=false treat_warnings_as_errors=false dcheck_always_on=false use_gold=false use_lld=false clang_base_path="/opt/loongarch64/toolchain" target_sysroot="/opt/loongarch64/sysroot"' ./cef_create_projects.sh
- 也可以将CLFS解压到/path/to/code/chromium/src/build/linux/debian_sid_loong64-sysroot下,无需在GN_DEFINES中设置target_sysroot.
cd /path/to/code/chromium/src
ninja -C out/Release cef chrome_sandbox
ninja -C out/Debug cef chrome_sandbox
cd /path/to/code/chromium/cef
python tools/make_distrib.py --ninja-build --loong64-build --output-dir /path/to/