Dear all,
I have to compile a very old program on a new system. To change it completely to 64bit is out of question, it is too much depending on int = 32 bit. I ahve installed all 32-bit development libraries I could find.
I have included in all compiler commandlines the -m32 instruction.
But I always get the following error:
cc -m32 -shared -lpthread -L. kernelLib.o taskLib.o msgQLib.o semLib.o wdLib.o wdLib2.o v2ldebug.o tickLib.o vxWorks.o -o libv2lin.so
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc.a when searching for -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.8/libgcc_s.so when searching for -lgcc_s
/usr/lib64/gcc/x86_64-suse-linux/4.8/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -lgcc_s
collect2: error: ld returned 1 exit status
Can anybode give me a hint where to look for the problem?
Hi
Is the 32bit gcc installed (gcc48-32bit)? You probably need to point at /usr/lib64/gcc/x86_64-suse-linux/4.8/32/ (,_ the 32/ is where they exist) when configuring to pick them up.
And then after installing a 32-bit GCC,
Because the 64-bit GCC will likely continue to be the default you would have to either specify the 32-bit GCC during compiling or switch your entire system to use the 32-bit GCC temporarily when you compile.
An easy way to do the latter (switch your entire system) is described in this Wiki page I created
Thanks to all for the quick answer.
Indeed the gcc-32bit was missing. However I couldn’t invoke it.
I tried to follow your instructions in the link above. But when I enter
From what you posted,
I suspect you installed only the packages containing the 32-bit gcc documentation and not the gcc-32bit binary package itself.
If you don’t install a 32-bit gcc package and instead copy the 32-bit gcc binary from elsewhere, it won’t show up as a package. In that case, you should note the location of the binary and modify the update-alternatives entry accordingly.
The alternative to setting up an update-alternatives is to do as arvidjaar suggests… invoke the gcc binary you want to use directly.
Personally, I prefer the update-alternatives I posted because invoking a non-default gcc is something I do very rarely so probably won’t remember (too much else to remember) but different people will have their own opinion.
I also thought this. But I double checked in Yast for gcc-32bit. And it was installed. Maybe when I installed later from Yast the gcc-c+±32bit all the binaries were installed? Because then it worked.
Is there a simple package to install for 32bit compiling?
AFAIK the “C” compilers are simply binaries with no dependencies (could be different, for instance Java compilers likely need the entire 32-bit JRE to compile and test).
So, if the 32-bit c compiler exists then the only remaining issue is to point to it and not the default compiler.