OS specific toolchain is failing to build binutils

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
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

OS specific toolchain is failing to build binutils

Post by heat »

Hey guys :D ,
I'm trying to compile an OS specific toolchain following the wiki's tutorial,but I am having a problem compiling binutils.

I am using:
Binutils 2.24
GCC 4.9.2

I am compiling the new toolchain using Cygwin x86-64 version.I have setup the build strictly from the wiki, multiple times.

I'm having a problem with making ld: ldemul.o:ldemul.c:(.data+0x0): undefined reference to `ld_elf_i386_spartanos_emulation'

Configured with:

Code: Select all

./binutils-2.24/configure --prefix=C:/i686-spartanos --target=i686-spartanos --with-sysroot=/cygdrive/c/Users/Pedro/SpartanOS/sysroot --disable-nls --disable-werror 2<&1 |tee binutils_configure.log
Note: Some parts of the log are a bit broken because i used make with the -j option.

Build Log

Code: Select all

http://pastebin.com/YMBd7Prp
Please help me because i am stuck in this for days. [-o<
Last edited by heat on Thu Apr 23, 2015 7:43 am, edited 1 time in total.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: OS specific toolchain is failing to build binutils

Post by iansjack »

You have to configure gcc to support your os: http://wiki.osdev.org/OS_Specific_Toolchain

If you are creating a cross-compiler to compile your OS (as opposed to one to run on your OS) just use one of the standard target triplets.
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: OS specific toolchain is failing to build binutils

Post by heat »

I have already followed the tutorial. My problem is in building successfully binutils. Also, shouldn't the OS specific toochain be to also build the OS?
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
kzinti
Member
Member
Posts: 898
Joined: Mon Feb 02, 2015 7:11 pm

Re: OS specific toolchain is failing to build binutils

Post by kzinti »

iansjack answered both of your questions. Read his reply again.
User avatar
iansjack
Member
Member
Posts: 4707
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: OS specific toolchain is failing to build binutils

Post by iansjack »

Judging from your previous posts, I do not believe that you are yet at the stage where you need to produce a C compiler that targets your OS, which is what you arle unsuccessfully trying to do. And, from your reply, I don't think that you even bothered to read the link I provided.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: OS specific toolchain is failing to build binutils

Post by xenos »

A few words of clarification, because this was apparently mixed up in the previous posts:
  • You normally start with a bare metal toolchain, which has a bare metal target such as i686-elf or x86_64-elf. This is used to compile your OS kernel, and you can use it to compile drivers and a basic C library as well.
  • Once you have a C library, either written yourself or ported, you can switch to an OS specific toolchain. This toolchain will be used to compile programs that run on your OS, i.e., it is targeted to your OS, so it will have a target of the form i686-youros or x86_64-youros. Once you have this, you can also use it to compile your OS kernel and libraries by explicitly telling it to not include any C libraries and stuff. Note that also this toolchain does not run on your OS, but targets your OS.
  • A toolchain that actually runs on your OS would require porting it to the OS, so you would have to compile binutils / gcc using the OS specific toolchain mentioned above.
So if you wish to compile an OS specific toolchain, you should be at step 2 right now. Otherwise, you should compile a bare metal toolchain.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
heat
Member
Member
Posts: 103
Joined: Sat Mar 28, 2015 11:23 am
Libera.chat IRC: heat

Re: OS specific toolchain is failing to build binutils

Post by heat »

So, basically you said i need to develop my kernel and implement standard C library (input,memory allocation,..) before I try to make an OS specific toolchain ?

Also, thanks for all the help orientating me to the right direction,I'm new in this OSDeving stuff.
And can you please help me to solve this error ? I want to know what caused the error and how to solve it, so I don't need to ask again.
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx
Post Reply