Question

I am trying to compile the PHP xhprof extension. On one server, make is successful, on another one it fails with "inline asm() not supported". The relevant code is

asm volatile("rdtsc" : "=a" (__a), "=d" (__d));  

Both servers run Debian with similar configuration.

Question: What package am I missing or which packages version should I compare between the servers to enable inline asm?

For reference the make output

/bin/sh /usr/local/src/xhprof/extension/libtool --mode=compile cc  -I. -I/usr/local/src/xhprof/extension -DPHP_ATOM_INC -I/usr/local/src/xhprof/extension/include -I/usr/local/src/xhprof/extension/main -I/usr/local/src/xhprof/extension -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -DHAVE_CONFIG_H  -g   -c /usr/local/src/xhprof/extension/xhprof.c -o xhprof.lo
libtool: compile:  cc -I. -I/usr/local/src/xhprof/extension -DPHP_ATOM_INC -I/usr/local/src/xhprof/extension/include -I/usr/local/src/xhprof/extension/main -I/usr/local/src/xhprof/extension -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -c /usr/local/src/xhprof/extension/xhprof.c  -DPIC -o .libs/xhprof.o
/usr/local/src/xhprof/extension/xhprof.c:1224: inline asm() not supported
/usr/local/src/xhprof/extension/libtool: line 1111: 23098 Segmentation fault      cc -I. -I/usr/local/src/xhprof/extension -DPHP_ATOM_INC -I/usr/local/src/xhprof/extension/include -I/usr/local/src/xhprof/extension/main -I/usr/local/src/xhprof/extension -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -c    /usr/local/src/xhprof/extension/xhprof.c -DPIC -o .libs/xhprof.o
make: *** [xhprof.lo] Error 1
Was it helpful?

Solution

Apparently cc on this machine is not a link to gcc but to some other compiler (tcc) which doesn't understand gcc's extended asm syntax.

OTHER TIPS

Could it be that the error message means "the assembly code itself is not supported", not that the asm() compiler feature isn't? In other words, you're building for some (semi-ancient) processor which doesn't have the rdtsc instruction?

The seg fault right after the error is kind of scary, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top