#include <stdio.h>
int main()
{
printf("kecske\n");
return 0;
}
I compile it with this command:
cc -m32 test.c -o test
And i get this result:
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: skipping incompatible /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/libgcc.a when searching for -lgcc
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find -lgcc
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: skipping incompatible /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/libgcc_s.so.1 when searching for libgcc_s.so.1
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find libgcc_s.so.1
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: skipping incompatible /boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/libgcc.a when searching for -lgcc
/boot/system/develop/tools/bin/../lib/gcc/x86_64-unknown-haiku/8.3.0/../../../../x86_64-unknown-haiku/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status
I found no 32-bit compatibility libraries for GCC in HaikuDepot nor a 32-bit version of libgcc. How can i compile 32-bit Haiku binaries under a 64-bit Haiku installation?
I might misunderstood the intention, but this article elaborates compiling for 64-bit under 32-bit and i need the opposite. Or you meant i need to reverse it by hand and build a GCC2 on Haiku amd64?
No, i meant to build a 32 bit Haiku on 64 bit Haiku you should bootstrap a cross compiler first. You can use this compiler to build 32 bit programs on 64 bit. There is no infrastructure yet to do it easier i fear.
This article does not clarify what and where should i get, only the configuring and the flags before the compilation. Or do i need to get the entire Haiku source and build that, or at least the crosscompiler? If yes, then it’s easier to install a 32-bit Haiku beside the 64-bit one.