porting BASH, GCC, and glibc

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.
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

porting BASH, GCC, and glibc

Post by GLneo »

I'm am not currently at the point where i can port these, but I would like to know what I will need to do so, like what system calls?

and for a c lib, I've ported most of the PDlibc ( except malloc... ), and now I need more ( like math ), so I downloaded the current glibc, but i have yet to find were the work is actually done ( every math function just links to another function or says not implemented ), so does any one know of a simple libc?

thx!
jnc100
Member
Member
Posts: 775
Joined: Mon Apr 09, 2007 12:10 pm
Location: London, UK
Contact:

Post by jnc100 »

Newlib has been discussed several times.

Regards,
John
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

thanks, I'm working on it!, but where can i download the i586-elf compiler? didn't someone host that port?

EDIT: never mind i think i found it :P
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

You download gcc, run

Code: Select all

./configure --target=i586-elf --prefix=/usr/cross/
make
sudo make install
I gave porting glibc a shot, and gave up - it's immensely complicated and I couldn't get it to compile. Newlib is the way forward.

JamesM
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

well, now I'm having trouble compiling newlib, does any one have a precompiled binary that i could just link with my OS's "gluecode"?

thx!
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

I do... but it probably won't work. Best idea is to get the bugger compiling properly.

I had problems with the autoconfigure system newlib employs. I hacked it a little - made a subdirectory in libc/sys/ and symlinked all my stuff there. Works a treat! you have to edit the configure.host and config.sub files as well, to recognise your OS string (e.g. i386-pc-jimix)

JamesM
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

could you please elaborate on the details of what your are saying?, I get errors like "assembler garbage at end of assembly, unrecognized letter is 'a'", or something...
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Sounds like it's trying to assemble a non-assembly file... You need to be more specific with your error messages.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

GLneo wrote:could you please elaborate on the details of what your are saying?, I get errors like "assembler garbage at end of assembly, unrecognized letter is 'a'", or something...
You might also want to say what compiler version and target you are using.
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

this is the error [ attached ]

p.s. I'm targeting i686-elf and compiling with latest cygwin gcc


maybe my i686-elf-gcc is bad, does anyone know where that compiler is hosted?
Attachments
newlib.JPG
newlib.JPG (71.36 KiB) Viewed 3856 times
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

Also you should make sure that if you are using Cygwin(it looks like you are) that you are in binary mode. I had a bunch of problems compiling a cross compiler that were solved just by switching to binary mode.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Attachment gone? I don't see it...
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:

Post by Combuster »

if you would please not filter the command lines, we can make more sense of where it happens.

You can btw use the copy feature from the commandline window. That way you don't have to make screenshots.
"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 ]
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

my command window doesn't let me copy paste for some reason, if you want to see out2.txt it's attached.
Attachments
out2.txt
(31.29 KiB) Downloaded 143 times
Post Reply