Bug 713709 - gcj for 32 bits on x86_64 searches zlib.so at a wrong location
Summary: gcj for 32 bits on x86_64 searches zlib.so at a wrong location
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 15
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-06-16 10:30 UTC by Jean-Pierre André
Modified: 2011-08-04 16:55 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-08-04 10:11:07 UTC
Type: ---


Attachments (Terms of Use)

Description Jean-Pierre André 2011-06-16 10:30:30 UTC
Description of problem:
gcj for 32 bits on x86_64 searches zlib.so at a wrong location

Version-Release number of selected component (if applicable):
gcc-java-4.6.0-7.fc15.x86_64.rpm

How reproducible:
Always

Steps to Reproduce:
1. Write a simple java program foo.java
2. Compile by gcj -m32 -march=i386 --main=foo -o foo foo.java
3.
  
Actual results:
/usr/bin/ld: skipping incompatible /usr/lib64/libz.so when searching for -lz
/usr/bin/ld: cannot find -lz

Expected results:
Should link with no error

Additional info:

The 32-bit libz.so is searched in /usr/lib (before trying /usr/lib64), but libz.so is in /lib
This can be fixed by setting a symbolic link :
ln -s /lib/libz.so.1.2.5 /usr/lib/libz.so
(this bug also existed in fc14)

Comment 1 Jakub Jelinek 2011-08-04 10:11:07 UTC
Not sure what you are doing, but it works just fine for me.
To compile 32-bit Java programs using gcj successfully you obviously need to have 32-bit libgcj-devel installed, but if you do
yum install libgcj-devel.i686
then zlib-devel.i686 is installed as a dependency and that package contains the /usr/lib/libz.so symlink.

Comment 2 Jean-Pierre André 2011-08-04 16:55:30 UTC
> To compile 32-bit Java programs using gcj successfully you obviously
> need to have 32-bit libgcj-devel installed,

Ok I see, I did have the libgcj-devel.x86_64, but the need for the i386 was not obvious to me : libgcj requires libz.so.1 which is satisfied by zlib as a symlink in /lib, so no package pumps the i386 variant of libgcj-devel.

Thanks. Now I know.


Note You need to log in before you can comment on or make changes to this bug.