gcc-cross compile error

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
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

gcc-cross compile error

Post by xDDunce »

hiya,

i recently ran into a problem with my code, and upon searching through the forums, i found the solution was a cross compiler. so i set off trying to make a cross compiler (AGAIN!!!) and all was fine. until i reached the configuration of the gcc package.

i am following the wiki tutorial for the cross compiler, and the first section (binutils) went perfect. all things compiled and configured fine. but then upon running the gcc configuration file, i get the following error:

Code: Select all

../gcc-4.2.4/configure: line 7498: cmp: command not found
a little research i did shows that it is a file comparison program. what i dont understand is how there is no cmp program in the cygwin application. is there a cmp.exe program for the cygwin shell?(hidden in the depths of teh interweb) or am i doomed? im currently searching through the cygwin install package to see if there is anything there.

i have seen so many people say "oh yes, it compiled fine for me in cygwin under windows!" but so far i see no evidence.

thanks in advance!

James.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

ok, 1 error down :D

gcc now configures fine, but does not compile. i run "make all-gcc" and get this error message:

Code: Select all

../../gcc-4.2.4/gcc/cp/Make-lang.in: 179: *** target pattern contains no '%' Stop.
as far as i can see, the only way to fix that is to edit the make file itself :(
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

all sorted... i migrated to Mac OS X for my environment! simple :P
GlassX
Posts: 3
Joined: Mon Jan 19, 2009 1:39 pm

Re: gcc-cross compile error

Post by GlassX »

That's what I'm about to do... I can't do anything in Cygwin either... Thank god I have a MacBook.

Did you used the instructions on the wiki page? Hope it works for me :(
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

i havent finished migrating yet. i have my cross compiler set up. it worked first time. just followed the wiki tutorial for making the cross compiler. but now i need to replace the current gcc with my cross compiler, but cant figure out how :( havent spent much time on it though to be honest. been getting my website on the go :D

if you manage to migrate successfully, please let me know? so i have someone to fall back on :lol: lol!

cheers!

James.
GlassX
Posts: 3
Joined: Mon Jan 19, 2009 1:39 pm

Re: gcc-cross compile error

Post by GlassX »

Newsflash... After a few hours, the built-in GCC compiler still "can't compile executables".

Edit: Apparently there's a bug on the Xcode installer. I had to reinstall it because, sometimes, some libraries aren't copied properly...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: gcc-cross compile error

Post by Solar »

Those errors are actually new to me... and no, it doesn't have anything to do with Cygwin, actually the Tutorial was written for Cygwin and generalized only later.

Right now I don't have the time to try to reproduce your errors, but:
xDDunce wrote:but now i need to replace the current gcc with my cross compiler, but cant figure out how :(
GCC Cross-Compiler#Usage
Every good solution is obvious once you've found it.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

thanks solar, but that doesnt work. if i do that, then every time i run gcc from the terminal then it runs the xcode gcc. also if i use the -b or -V options, i get an error saying either: -b must come at beginning of command (for -b) and for -V it tries to run some imaginary binary from where the xcode gcc tools are installed. if i use both then i just get the -b error again.

so god damn confused :(
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: gcc-cross compile error

Post by Solar »

Erm...

The wiki says to add /usr/cross/bin to your PATH. That directory should contain files named [TARGET]-gcc, [TARGET]-as etc, with [TARGET] being i586-pc-elf or somesuch.

"gcc" should still invoke /usr/bin/gcc, since there is no "gcc" in /usr/cross/bin. Not the last dozen times I tried...
Every good solution is obvious once you've found it.
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

well i just spent half hour trying to work it out, and i got it running :D but... my source doesn't compile because it cannot see my include files for some strange reason.

im running a bash script call compile.sh:

Code: Select all

#!/bin/sh
# # # # # # # # # # # # # # # # # # # # #
i586-elf-gcc -o main.o    -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/main.cpp'    -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o video.o   -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/video.cpp'   -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o sys.o     -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/system.cpp'  -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o kernel.o  -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/kernel.cpp'  -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o globals.o -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/globals.cpp' -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o stdlib.o  -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/stdlib.cpp'  -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o GDTC.o    -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/GDT.cpp'     -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o IDTC.o    -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/IDT.cpp'     -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -o ISR.o     -c '/Volumes/SOURCES/XD-OS/source/version 0.0.03/CPP/ISR.cpp'     -ffreestanding -nostdlib -fno-builtin -fno-rtti -fno-exceptions -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
i586-elf-gcc -nostdlib -nostdinc -fno-builtin -fno-stack-protector -c -o support.o '/Volumes/SOURCES/XD-OS/source/version 0.0.03/C/standard.c' -I '/Volumes/SOURCES/XD-OS/source/version 0.0.03/includes'
nasm -f elf -o boot.o '/Volumes/SOURCES/XD-OS/source/version 0.0.03/ASM/main.asm'
nasm -f elf -o GDTasm.o '/Volumes/SOURCES/XD-OS/source/version 0.0.03/ASM/GDT.asm'
nasm -f elf -o IDTasm.o '/Volumes/SOURCES/XD-OS/source/version 0.0.03/ASM/IDT.asm'
ld -T link.ld -o '/Volumes/SOURCES/XD-OS/source/version 0.0.03/cd/kernel.sys'
i have set up PATH by calling export PATH= etc. etc... and all of these commands return the same errors. they run, but they cannot find any of my includes, despite me giving them the FULL PATH to their location. what is going wrong??
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: gcc-cross compile error

Post by Combuster »

have you checked that that directory actually exists?
"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
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

yes, i am sure the directory exists. i've been staring at it for the past few days...

i'm now regretting my choice of converting to C++ :( :lol:
User avatar
xDDunce
Member
Member
Posts: 173
Joined: Tue Aug 12, 2008 4:04 pm
Contact:

Re: gcc-cross compile error

Post by xDDunce »

ok, so im almost finished. i have gcc working, but whenever i run nasm it claims not to be able to find the file... is there a way to pause the bash execution like in windows batch files? i think it's trying to do everything faster than the USB controller can keep up with (keeping my OS on a usb stick so i never leave it behind and can work on it around college).
Post Reply