Pretty simple or at least it should be:
trying to compile this C program to a 32 bit binary:
#include <stdio.h>
int main(int argc,char *argv])
{
printf("Hello There
");
return(0);
}
Have done it for many years using simple gcc -m32 hello.c -o hello
Now when I do this I get the following:
/usr/lib64/gcc/x86_64-suse-linux/4.7/…/…/…/…/x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc.a when searching for -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.7/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -lgcc
/usr/lib64/gcc/x86_64-suse-linux/4.7/…/…/…/…/x86_64-suse-linux/bin/ld: skipping incompatible /usr/lib64/gcc/x86_64-suse-linux/4.7/libgcc_s.so when searching for -lgcc_s
/usr/lib64/gcc/x86_64-suse-linux/4.7/…/…/…/…/x86_64-suse-linux/bin/ld: cannot find -lgcc_s
I know it means that in the link phase it cannot find the 32 bit versions of libgcc.a which when I search /usr I only see a 64 bit version in the directory as listed above.
I installed the glibc-devel-32bit package. This got past a header file compile error but I cannot seem to find a package(s) that will allow a 32 bit binary to be created. Any ideas?
I realize there is no reason I could not use a 64 bit hello program this is just a very simple example.