« Return to Thread: trying to compile pike as a library

Re: trying to compile pike as a library

by Yvan Vander Sanden :: Rate this Message:

Reply to Author | View in Thread

mmm, yes. I did try this:

make CFLAGS="-fPIC" libpike

but then gmp.h is not found. I also tried

make CFLAGS="-fPIC" CONFIGUREARGS="--without-bignums --without-gmp" libpike

to no avail.

Then i tried a full build (which works perfectly), copying out the bundles directory from the build, doing a 'make distclean', copying the bundles directory back in and trying: 'make CFLAGS="-fPIC" libpike' once again. This time no complains about a missing gmp.h, but now i'm back to error one:

Making libpike.so in build/linux-2.6.27-11-generic-x86_64
Linking libpike.so
/usr/bin/ld: language.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
language.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

Only this time i DID use fPIC. I don't see it here. I'm sure my build system is ok. I'm using the latest pike snapshot, and a plain make - make install does give me a working pike. I used make distclean between all things i tried to be sure to start from the beginning.

I sure hope someone has encountered this before, cause i'm completely clueless now :-(

Regards,

yvan


2009/10/17 H. William Welliver III <hww3@...>
CFLAGS should work... you might have to delete your previous build from the builds directory for the cached values to be cleared.

Bill


On Oct 17, 2009, at 10:54 AM, Yvan Vander Sanden wrote:

Hey.

I am trying to compile pike as a library for embedding in a c++ application.

Using the command "make libpike" i get this error at the end of the process:

Linking libpike.so
/usr/bin/ld: language.o: relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
language.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
Linking failed:
...




This makes sense, adding fPIC when compiling a library. Normally, I'd add fPIC to the CFLAGS variable, but apparently that is not used in the pike build system. I'm staring at the Makefile for some time now, but have not found yet where to add fPIC. Anyone encountered this before?

Regards,

yvan




--
Copyright only exists in the imagination of those who do not have any.

 « Return to Thread: trying to compile pike as a library