Re: i386 -> x86_64 cross compile failure (binutils bug?)

Jeffrey Hundstad
2005-12-10T00:23:59Z

[-- Attachment #1: Type: text/plain, Size: 1985 bytes --]

Lee Revell wrote:

>On Fri, 2005-12-09 at 16:37 -0600, Jeffrey Hundstad wrote:
>
>
>>Lee Revell wrote:
>>
>>
>>
>>>I'm trying to build an x66-64 kernel on a 32 bit system (Ubuntu 5.10).
>>>I added -m64 to the CFLAGS as per the gcc docs. But the build fails
>>>with:
>>>
>>>$ make ARCH=x86_64
>>> [...]
>>> CC init/initramfs.o
>>>
>>>
>>>
>>>
>>I have successfully done this using Debian/Sid.
>>
>>
>>
>
>I added "-m64" to AFLAGS as well and now I get farther:
>
> CC arch/x86_64/ia32/syscall32.o
> AS arch/x86_64/ia32/vsyscall-sysenter.o
>arch/x86_64/ia32/vsyscall-sysenter.S: Assembler messages:
>arch/x86_64/ia32/vsyscall-sysenter.S:14: Error: suffix or operands invalid for `push'
>arch/x86_64/ia32/vsyscall-sysenter.S:16: Error: suffix or operands invalid for `push'
>arch/x86_64/ia32/vsyscall-sysenter.S:18: Error: suffix or operands invalid for `push'
>arch/x86_64/ia32/vsyscall-sysenter.S:25: Error: suffix or operands invalid for `pop'
>arch/x86_64/ia32/vsyscall-sysenter.S:27: Error: suffix or operands invalid for `pop'
>arch/x86_64/ia32/vsyscall-sysenter.S:29: Error: suffix or operands invalid for `pop'
>arch/x86_64/ia32/vsyscall-sigreturn.S:16: Error: suffix or operands invalid for `pop'
>make[1]: *** [arch/x86_64/ia32/vsyscall-sysenter.o] Error 1
>make: *** [arch/x86_64/ia32] Error 2
>
>Lee
>
>
>

Yes, some commands NEED the -m64 and and WILL NOT work with -m64.

Really, try my method. I've done it without all that making a separate
binutils non-sense.
You do need the 64-bit Debian build tools and 64 bit libraries. These
are the ones I have:

amd64-libs
amd64-libs-dev
lib64gcc1
lib64gfortran0
lib64ncurses5
lib64ncurses5-dev
lib64objc1
lib64stdc++6
lib64stdc++6-4.0-dbg
lib64z1
lib64z1-dev
libc6-amd64
libc6-dev-amd64

Yes... here's lin64.tar.gz if you didn't catch my little scripts before.
BTW: if there's a better way, please let me know. ...After I got this
to work I kinda quit looking ;-)

--
Jeffrey Hundstad

[-- Attachment #2: lin64.tar.gz --]
[-- Type: application/gzip, Size: 354 bytes --]