Skip to content

Compilation failed for sockets (undefined type struct sockaddr_ll) #17793

@DanielEScherzer

Description

@DanielEScherzer

Description

./configure --enable-sockets --enable-debug -> success
make install -> got a failure, ran again to just get the output with the error

root@c1c025bca24f:/usr/src/php# make install
/bin/bash /usr/src/php/libtool --silent --preserve-dup-deps --tag=CC --mode=install cp ext/opcache/opcache.la /usr/src/php/modules
/bin/bash /usr/src/php/libtool --silent --preserve-dup-deps --tag=CC --mode=compile cc -Iext/sockets/ -I/usr/src/php/ext/sockets/ -I/usr/src/php/main -I/usr/src/php -I/usr/src/php/ext/date/lib -I/usr/include/libxml2 -I/usr/src/php/TSRM -I/usr/src/php/Zend  -D_GNU_SOURCE  -fno-common -Wstrict-prototypes -Wformat-truncation -Wlogical-op -Wduplicated-cond -Wno-clobbered -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -g -ffp-contract=off -fvisibility=hidden -UNDEBUG -O0 -Wimplicit-fallthrough=1 -DZEND_SIGNALS   -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -c /usr/src/php/ext/sockets/sockets.c -o ext/sockets/sockets.lo  -MMD -MF ext/sockets/sockets.dep -MT ext/sockets/sockets.lo
In file included from /usr/src/php/Zend/zend_types.h:25,
                 from /usr/src/php/Zend/zend.h:27,
                 from /usr/src/php/main/php.h:31,
                 from /usr/src/php/ext/sockets/sockets.c:25:
/usr/src/php/ext/sockets/sockets.c: In function 'zif_socket_getsockname':
/usr/src/php/ext/sockets/sockets.c:1049:59: error: invalid use of undefined type 'struct sockaddr_ll'
 1049 |                         if (UNEXPECTED(!if_indextoname(sll->sll_ifindex, ifrname))) {
      |                                                           ^~
/usr/src/php/Zend/zend_portability.h:388:52: note: in definition of macro 'UNEXPECTED'
  388 | # define UNEXPECTED(condition) __builtin_expect(!!(condition), 0)
      |                                                    ^~~~~~~~~
In file included from /usr/src/php/main/php.h:35:
/usr/src/php/ext/sockets/sockets.c:1056:69: error: invalid use of undefined type 'struct sockaddr_ll'
 1056 |                                 ZEND_TRY_ASSIGN_REF_LONG(objint, sll->sll_ifindex);
      |                                                                     ^~
/usr/src/php/Zend/zend_API.h:1193:61: note: in definition of macro '_ZEND_TRY_ASSIGN_LONG'
 1193 |                         zend_try_assign_typed_ref_long(ref, lval); \
      |                                                             ^~~~
/usr/src/php/ext/sockets/sockets.c:1056:33: note: in expansion of macro 'ZEND_TRY_ASSIGN_REF_LONG'
 1056 |                                 ZEND_TRY_ASSIGN_REF_LONG(objint, sll->sll_ifindex);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/php/ext/sockets/sockets.c:1056:69: error: invalid use of undefined type 'struct sockaddr_ll'
 1056 |                                 ZEND_TRY_ASSIGN_REF_LONG(objint, sll->sll_ifindex);
      |                                                                     ^~
/usr/src/php/Zend/zend_types.h:1071:33: note: in definition of macro 'ZVAL_LONG'
 1071 |                 Z_LVAL_P(__z) = l;                              \
      |                                 ^
/usr/src/php/Zend/zend_API.h:1207:9: note: in expansion of macro '_ZEND_TRY_ASSIGN_LONG'
 1207 |         _ZEND_TRY_ASSIGN_LONG(zv, lval, 1); \
      |         ^~~~~~~~~~~~~~~~~~~~~
/usr/src/php/ext/sockets/sockets.c:1056:33: note: in expansion of macro 'ZEND_TRY_ASSIGN_REF_LONG'
 1056 |                                 ZEND_TRY_ASSIGN_REF_LONG(objint, sll->sll_ifindex);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/php/ext/sockets/sockets.c: In function 'zif_socket_bind':
/usr/src/php/ext/sockets/sockets.c:1398:35: error: invalid use of undefined type 'struct sockaddr_ll'
 1398 |                                 sa->sll_ifindex = if_nametoindex(addr);
      |                                   ^~
/usr/src/php/ext/sockets/sockets.c:1400:87: error: invalid application of 'sizeof' to incomplete type 'struct sockaddr_ll'
 1400 |                                 retval = bind(php_sock->bsd_socket, sock_type, sizeof(struct sockaddr_ll));
      |                                                                                       ^~~~~~
make: *** [Makefile:1729: ext/sockets/sockets.lo] Error 1

PHP Version

65d4331

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions