xflouris / libpll

Phylogenetic Likelihood Library
GNU Affero General Public License v3.0
26 stars 6 forks source link

compile error for cpu features detection on i386 with __PIC__ #140

Closed xflouris closed 7 years ago

xflouris commented 7 years ago

When compiling libpll on i386 I get the following error:

/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..    -Wall -Wsign-compare -D_GNU_SOURCE -std=c99 -O3 -fPIC -g -MT libpll_la-hardware.lo -MD -MP -MF .deps/libpll_la-hardware.Tpo -c -o libpll_la-hardware.lo `test -f 'hardware.c' || echo './'`hardware.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -Wall -Wsign-compare -D_GNU_SOURCE -std=c99 -O3 -fPIC -g -MT libpll_la-hardware.lo -MD -MP -MF .deps/libpll_la-hardware.Tpo -c hardware.c  -fPIC -DPIC -o .libs/libpll_la-hardware.o
hardware.c: In function ‘pll_hardware_probe’:
hardware.c:41:3: error: inconsistent operand constraints in an ‘asm’

The problem seems to be that the cpuid instruction makes use of the ebx register, which in turn is used as PIC register for i386.

Possible solution: http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well

xflouris commented 7 years ago

fixed