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

Compilation error on cygwin #8142

Closed
matyhtf opened this issue Feb 23, 2022 · 3 comments
Closed

Compilation error on cygwin #8142

matyhtf opened this issue Feb 23, 2022 · 3 comments

Comments

@matyhtf
Copy link
Contributor

matyhtf commented Feb 23, 2022

Description

Error while compiling php on cygwin

./configure --disable-all \
--with-openssl --enable-openssl \
--with-curl \
--with-iconv \
--with-bz2 \
--enable-bcmath \
--enable-pcntl \
--enable-filter \
--enable-session \
--enable-tokenizer \
--enable-mbstring \
--enable-ctype \
--with-zlib \
--with-zip \
--enable-posix \
--enable-sockets \
--enable-pdo \
--with-sqlite3 \
--enable-phar \
--enable-mysqlnd \
--with-mysqli \
--enable-intl \
--enable-fileinfo \
--with-pdo_mysql \
--with-pdo-sqlite \
--enable-soap \
--with-xsl \
--with-gmp \
--enable-exif \
--with-sodium \
--enable-xml --enable-simplexml --enable-xmlreader --enable-xmlwriter --enable-dom --with-libxml \
--enable-gd --with-jpeg  --with-freetype \
--enable-swoole --enable-sockets --enable-mysqlnd --enable-http2 --enable-swoole-json --enable-swoole-curl --enable-cares \
--enable-redis \
--with-imagick \
--with-yaml

... 

make
...

/bin/sh /home/work/php-src/libtool --silent --preserve-dup-deps --tag CC --mode=compile cc -Iext/gd/ -I/home/work/php-src/ext/gd/ -I/home/work/php-src/include -I/home/work/php-src/main -I/home/work/php-src -I/home/work/php-src/ext/date/lib -I/usr/include/libxml2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/ImageMagick-7 -I/home/work/php-src/ext/mbstring/libmbfl -I/home/work/php-src/ext/mbstring/libmbfl/mbfl -I/home/work/php-src/ext -I/home/work/php-src/ext/swoole -I/home/work/php-src/ext/swoole/include -I/home/work/php-src/ext/swoole/ext-src -I/home/work/php-src/ext/swoole/thirdparty -I/home/work/php-src/ext/swoole/thirdparty/hiredis -I/home/work/php-src/TSRM -I/home/work/php-src/Zend    -fno-common -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-strict-aliasing -Wno-unused-parameter -Wno-sign-compare -Wall -pthread -g -O2 -fvisibility=hidden -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -I/home/work/php-src/ext/gd/libgd -c /home/work/php-src/ext/gd/libgd/gd_io_dp.c -o ext/gd/libgd/gd_io_dp.lo  -MMD -MF ext/gd/libgd/gd_io_dp.dep -MT ext/gd/libgd/gd_io_dp.lo

Resulted in this output:

In file included from /home/work/php-src/Zend/zend.h:41,
                 from /home/work/php-src/main/php.h:31,
                 from /home/work/php-src/ext/intl/intl_convertcpp.cpp:20:
/home/work/php-src/Zend/zend_signal.h:44:9: error: ‘siginfo_t’ does not name a type
   44 |         siginfo_t *siginfo;
      |         ^~~~~~~~~
In file included from /home/work/php-src/Zend/zend_types.h:25,
                 from /home/work/php-src/ext/intl/intl_convertcpp.h:23,
                 from /home/work/php-src/ext/intl/intl_convertcpp.cpp:17:
/home/work/php-src/Zend/zend_portability.h:370:18: error: ‘sigjmp_buf’ does not name a type; did you mean ‘jmp_buf’?
  370 | # define JMP_BUF sigjmp_buf
      |                  ^~~~~~~~~~
/home/work/php-src/Zend/zend_globals.h:159:9: note: in expansion of macro ‘JMP_BUF’
  159 |         JMP_BUF *bailout;
      |         ^~~~~~~
