[SOLVED] Creating cross-compiler fails

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
stdcall
Member
Member
Posts: 78
Joined: Thu Mar 14, 2013 1:30 am

[SOLVED] Creating cross-compiler fails

Post by stdcall »

I followed the guide on the wiki for creating a cross-compiler.
I'm using these version:
gcc-4.7.2
binutils-2.23.1
I'm running Linux Mint 64bit. and I want to compile a cross compiler for a 32bit kernel.
the binutils compiles successfully, however when compiling gcc, I get the following error:
Assembler messages:
Fatal error: no compiled in support for x86_64
make[1]: *** [build/genconstants.o] Error 1
Is there a specific flag I need to pass to configure in order for this to work.
Btw, building 64bit cross-compiler, works...
Last edited by stdcall on Fri Mar 15, 2013 2:09 am, edited 1 time in total.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Creating cross-compiler fails

Post by iansjack »

Offhand, it sounds as if you are using the 32-bit version of binutils that you have created. Are you following the exact instructions in the Wiki, and what is your PATH?
stdcall
Member
Member
Posts: 78
Joined: Thu Mar 14, 2013 1:30 am

Re: Creating cross-compiler fails

Post by stdcall »

Hey, I'm following the exact instructions in the Wiki.
The $PATH is
/home/gombotz/bin:./:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/gombotz/bin:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/bin:/home/gombotz/bin:/usr/lib/wine/bin:/sbin:/usr/sbin:/usr/local/cross/bin

I don't understand, the gcc is supposed to be built with my distribution binutils, or the one I created in the previous step ?
I'm quite sure that the distribution binutils is used.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Creating cross-compiler fails

Post by Combuster »

Ooh, fun! - I can drop a fake "ls" binary in some random folder and if you happen to be in that folder when you call ls I can spoof the output. :wink:
Oh wait, you already have a fake gcc.


Bottom line: you path is seriously broken, and it probably was before you even started with that tutorial by the looks of it.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Creating cross-compiler fails

Post by iansjack »

Well, you've certainly given yourself a lot of latitude for error with that PATH. You have far too many entries in there for comfort, far too many places where a rogue file can hide. And take that ./ entry out; that means that you can run an executable from any directory in the system without even think if that's what you want to do.

But, on the face of it (and not being able to see your system I may be wrong) that PATH shouldn't cause your compile to fail. So what is the error message telling you:
Assembler messages:
Fatal error: no compiled in support for x86_64
Your compiler is creating assembler code that your assembler can't handle (and it looks like it's saying it can't assemble 64-bit code). How can that be? That just shouldn't happen. How has your compiler ever worked?

My best guess is that you made a mistake somewhere, possibly with the PREFIX, and have installed your binutils somewhere in your PATH earlier than "bin". "/usr/local/bin" perhaps? Worst scenario is that you have overwritten your installed binutils with the newly compiled ones. (It happens - I've done something very similar very recently.) If that's the case then you have a little work to do to get your compiler working again.

Check every directory in your PATH for an "as", and check which version it is.
stdcall
Member
Member
Posts: 78
Joined: Thu Mar 14, 2013 1:30 am

Re: Creating cross-compiler fails

Post by stdcall »

The path is not the issue, here's why. can you think of anything else ?

Code: Select all

$ which as
/usr/bin/as

Code: Select all

$ as --version
GNU assembler (GNU Binutils for Ubuntu) 2.22
Copyright 2011 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `x86_64-linux-gnu'.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: Creating cross-compiler fails

Post by dozniak »

mellowcandle wrote:The path is not the issue, here's why. can you think of anything else
List of exact commands you've ran would be nice.
Since the bug is happening on _your_ machine its you who should be thinging of "anything else" and more.
Learn to read.
stdcall
Member
Member
Posts: 78
Joined: Thu Mar 14, 2013 1:30 am

Re: Creating cross-compiler fails

Post by stdcall »

OK, issue solved, I've been too hasty deciding that the path is not the issue.
but once I cleared the path, it worked.
Sorry for the trouble I'm new here, so if there's a way to mark this as solved, it will be much appriciated.
Thanks.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS
Post Reply