Reputation: 243
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
Upvotes: 3
Views: 185
Reputation: 7925
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.
Upvotes: 3
Reputation: 399833
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.
Upvotes: 1