Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

建议编译器默认换成 clang clang++ ; #50

Closed
jingjingxyk opened this issue Apr 25, 2023 · 2 comments
Closed

建议编译器默认换成 clang clang++ ; #50

jingjingxyk opened this issue Apr 25, 2023 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Apr 25, 2023

缘由: 为了编译 gd 扩展的依赖,遇到的编译问题,让人头大。遇到问题比较少的是 clang clang++

组合一: gcc g++ 需要链接 glibc ;
组合二: musl-gcc g++ ; debian 环境 和 alpine 环境 差异挺大的。
组合三: clang clang++ ;

备注: 也有可能是我不熟悉配置

@crazywhalecc
Copy link
Owner

musl-gcc 在编译的时候理论上会比 clang 体积小一点,而且自然链接 musl-libc,解决问题起来可能会容易一点。不同发行版的差异这个都是可控的,我觉得不要紧。gcc g++ 链接 glibc 肯定不考虑。在 alpine 上默认的 gcc 就是 musl-gcc,可以做个 alias 或者传入时候改一下 cc 就行。

@crazywhalecc crazywhalecc added question Further information is requested wontfix This will not be worked on labels Apr 25, 2023
@jingjingxyk
Copy link
Contributor Author

jingjingxyk commented Apr 26, 2023

通过验证: 结果如下

debian 使用 libc编译器

 ./bin/spc build gd,zlib  --cc=musl-gcc  --cxx=g++ --build-cli --debug
./bin/spc build gd,zlib  --cc=clang     --cxx=clang++  --build-cli --debug

alpine 使用 libc编译器

 ./bin/spc build gd,zlib  --cc=gcc  --cxx=g++ --build-cli --debug
 ./bin/spc build gd,zlib  --cc=clang     --cxx=clang++  --build-cli --debug

debian 要使用 musl-libc 使用的编译器 musl-gcc
alpine 要使用 musl-libc 使用的编译器 gcc (直接些gcc 就行)

在debian 和 alpine 是使用编译器 clang 是一样的

@crazywhalecc crazywhalecc closed this as not planned Won't fix, can't repro, duplicate, stale Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants