linuxmingw-w64msys2newlib

newlib: Compiler gets confused when building 32-bit compatibility


I am compiling newlib so I can continue the building of my cross-compiler, but newlib is getting confused with the 32-bit support I also included in my cross-compiler.

I already have my cross-compiler compiled and installed, but it's missing a standard library along with libgcc, so most programs will not compile, but programs not using standard functions will compile as long as the -nostdlib argument is used

If you're asking to me: "You should use glibc instead!", I'll answer: It requires source files from Linux, but the Linux source code does not play well on Windows, because Windows thinks that some files are the same due to the case-insensitive file system.

The errors are:

x86_64-linux-gnu-gcc  -m32 -DPACKAGE_NAME=\"newlib\" -DPACKAGE_TARNAME=\"newlib\" -DPACKAGE_VERSION=\"4.0.0\" -DPACKAGE_STRING=\"newlib\ 4.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -I. -I../../../../../../../newlib/newlib/libc/machine/x86_64 -fno-builtin -DMISSING_SYSCALL_NAMES -DHAVE_INIT_FINI     -fno-builtin -DMISSING_SYSCALL_NAMES -DHAVE_INIT_FINI   -nostdlib  -m32 -c -o lib_a-setjmp.o `test -f 'setjmp.S' || echo '../../../../../../../newlib/newlib/libc/machine/x86_64/'`setjmp.S
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S: Assembler messages:
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:25: Error: bad register name `%rbx'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:26: Error: bad register name `%rbp'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:27: Error: bad register name `%r12'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:28: Error: bad register name `%r13'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:29: Error: bad register name `%r14'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:30: Error: bad register name `%r15'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:31: Error: bad register name `%rsp)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:32: Error: bad register name `%rax'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:33: Error: bad register name `%rsp)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:34: Error: bad register name `%rax'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:35: Error: bad register name `%rax'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:39: Error: bad register name `%rsi'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:41: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:44: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:45: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:46: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:47: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:48: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:49: Error: bad register name `%rdi)'
../../../../../../../newlib/newlib/libc/machine/x86_64/setjmp.S:50: Error: bad register name `%rdi)'

Here's the entire log:

Original (some parts are in Spanish)
English translation

My compiler is: MinGW-w64 x86-64 (from MSYS2)
The cross-compiler I am trying to build is: Linux x86-64


Solution

  • I fixed it. I simply disabled multilib, because I can just simply build another compiler for 32-bit.