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]

RFC: Why are -lsupc++ -lstdc++ needed when linking java programs?


David Daney writes:
 > I am playing around with mipsel-linux-gcj (GCC) 3.4 20030930 
 > (experimental).  Mainline cvs configured for mipsel-linux target.
 > 
 > 
 > My "test" program is PR218.java from the libgcj testsuite.
 > 
 > When compiled in the "standard" manner:
 > 
 > $ mipsel-linux-gcj -static -o PR218 -O3 --main=PR218 PR218.java
 > 
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(prims.o)(.text+0xb3c): 
 > In function `parse_heap_size':
 > /home/testcvs/mipsisa32el-linux/sys-include/stdlib.h:307: undefined 
 > reference to `__cxa_call_unexpected'
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(prims.o)(.text+0xb44):/home/testcvs/mipsisa32el-linux/sys-include/stdlib.h:307: 
 > undefined reference to `__cxa_call_unexpected'
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(natFile.o)(.text+0x764):/home/testcvs/mipsisa32el-linux/sys-include/sys/stat.h:345: 
 > undefined reference to `__cxa_call_unexpected'
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(natFile.o)(.text+0x76c):/home/testcvs/mipsisa32el-linux/sys-include/sys/stat.h:345: 
 > undefined reference to `__cxa_call_unexpected'
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(natFile.o)(.text+0x8bc):/home/testcvs/mipsisa32el-linux/sys-include/sys/stat.h:345: 
 > undefined reference to `__cxa_call_unexpected'
 > /home/testcvs/lib/gcc/mipsisa32el-linux/3.4/../../../../mipsisa32el-linux/lib/libgcj.a(natFile.o)(.text+0x8c4):/home/testcvs/mipsisa32el-linux/sys-include/sys/stat.h:345: 
 > more undefined references to `__cxa_call_unexpected' follow
 > collect2: ld returned 1 exit status
 > 
 > 
 > The problem seems to be that some of the 'C++' files in libgcj require 
 > the C++ runtime (at least for the mipsel-linux target), but it is not 
 > being linked by the gcj driver.

Well, I don't think they require it.  However, it is undeniably being
called!

`__cxa_call_unexpected' isn't called from anywhere in libgcj in i386
Linux, at least not on my system.  So, you need to isolate the place
where it's being called, preferably with assembly language output from
the compiler.

The call to `__cxa_call_unexpected' is generated when
-fenforce-eh-specs is used.  Try building libgcj with -fno-enforce-eh-specs.

Andrew.


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