This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Hints on compiling Newlib


Hello everyone,

I am trying to compile Newlib so that it can be used with the
Operating System (for x86-64 systems) we are developing.

I have downloaded the latest source (1.19.0) and am tying to compile
it in an Ubuntu 11.04 64-Bit VM.

I run this to generate the makefile:
../newlib-1.19.0/configure --target=x86_64-pc-none
I then had to adjust the makefile to tell it that the target programs
are the same as the host programs (as I am on the same architecture, I
don't need a cross-compiler setup?)

Running make looks good other than it is compiling with the "-m32"
argument instead of "-m64". Eventually the build will fail with
"Error: bad register name" because it does not recognize the 64-bit
register names (probably because it looks to be compiling a 32-bit
binary).

How can I force it to compile to 64-bit binaries?

Thanks in advance,
-Ian

Output when it fails:
make[8]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc/misc'
Making all in machine
make[8]: Entering directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc/machine'
Making all in x86_64
make[9]: Entering directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc/machine/x86_64'
cc -B/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/
-isystem /home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/targ-include
-isystem /home/ian/Downloads/newlib/newlib-1.19.0/newlib/libc/include
-B/home/ian/Downloads/newlib/build/x86_64-pc-none/32/libgloss/x86_64
-L/home/ian/Downloads/newlib/build/x86_64-pc-none/32/libgloss/libnosys
-L/home/ian/Downloads/newlib/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   -g -O2  -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-1.19.0/newlib/libc/machine/x86_64/setjmp.S:35:
Error: bad register name `%rax'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:39:
Error: bad register name `%rsi'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:41:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:44:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:45:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:46:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:47:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:48:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:49:
Error: bad register name `%rdi)'
../../../../../../../newlib-1.19.0/newlib/libc/machine/x86_64/setjmp.S:50:
Error: bad register name `%rdi)'
make[9]: *** [lib_a-setjmp.o] Error 1
make[9]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc/machine/x86_64'
make[8]: *** [all-recursive] Error 1
make[8]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc/machine'
make[7]: *** [all-recursive] Error 1
make[7]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib/libc'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib'
make[5]: *** [all] Error 2
make[5]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/32/newlib'
make[4]: *** [multi-do] Error 1
make[4]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/newlib'
make[3]: *** [all-multi] Error 2
make[3]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/newlib'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/home/ian/Downloads/newlib/build/x86_64-pc-none/newlib'
make[1]: *** [all-target-newlib] Error 2
make[1]: Leaving directory `/home/ian/Downloads/newlib/build'
make: *** [all] Error 2

-- 
Ian Seyler | Founder / Lead Programmer | Return Infinity |
ian.seyler@returninfinity.com | visit us at www.returninfinity.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]