Hide Forgot
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)
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.
> 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.