在x86-64的Linux上編譯64 bits的newlib要注意一點

在x86-64的Linux上編譯64 bits的newlib要注意一點, 要在configure的時候加上“–disable-multilib“, 否則會有以下error, 因為newlib會連32 bits的newlib一同編譯, 會編所有文件時加上-m32

x86_64-peter-elf-cc -B/root/workspace2/newlib-1.19.0build/x86_64-peter-elf/32/newlib/ -isystem /root/workspace2/newlib-1.19.0build/x86_64-peter-elf/32/newlib/targ-include -isystem /root/workspace2/newlib-1.19.0/newlib/libc/include -B/root/workspace2/newlib-1.19.0build/x86_64-peter-elf/32/libgloss/x86_64 -L/root/workspace2/newlib-1.19.0build/x86_64-peter-elf/32/libgloss/libnosys -L/root/workspace2/newlib-1.19.0/libgloss/x86_64  -m32 -DPACKAGE_NAME=\”newlib\” -DPACKAGE_TARNAME=\”newlib\” -DPACKAGE_VERSION=\”1.19.0\” -DPACKAGE_STRING=\”newlib\ 1.19.0\” -DPACKAGE_BUGREPORT=\”\” -DPACKAGE_URL=\”\” -I. -I../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64 -DMISSING_SYSCALL_NAMES -fno-builtin     -DMISSING_SYSCALL_NAMES -fno-builtin   -O2 -g  -m32 -c -o lib_a-setjmp.o `test -f ‘setjmp.S’ || echo ‘../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/’`setjmp.S
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S: Assembler messages:
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:25: Error: bad register name `%rbx’
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:26: Error: bad register name `%rbp’
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:27: Error: bad register name `%r12′
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:28: Error: bad register name `%r13′
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:29: Error: bad register name `%r14′
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:30: Error: bad register name `%r15′
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:31: Error: bad register name `%rsp)’
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:32: Error: bad register name `%rax’
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:33: Error: bad register name `%rsp)’
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:34: Error: bad register name `%rax’ 

你可能感兴趣的:(newlib)