This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: jni and static libgcj and friends?
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Martin Kahlert <martin dot kahlert at infineon dot com>
- Cc: java at gcc dot gnu dot org, aoliva at redhat dot com
- Date: Tue, 26 Feb 2002 11:27:29 -0500 (EST)
- Subject: Re: jni and static libgcj and friends?
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