Improve meson with clang toolchain on linux #4979
Replies: 6 comments 7 replies
-
目前已经是用了 native configs 了。 xmake/xmake/modules/package/tools/meson.lua Line 337 in e39ff9d 可以调下然后来个 pr 改进下 |
Beta Was this translation helpful? Give feedback.
-
试了一下,要加个 local ld = package:build_getenv("ld")
if ld then
file:print("cpp_ld=['%s']", executable_path(ld))
end 另外还有一个问题,一些库会直接用 prefix 作为宏来使用,然后在 Windows 上因为路径问题编译失败。这个应该怎么改比较好 xmake/xmake/modules/package/tools/meson.lua Line 298 in e39ff9d |
Beta Was this translation helpful? Give feedback.
-
这样? file:print("cpp_ld=['%s']", executable_path(ld))
file:print("c_ld=['%s']", executable_path(ld))
没看到啥错误么 |
Beta Was this translation helpful? Give feedback.
-
目前不支持区分。。纯 c 也是用的 clang++ linker |
Beta Was this translation helpful? Give feedback.
-
用 path.unix(prefix) 改成 unix path? |
Beta Was this translation helpful? Give feedback.
-
破案了,这里返回的是 clang 而不是 clang++,导致链接的时候也是调 clang,在 Windows 上也是同样的行为 xmake/xmake/modules/package/tools/meson.lua Lines 213 to 216 in e39ff9d |
Beta Was this translation helpful? Give feedback.
-
linux + meson + clang 在链接的时候会调用 clang 进行链接,而不是 clang++,导致部分 c++ 库会缺 libstdc++ 符号。看了几个 meson issue,问题好像存在很久了,也影响了 xrepo 一些包:libsigcpp/libvips/openh264...
xmake 是否应该 workaround 一下,比如生成 native configs_file 这样可能可以解决?
linux + meson + clang calls clang for linking instead of clang++ when linking, causing some c++ libraries to be missing libstdc++ symbols. I've looked at a few meson issues, and it seems that the problem has existed for a long time, and has affected some xrepo packages: libsigcpp/libvips/openh264...
Should xmake workaround, e.g. generate native configs_file, which might solve it?
Beta Was this translation helpful? Give feedback.
All reactions