This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: compiling with shared libraries


Andrew Haley wrote:
I think I may know what causes this.  Please try one experiment:
compile everything PIC, including the executable.

That worked. Thanks! The key is that the jvgenmain-generated .o file also needs to be compiled with -fPIC. Would it make sense to make -fPIC the default when compiling that .o file?

I then had to figure out how to coax automake+libtool to add the -fPIC.
My quick-and-dirty fix:
AC_DISABLE_STATIC (in configure.in)
AM_CFLAGS = -fPIC

And add $(AM_CLFAGS) to the command to link the executable.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]