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

build error #194

Closed
TNT-ma opened this issue Sep 18, 2023 · 13 comments
Closed

build error #194

TNT-ma opened this issue Sep 18, 2023 · 13 comments
Labels
bug Something isn't working

Comments

@TNT-ma
Copy link

TNT-ma commented Sep 18, 2023

./bin/spc build openssl,pcntl --build-all --enable-zts
_ _ _ _
| | __ | |() ___ _ __ | |_ _ __
/ | / ` | __| |/ __|| ' | ' | ' \
__ \ || (| | || | (_|
| |) | | | | |) |
|
/__,|_||_| | ./|| || .__/ v2.0.0
|
| |_|
[23:30:01] [INFO] [EXEC] echo | musl-gcc -E -x c - -march=corei7
sh: line 1: musl-gcc: command not found
[23:30:01] [INFO] [EXEC] echo | musl-gcc -E -x c - -mtune=core-avx2
sh: line 1: musl-gcc: command not found
[23:30:01] [INFO] Build target: cli, micro, fpm, embed
[23:30:01] [INFO] Enabled extensions: openssl, pcntl
[23:30:01] [INFO] Required libraries: zlib, openssl
[23:30:03] [INFO] Building required library [pkg-config]
[23:30:03] [INFO] Entering dir: /phptg/static-php-cli/source/pkg-config
[23:30:03] [INFO] [EXEC] PKG_CONFIG_PATH="/phptg/static-php-cli/buildroot/lib/pkgconfig" CC='musl-gcc' CXX='g++' ./configure --disable-shared --enable-static --with-internal-glib --prefix=/phptg/static-php-cli/buildroot --without-sysroot --without-system-include-path --without-system-library-path --without-pc-path
[23:30:04] [CRIT] Build failed with SPC\exception\RuntimeException: Command run failed with code[77]: cd '/phptg/static-php-cli/source/pkg-config' && PKG_CONFIG_PATH="/phptg/static-php-cli/buildroot/lib/pkgconfig" CC='musl-gcc' CXX='g++' ./configure --disable-shared --enable-static --with-internal-glib --prefix=/phptg/static-php-cli/buildroot --without-sysroot --without-system-include-path --without-system-library-path --without-pc-path 1>/dev/null 2>&1
[23:30:04] [CRIT] Please check with --debug option to see more details.

@crazywhalecc
Copy link
Owner

系统发行版类型、系统架构、编译使用的命令需要提供一下,目前所展示的信息,我只能看出你没有安装 musl-gcc。如果是 Debian、Ubuntu、Alpine 三种发行版或衍生版,最好先执行一下 bin/spc doctor 检查。

@crazywhalecc crazywhalecc added the bug Something isn't working label Sep 18, 2023
@TNT-ma
Copy link
Author

TNT-ma commented Sep 18, 2023

gcc (GCC) 11.4.1 20230605 (Red Hat 11.4.1-2)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

和 musl-gcc 不是一个东西吗?

bin/spc doctor:
Checking if current OS are supported ... Linux x86_64, supported
Checking if musl-libc is installed ... ok
Checking if necessary tools are installed ... ok
Checking if necessary packages are installed ... ok
Doctor check complete !

@crazywhalecc
Copy link
Owner

不是的,看起来你用的系统是 Red Hat 系,目前还没支持 RedHat 系的系统自动安装缺失的依赖库,而且好像 Red Hat 的包管理也没有 musl-devel 类似的包。

@crazywhalecc
Copy link
Owner

你可以考虑下载一个 musl wrapper 自行编译到系统里,或者最好还是直接 bin/spc-alpine-docker 在 Docker 中编译。

@TNT-ma
Copy link
Author

TNT-ma commented Sep 19, 2023

服务器系统:Ubuntu 22.04.3 LTS x86_64

Linux VM-0-16-ubuntu 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

我使用docker 编译了

@jingjingxyk
Copy link
Contributor

php 源码目录下有编译错误信息文件 config.log 。对照错误信息,把它修改正确即可。

@TNT-ma
Copy link
Author

TNT-ma commented Sep 19, 2023

php 源码目录下有编译错误信息文件 config.log 。对照错误信息,把它修改正确即可。

你还在折腾这玩意啊。 加密文件 搞出来没

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Sep 19, 2023

php 源码目录下有编译错误信息文件 config.log 。对照错误信息,把它修改正确即可。

你还在折腾这玩意啊。 加密文件 搞出来没

你没发现,编译流程(使用 autoconfig automake) 是通用的呀。

不一定是为了编译PHP 啊, 但是静态链接库构建思路是一样的 。

比如: cotrun ffmpeg 静态编译 opencv 静态编译 nginx 静态编译 librime 构建静态链接库

一些思路,我还是受本项目的启发。找到了解决办法

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Sep 19, 2023

关于静态编译 PHP , 我已经完成了(满足了自个的需求,并且公开了)。https://www.cnblogs.com/jingjingxyk/p/17610540.html

git clone -b build_native_php https://github.com/jingjingxyk/swoole-cli.git

有了生成了这个文件: [make-env.sh] ,静态编译其它软件,简单了不少。 (编译静态链接库 和 静态编译目标软件可以彻底分开)

初衷并不是为了编译PHP ,而是方便的编译 静态链接库。

image

@jingjingxyk
Copy link
Contributor

另外: 总能看到新特性用法: 比如 : #153

挺有意思的: #152

@TNT-ma
Copy link
Author

TNT-ma commented Sep 19, 2023

关于静态编译 PHP , 我已经完成了(满足了自个的需求,并且公开了)。https://www.cnblogs.com/jingjingxyk/p/17610540.html

git clone -b build_native_php https://github.com/jingjingxyk/swoole-cli.git

有了生成了这个文件: [make-env.sh] ,静态编译其它软件,简单了不少。 (编译静态链接库 和 静态编译目标软件可以彻底分开)

初衷并不是为了编译PHP ,而是方便的编译 静态链接库。

image

没发现什么特殊啊,。我还以为可以把swoole_load.so 编译进去

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Sep 20, 2023

混合式编译,目前不会

@TNT-ma
Copy link
Author

TNT-ma commented Sep 20, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants