chobie / php-uv

libuv php extension
184 stars 21 forks source link

Compilation failed on Ubuntu 12.04 x64 #41

Closed nlegoff closed 11 years ago

nlegoff commented 11 years ago

Compilations fails with :

/bin/bash /tmp/php-uv/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/php-uv/include -I/tmp/php-uv/main -I/tmp/php-uv -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 -I/tmp/php-uv/http-parser -I/tmp/php-uv/libuv/include  -DHAVE_CONFIG_H  -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libuv/uv.a -lrt   -o uv.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/php-uv/modules  php_uv.lo uv.lo http-parser/http_parser.lo 
libtool: link: cc -shared  -fPIC -DPIC  .libs/php_uv.o .libs/uv.o http-parser/.libs/http_parser.o   -lrt  -O2 -Wl,libuv/uv.a   -Wl,-soname -Wl,uv.so -o .libs/uv.so
/usr/bin/ld: libuv/uv.a(async.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
libuv/uv.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [uv.la] Error 1
igorw commented 11 years ago

I assume you ran it with make libuv.a CFLAGS=-fPIC?

chobie commented 11 years ago

yea, please make libuv with fPIC flag.

nlegoff commented 11 years ago

:confused: It works ! I should have read the readme .. sorry

chobie commented 11 years ago

np, have fun :smiley: