This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: Building libgcj with --disable-interpreter fails
Andrew Haley writes:
> Rainer Orth writes:
> > I've recently tried to get libjava to build again on mips-sgi-irix6.5.
> > After working around PR libgcj/28190 with a fixincludes hack, I had to
> > fix two problems:
> >
> > * I need a new mips-sgi-irix6* clause in configure.host to set the correct
> > sysdeps_dir and disable the interpreter (which cannot work since only the
> > O32 ABI has closure support in libffi):
> >
> > Thu Jun 28 12:31:42 2007 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
> >
> > * configure.host (mips-sgi-irix6*): Set sysdeps_dir.
> > Disable interpreter.
> >
> > Index: libjava/configure.host
> > ===================================================================
> > --- libjava/configure.host (revision 126209)
> > +++ libjava/configure.host (working copy)
> > @@ -254,6 +254,11 @@ EOF
> > sysdeps_dir=x86-64
> > DIVIDESPEC=-f%{m32:no-}%{!m32:%{!m64:no-}}%{m64:}use-divide-subroutine
> > ;;
> > + mips-sgi-irix6* )
> > + sysdeps_dir=mips
> > + # disable interpreter, no closure support for N32 and N64 ABIs
> > + libgcj_interpreter=no
> > + ;;
> > mips*-*-linux* )
> > sysdeps_dir=mips
> > can_unwind_signal=yes
> >
> > I'm currently running a bootstrap on the 4.2 branch, where this patch may
> > be enough to get libgcj working again (as it did in 4.1).
> >
The 4.2 branch bootstrap finished with just the configure.host part
applied. Unfortunately, testresults are terrible
http://gcc.gnu.org/ml/gcc-testresults/2007-07/msg00398.html
which is probably due to missing libffi support for the N32 and N64 ABIs.
Anyway, with this patchlet, libjava at least compiles, so I suppose it's ok
to commit to 4.2 branch and mainline?
> Tom Tromey and I have looked at the patch, and we both hate the idea
> of scattering yet more #ifdef INTERPRETER over the gcj source.
> However, it's probably the best thing to do at the moment. Please
> commit this patch.
I suppose you mean the whole patch, both the configure.host part and the
#ifdef INTERPRETER hacks?
> > * The much bigger problem on mainline was that with libgcj_interpreter=no
> > several files didn't compile any longer. By trial and error I've
> > determined the following patch which fixes the compile problem.
> > Unfortunately, libgcj.so doesn't link any longer (what a surprise :-),
> > and I don't know the code well enough to determine how to fix this.
> >
> > Since my IRIX hosts are quite slow, I tried to verify this patch on
> > i386-pc-solaris2.10 (libgcj builds, but fails to link due to PR
> > target/32462) and sparc-sun-solaris2.10 (libgcj builds, but fails to link
> > due to many missing symbols) with --disable-interpreter.
> >
> > What's the best way to approach this?
>
> I've added a comment to the Bug.
I fear I've been unclear: there are two link failures involved here:
* PR target/32462 which is Solaris 10/x86 specific and independent of
--disable-interpreter
* PR libgcj/32652 where even with my #ifdef INTERPRETER patch applied
libgcj.so links successfully, but e.g. jv-convert fails to link due to
many unresolved symbols:
Undefined first referenced
symbol in file
void gnu::classpath::jdwp::VMVirtualMachine::setDefaultStratum(java::lang::String*)./.libs/libgcj.so
JVMTI::ThreadStart ./.libs/libgcj.so
java::lang::String* gnu::classpath::jdwp::VMVirtualMachine::getSourceDebugExtension(java::lang::Class*)./.libs/libgcj.so
java::lang::String* gnu::classpath::jdwp::VMMethod::getSignature() ./.libs/libgcj.so
int gnu::classpath::jdwp::VMMethod::getModifiers()./.libs/libgcj.so
int gnu::classpath::jdwp::VMVirtualMachine::getFrameCount(java::lang::Thread*) ./.libs/libgcj.so
JArray<gnu::classpath::jdwp::VMMethod*>* gnu::classpath::jdwp::VMVirtualMachine::getAllClassMethods(java::lang::Class*)./.libs/libgcj.so
void gnu::gcj::jvmti::Breakpoint::remove()./.libs/libgcj.so
gnu::classpath::jdwp::VMFrame* gnu::classpath::jdwp::VMVirtualMachine::getFrame(java::lang::Thread*, long long)./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::unregisterEvent(gnu::classpath::jdwp::event::EventRequest*)./.libs/libgcj.so
java::lang::String* gnu::classpath::jdwp::VMMethod::getName() ./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::popFrames(java::lang::Thread*, long long)./.libs/libgcj.so
void gnu::classpath::jdwp::VMFrame::setValue(int, gnu::classpath::jdwp::value::Value*)./.libs/libgcj.so
java::util::Collection* gnu::classpath::jdwp::VMVirtualMachine::getAllLoadedClasses() ./.libs/libgcj.so
java::util::ArrayList* gnu::classpath::jdwp::VMVirtualMachine::getFrames(java::lang::Thread*, int, int)./.libs/libgcj.so
gnu::classpath::jdwp::util::LineTable* gnu::classpath::jdwp::VMMethod::getLineTable()./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::initialize()./.libs/libgcj.so
java::util::ArrayList* gnu::classpath::jdwp::VMVirtualMachine::getLoadRequests(java::lang::ClassLoader*) ./.libs/libgcj.so
gnu::classpath::jdwp::util::VariableTable* gnu::classpath::jdwp::VMMethod::getVariableTable()./.libs/libgcj.so
JArray<java::lang::Object*>* gnu::classpath::jdwp::VMVirtualMachine::getOwnedMonitors(java::lang::Thread*)./.libs/libgcj.so
int gnu::classpath::jdwp::VMVirtualMachine::getThreadStatus(java::lang::Thread*) ./.libs/libgcj.so
JVMTI::VMInit ./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::resumeThread(java::lang::Thread*)./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::registerEvent(gnu::classpath::jdwp::event::EventRequest*)./.libs/libgcj.so
java::lang::String* gnu::classpath::jdwp::VMVirtualMachine::getSourceFile(java::lang::Class*)./.libs/libgcj.so
java::lang::Object* gnu::classpath::jdwp::VMVirtualMachine::getCurrentContendedMonitor(java::lang::Thread*)./.libs/libgcj.so
gnu::classpath::jdwp::value::Value* gnu::classpath::jdwp::VMFrame::getValue(int, char)./.libs/libgcj.so
JVMTI::enabled ./.libs/libgcj.so
JArray<char>* gnu::classpath::jdwp::VMVirtualMachine::getBytecodes(gnu::classpath::jdwp::VMMethod*)./.libs/libgcj.so
gnu::classpath::jdwp::VMMethod* gnu::classpath::jdwp::VMVirtualMachine::getClassMethod(java::lang::Class*, long long)./.libs/libgcj.so
_Jv_ClosureList::releaseClosures(_Jv_ClosureList**)./.libs/libgcj.so
int gnu::classpath::jdwp::VMVirtualMachine::getSuspendCount(java::lang::Thread*) ./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::suspendThread(java::lang::Thread*)./.libs/libgcj.so
JVMTI::Exception ./.libs/libgcj.so
void gnu::gcj::jvmti::Breakpoint::install()./.libs/libgcj.so
_Jv_GetJVMTIEnv() ./.libs/libgcj.so
int gnu::classpath::jdwp::VMVirtualMachine::getClassStatus(java::lang::Class*) ./.libs/libgcj.so
void gnu::gcj::jvmti::Breakpoint::_save_insn()./.libs/libgcj.so
JVMTI::ThreadEnd ./.libs/libgcj.so
_Jv_ClosureList::registerClosure(java::lang::Class*, void*) ./.libs/libgcj.so
JVMTI::VMDeath ./.libs/libgcj.so
gnu::classpath::jdwp::util::MonitorInfo* gnu::classpath::jdwp::VMVirtualMachine::getMonitorInfo(java::lang::Object*)./.libs/libgcj.so
gnu::classpath::jdwp::util::MethodResult* gnu::classpath::jdwp::VMVirtualMachine::executeMethod(java::lang::Object*, java::lang::Thread*, java::lang::Class*, gnu::classpath::jdwp::VMMethod*, JArray<gnu::classpath::jdwp::value::Value*>*, int)./.libs/libgcj.so
JVMTI::ClassPrepare ./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::redefineClasses(JArray<java::lang::Class*>*, JArray<JArray<char>*>*)./.libs/libgcj.so
void gnu::classpath::jdwp::VMVirtualMachine::clearEvents(char)./.libs/libgcj.so
_Jv_JVMTI_Init() ./.libs/libgcj.so
_Jv_ReportJVMTIExceptionThrow(java::lang::Throwable*) ./.libs/libgcj.so
_Jv_JVMTI_PostEvent(jvmtiEvent, java::lang::Thread*, ...)./.libs/libgcj.so
ld: fatal: Symbol referencing errors. No output written to .libs/jv-convert
collect2: ld returned 1 exit status
make[3]: *** [jv-convert] Error 1
I fear there's no other approach than looking up every reference to those
symbols and see what can be done about them (like providing a dummy
replacement).
Until this is resolved, it doesn't probably make much sense to commit the
#ifdef INTERPRETER patch since it just changes compile time failures into
link time failures.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University