View Issue Details

IDProjectCategoryView StatusLast Update
0001878XdebugInstallationpublic2020-11-14 16:15
Reporterrjung Assigned Toderick  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionfixed 
Product Version3.0.0beta1 
Target Version3.0.0RC1Fixed in Version3.0.0RC1 
Summary0001878: Compilation failure: Socket options TCP_KEEPCNT and TCP_KEEPINTVL do not exist on Solaris 10 Sparc
DescriptionSocket options TCP_KEEPCNT and TCP_KEEPINTVL do not exist on Solaris 10 Sparc, so compilation fails in src/debugger.com.c due to their use in the following lines:

       ret = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
...
       ret = setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);

AFAIK there's no replacement one could use, but it is probably safe to simply not set the options, if the respective flag is not defined.

The same problem also occurs on the 2.9 branch.

Something like the following should work:

--- src/debugger/com.c        2020-09-28 12:24:43.000000000 +0000
+++ src/debugger/com.c  2020-11-05 16:53:47.250586515 +0000
@@ -111,17 +111,21 @@
                return;
        }

+#if defined(TCP_KEEPCNT)
        optval = 20;
        ret = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
        if (ret) {
                return;
        }
+#endif

+#if defined(TCP_KEEPINTVL)
        optval = 60;
        ret = setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);
        if (ret) {
                return;
        }
+#endif
 }
 #endif


Thanks and regards,

Rainer
Tagscompilation, Solaris
Operating System
PHP Version7.4.0-7.4.4

Activities

derick

2020-11-05 16:38

administrator   ~0005503

Could you profile the compiler errors (as an attachment) please?

rjung

2020-11-05 17:54

reporter  

xdebug-solaris-compile-error.txt (2,181 bytes)   
/bin/ksh /path/to/build/xdebug-2.9.8/libtool --mode=compile gcc -specs=/shared/build/autobuild/specs/specs.solaris   -I. -I/path/to/build/xdebug-2.9.8 -DPHP_ATOM_INC -I/path/to/build/xdebug-2.9.8/include -I/path/to/build/xdebug-2.9.8/main -I/path/to/build/xdebug-2.9.8 -I/path/to/php/include/php -I/path/to/php/include/php/main -I/path/to/php/include/php/TSRM -I/path/to/php/include/php/Zend -I/path/to/php/include/php/ext -I/path/to/php/include/php/ext/date/lib -I/path/to/build/xdebug-2.9.8/src  -DHAVE_CONFIG_H  -mcpu=v9 -O2 -g -Wall -fno-strict-aliasing -D_POSIX_PTHREAD_SEMANTICS   -c /path/to/build/xdebug-2.9.8/src/debugger/com.c -o src/debugger/com.lo
 gcc -specs=/path/to/specs.solaris -I. -I/path/to/build/xdebug-2.9.8 -DPHP_ATOM_INC -I/path/to/build/xdebug-2.9.8/include -I/path/to/build/xdebug-2.9.8/main -I/path/to/build/xdebug-2.9.8 -I/path/to/php/include/php -I/path/to/php/include/php/main -I/path/to/php/include/php/TSRM -I/path/to/php/include/php/Zend -I/path/to/php/include/php/ext -I/path/to/php/include/php/ext/date/lib -I/path/to/build/xdebug-2.9.8/src -DHAVE_CONFIG_H -mcpu=v9 -O2 -g -Wall -fno-strict-aliasing -D_POSIX_PTHREAD_SEMANTICS -c /path/to/build/xdebug-2.9.8/src/debugger/com.c  -fPIC -DPIC -o src/debugger/.libs/com.o
/path/to/build/xdebug-2.9.8/src/debugger/com.c: In function 'set_keepalive_options':
/path/to/build/xdebug-2.9.8/src/debugger/com.c:115:32: error: 'TCP_KEEPCNT' undeclared (first use in this function); did you mean 'TCP_KEEPIDLE'?
  115 |  ret = setsockopt(fd, SOL_TCP, TCP_KEEPCNT, &optval, optlen);
      |                                ^~~~~~~~~~~
      |                                TCP_KEEPIDLE
/path/to/build/xdebug-2.9.8/src/debugger/com.c:115:32: note: each undeclared identifier is reported only once for each function it appears in
/path/to/build/xdebug-2.9.8/src/debugger/com.c:121:32: error: 'TCP_KEEPINTVL' undeclared (first use in this function); did you mean 'TCP_KEEPALIVE'?
  121 |  ret = setsockopt(fd, SOL_TCP, TCP_KEEPINTVL, &optval, optlen);
      |                                ^~~~~~~~~~~~~
      |                                TCP_KEEPALIVE
make: *** [Makefile:275: src/debugger/com.lo] Error 1

derick

2020-11-11 10:16

administrator   ~0005513

https://github.com/xdebug/xdebug/pull/682

derick

2020-11-11 12:36

administrator   ~0005515

Fixed for 3.0.0beta2 — It is also in the xdebug_2_9 branch, but I do not expect a further release from that branch. Thanks for the report!

Issue History

Date Modified Username Field Change
2020-11-05 15:55 rjung New Issue
2020-11-05 15:55 rjung Tag Attached: compilation
2020-11-05 15:55 rjung Tag Attached: Solaris
2020-11-05 16:38 derick Description Updated
2020-11-05 16:38 derick Assigned To => derick
2020-11-05 16:38 derick Status new => feedback
2020-11-05 16:38 derick Note Added: 0005503
2020-11-05 17:54 rjung File Added: xdebug-solaris-compile-error.txt
2020-11-11 10:16 derick Note Added: 0005513
2020-11-11 12:36 derick Status feedback => closed
2020-11-11 12:36 derick Resolution open => fixed
2020-11-11 12:36 derick Fixed in Version => 3.0.0RC1
2020-11-11 12:36 derick Note Added: 0005515
2020-11-14 16:15 derick Target Version => 3.0.0RC1