Bug 31223 - [regression] indirect dispatch not working with static builds
Summary: [regression] indirect dispatch not working with static builds
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-16 12:55 UTC by Marco Trudel
Modified: 2016-10-03 05:43 UTC (History)
2 users (show)

See Also:
Host:
Target: i686-pc-linux
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Trudel 2007-03-16 12:55:17 UTC
With a static gcj build, target=i686-pc-linux, using -findirect-dispatch to compile a class will result in this compilation error:

/tmp/cciWx2S5.o: In function `main':ccxsXCuN.i:(.text+0x13): undefined reference to `_Jv_Compiler_Properties'
:ccxsXCuN.i:(.text+0x30): undefined reference to `JvRunMainName'
/tmp/ccmjyQHx.o: In function `void Test::main(JArray<java::lang::String*>*)':Test.class:(.text+0x2e): undefined reference to `_Jv_InitClass'
:Test.class:(.text+0x51): undefined reference to `_Jv_ResolvePoolEntry'
/tmp/ccmjyQHx.o: In function `global constructors keyed to 0__ZN4TestC1Ev':Test.class:(.text+0xb6): undefined reference to `_Jv_RegisterNewClasses'
/tmp/ccmjyQHx.o:(.eh_frame+0x11): undefined reference to `__gcj_personality_v0'
collect2: ld returned 1 exit status

Seen with a host=mingw and host=linux GCJ. This worked with GCJ 4.2.

Workaround:
The problem probably lies in libgcj.spec. In my host=linux and target=linux libgcj.spec, I have:
*lib: %{static-libgcj:-non_shared} %{s-bc-abi:-lgcj_bc;:-lgcj} %{static-libgcj:-call_shared} -lm   -lpthread -lrt    -ldl %(libgcc) %(liborig)

Replacing it with:
*lib: %{s-bc-abi:} -lgcj  -lm   -lpthread -lrt    -ldl %(libgcc) %(liborig) 

Will make the compilation work again.
Comment 1 Marco Trudel 2007-03-16 12:57:37 UTC
This also breaks the build when a static built GCJ is taken for the compilation of ecj.jar (because it's compiled with -findirect-dispatch).
Comment 2 Andrew Pinski 2007-04-28 01:35:31 UTC
Actually static builds of libgcj are pretty much broken with a valid ABI :).
Comment 3 Marco Trudel 2007-04-28 08:12:07 UTC
What do you mean with this? What doesn't work? Is this something recent?
At least rev 122'233 seemed ok to me...
Comment 4 Andrew Pinski 2016-10-03 05:43:21 UTC
GCJ has been removed from the trunk so I doubt this will be fixed so closing as such.