怎么使用预构建sysroot和系统llvm工具链进行跨系统交叉编译? #7324
Replies: 12 comments 6 replies
-
|
工具链选择freebsd-x86_64就能复现了( |
Beta Was this translation helpful? Give feedback.
-
|
难道是直接在Cmake/Modules/Platform里复制FreeBSD为BSD? |
Beta Was this translation helpful? Give feedback.
-
|
小众平台编译本来就会有很多潜在的问题,大部分库都只能具体问题具体分析。 |
Beta Was this translation helpful? Give feedback.
-
我好像已经设置成public了啊( |
Beta Was this translation helpful? Give feedback.
-
https://github.com/OpenMinecraft-Dev/cross-toolchain-sysroot/releases/download/toolchain-20260214-6/llvm-toolchain-freebsd-x86_64.tar.xz |
Beta Was this translation helpful? Give feedback.
-
Host上要装好clang和llvm工具链( |
Beta Was this translation helpful? Give feedback.
-
|
xmake.lua set_plat("bsd")
set_toolchains("clang")
set_config("sdk", "~/toolchain/freebsd-llvm")
set_policy("package.build.ccache", true)
add_rules("mode.debug", "mode.release")
add_requires("shaderc")
target("test")
set_kind("binary")
add_files("src/*.cpp")pixi.toml [workspace]
channels = ["conda-forge"]
platforms = ["linux-64"]
[dependencies]
cmake = "*"
ninja = "*"
ccache = "*"
python = "==3.11"
# meson = "*"
# pkg-config = "*"
# flex = "*"
clang = "*"
clangxx = "*"
lld = "*"
llvm-tools = "*"
compiler-rt = "*"
# gcc = "==15.2.0"
# gxx = "==15.2.0"
[pypi-dependencies]
pip = "*"
setuptools = "*"
wheel = "*"唯一遇到问题是 sysroot 脚本硬编码的 > pixi shell
> xmake f -c -v |
Beta Was this translation helpful? Give feedback.
-
我这里glslang还是会报错,你看看glslang有没有system=false( |
Beta Was this translation helpful? Give feedback.
-
一部分x11包的报错是这样的,可能需要改xmake的autoconf调用了( |
Beta Was this translation helpful? Give feedback.
-
|
cmake不认平台的问题可以通过复制一份Modules/Platform/FreeBSD.cmake到bsd.cmake解决( |
Beta Was this translation helpful? Give feedback.
-
|
基本找到解决方法了,在xmake/modules/package/tools/autoconf.lua处强行添加--host=xxx即可,我看看怎么改,等下提一个pr( |
Beta Was this translation helpful? Give feedback.
-
|
交叉编译统一走 bsd 平台,仅用于 bsd 系统上走 host 编译 而交叉编译的目标系统,应该是通过 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
最近我用github action构建了给freebsd用的交叉编译工具链(https://github.com/OpenMinecraft-Dev/cross-toolchain-sysroot)
整个工具链内部有一个sysroot(包含freebsd的所有库和头文件),和一些用于设置sysroot和target的包装脚本
我使用的是--toolchain=llvm --sdk=/path/to/toolchain进行配置的,但是当我使用-p bsd配置的时候,glslang包构建时cmake没有认出bsd这个平台(unknown platform to cmake),导致其构建失败
现在应该如何解决?(是需要自己写cmake辅助脚本吗)
Beta Was this translation helpful? Give feedback.
All reactions