jni and static libgcj and friends?

Jeff Sturm jsturm@one-point.com
Tue Feb 26 08:44:00 GMT 2002


On Tue, 26 Feb 2002, Jeff Sturm wrote:
> In theory you could build libgcj with -prefer-pic and get what you want...
> I tried this and it didn't seem to work.

My apologies... -prefer-pic *does* work.  It's just that it still builds
each object twice :(

Martin, try this makefile hack (be sure to re-run automake):

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libjava/Makefile.am,v
retrieving revision 1.201
diff -u -r1.201 Makefile.am
--- Makefile.am	2002/02/22 03:21:26	1.201
+++ Makefile.am	2002/02/26 16:24:06
@@ -69,7 +69,7 @@
 ## compiles.
 GCJ_WITH_FLAGS = $(GCJ) --encoding=UTF-8
 
-GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
+GCJCOMPILE = $(LIBTOOL) --tag=GCJ --mode=compile -prefer-pic $(GCJ_WITH_FLAGS) -fassume-compiled -fclasspath=$(here) -L$(here) $(JC1FLAGS) -MD -MT $@ -MF $(@:.lo=.d) -c
 GCJLINK = $(LIBTOOL) --tag=GCJ --mode=link $(GCJ) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
 LIBLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXX) -L$(here) $(JC1FLAGS) $(LDFLAGS) -o $@
 
@@ -77,7 +77,7 @@
 ## values of `CXX' and will then get confused and fail to work.  So,
 ## we use --tag explicitly.  Someday automake will be changed to do
 ## this automatically.
-LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile -prefer-pic $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
 
 JAVAC = $(GCJ_WITH_FLAGS) -C
 



More information about the Java mailing list