Bug 1004507

Summary: libgcj.a not installed with any gcc / libgcj related RPM
Product: [Fedora] Fedora Reporter: Joel <hundred17>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 19CC: jakub, law
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-04 19:32:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Joel 2013-09-04 19:28:39 UTC
Description of problem:
libgcj.a is needed to be able to have the gcj compiler work with the '-static-libgcj' parameter.  libgjc.a is nowhere to be found on the filesystem.

Version-Release number of selected component (if applicable):
libgcj-4.8.1-1.fc19.x86_64

How reproducible:
Every time.

Steps to Reproduce:
1.Create a simple "hello world" type Java source file.
2.Compile with 'gcj -static-libgcj --main=HelloWorld ./HelloWorld.java -o Hello'
3.Witness the error.

Actual results:
[joel@f19 ~]$ gcj -static-libgcj ./HelloWorld.java -o Hello
/usr/bin/ld: cannot find -lgcj
collect2: error: ld returned 1 exit status

Expected results:
A binary that has statically linked with the libgcj libraries.

Additional info:
Building without the '-static-libgcj' works fine, but of course it now dynamically links to /lib64/libgcj.so.14 which is what we're trying to avoid.

Comment 1 Jakub Jelinek 2013-09-04 19:32:14 UTC
Statically linking gcj doesn't really work, which is why we are intentionally not shipping libgcj.a.
If you want to compile/link programs that don't depend on particular libgcj.so version, use -findirect-dispatch (both for compilation and linking).