make: *** [Makefile:1252: ext/intl/intl_convertcpp.lo] Error 1
/home/work/php-src/ext/pcntl/pcntl.c: In function ‘pcntl_siginfo_to_zval’:
/home/work/php-src/ext/pcntl/pcntl.c:1198:98: error: ‘siginfo_t’ has no member named ‘si_band’
 1198 |                                 add_assoc_long_ex(user_siginfo, "band", sizeof("band")-1, siginfo->si_band);
      |                                                                                                  ^~
make: *** [Makefile:1546: ext/pcntl/pcntl.lo] Error 1
make: *** Waiting for unfinished jobs....

PHP Version

PHP 8.1.1

Operating System

CYGWIN_NT-10.0 ***** 3.3.4(0.341/5/3) 2022-01-31 19:35 x86_64 Cygwin

@cmb69
Copy link
Member

cmb69 commented Feb 23, 2022

Hmm, Cygwin is certainly not one of the important targets nowadays (I guess most Windows users use WSL(2) instead), so don't expect that to be fixed soon. However, a pull request would be welcome!

devnexen added a commit to devnexen/php-src that referenced this issue Feb 23, 2022
pcntl: SIGPOLL/si_band unsupported.
int ext: enables the signal apis with `_POSIX_C_SOURCE`.
devnexen added a commit to devnexen/php-src that referenced this issue Feb 23, 2022
pcntl: SIGPOLL/si_band unsupported.
int ext: enables the signal apis with `_POSIX_C_SOURCE`.
@cmb69 cmb69 linked a pull request Feb 25, 2022 that will close this issue
@cmb69 cmb69 closed this as completed in 8b15858 Mar 4, 2022
cmb69 added a commit that referenced this issue Mar 4, 2022
* PHP-8.0:
  Fix GH-8142: Compilation error on cygwin
cmb69 added a commit that referenced this issue Mar 4, 2022
* PHP-8.1:
  Fix GH-8142: Compilation error on cygwin
@pgy866
Copy link

pgy866 commented Mar 16, 2022

I am running php8.1.3 on DEEPIN 20.4, and the following error occurred

/home/yaoying/Desktop/php-8.1.3/php-8.1.3/main/php.h:22,
                 from /home/yaoying/Desktop/php-8.1.3/php-8.1.3/ext/intl/intl_convertcpp.cpp:20:
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_string.h: In function ‘void zend_string_free(zend_string*)’:
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_alloc.h:195:48: error: third operand to the conditional operator is of type ‘void’, but the second operand is neither a throw-expression nor of type ‘void’
 #define pefree(ptr, persistent)  ((persistent)?free(ptr):efree(ptr))
                                                ^~~~
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_string.h:306:3: note: in expansion of macro ‘pefree’
   pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT);
   ^~~~~~
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_string.h: In function ‘void zend_string_release(zend_string*)’:
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_alloc.h:195:48: error: third operand to the conditional operator is of type ‘void’, but the second operand is neither a throw-expression nor of type ‘void’
 #define pefree(ptr, persistent)  ((persistent)?free(ptr):efree(ptr))
                                                ^~~~
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_string.h:322:4: note: in expansion of macro ‘pefree’
    pefree(s, GC_FLAGS(s) & IS_STR_PERSISTENT);
    ^~~~~~
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_hash.h: In function ‘void zend_hash_release(zend_array*)’:
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_alloc.h:195:48: error: third operand to the conditional operator is of type ‘void’, but the second operand is neither a throw-expression nor of type ‘void’
 #define pefree(ptr, persistent)  ((persistent)?free(ptr):efree(ptr))
                                                ^~~~
/home/yaoying/Desktop/php-8.1.3/php-8.1.3/Zend/zend_hash.h:359:4: note: in expansion of macro ‘pefree’
    pefree(array, GC_FLAGS(array) & IS_ARRAY_PERSISTENT);
    ^~~~~~
make: *** [Makefile:1490:ext/intl/intl_convertcpp.lo]

@iluuu1994
Copy link
Member

iluuu1994 commented Mar 16, 2022

@pgy866 This is only fixed for PHP 8.1.5, but your errors look unrelated. Please check with the newest version and otherwise create a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@iluuu1994 @matyhtf @cmb69 @damianwadley @pgy866 and others