This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
[PATCH] Re: How exactly does one build libjava successfully?
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: [PATCH] Re: How exactly does one build libjava successfully?
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 15 Feb 2001 14:10:47 +1300
- CC: gcc-patches at gcc dot gnu dot org, java at gcc dot gnu dot org
- References: <20010213175707.A244@wolery.stanford.edu>
Zack Weinberg wrote:
> There are a couple of different things I would like to try out gcj
> with, but I cannot successfully build libgcj. On both HEAD and the
> branch, with or without --enable-shared to configure, I get these link
> errors:
>
> ./.libs/libgcj.so: undefined reference to `__eh_alloc@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__eh_free@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__throw@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__get_eh_info@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__get_eh_table_language@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__terminate@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__terminate_set_func@GCC_3.0'
> ./.libs/libgcj.so: undefined reference to `__rethrow@GCC_3.0'
>
> Any clues would be appreciated. This is i686-pc-linux-gnu.
>
> zw
The problem is that ENABLE_SHARED_LIBGCC was not being defined when building
java/jvspec.o, resulting in gcj's link command using -lgcc when it should have
been using -lgcc_s.
This patch seems to fix it. Not that I removed $(OUTPUT_OPTION), since
cp/Make-lang.in doesn't use it and I can't figure out what it would be for.
Okay to commit?
regards
[ bryce ]
2001-02-15 Bryce McKinlay <bryce@albatross.co.nz>
* Make-lang.in (jvspec.o): Modify rule to match that of cp/g++spec.o.
Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/Make-lang.in,v
retrieving revision 1.52
diff -u -r1.52 Make-lang.in
--- Make-lang.in 2001/02/09 21:34:57 1.52
+++ Make-lang.in 2001/02/15 00:57:52
@@ -61,8 +61,10 @@
.PHONY: java
jvspec.o: $(srcdir)/java/jvspec.c system.h $(GCC_H) $(CONFIG_H)
+ (SHLIB_LINK='$(SHLIB_LINK)' \
+ SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
- $(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION)
+ $(INCLUDES) $(srcdir)/java/jvspec.c)
# Create the compiler driver for $(GCJ).
$(GCJ)$(exeext): gcc.o jvspec.o version.o \