OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Apr 23, 2017 7:53 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Tue Sep 20, 2016 9:51 am 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 244
Location: East Riding of Yorkshire, UK
~ wrote:
Octocontrabass wrote:
~ wrote:
The only things I wonder about is why you say that the C library cannot be reimplemented,

I didn't say anything about the C standard library, just libgcc. You can't reimplement libgcc because it's not a standard library, it's a piece of GCC.

~ wrote:
and where is MAKE in this cross toolchain?

Make isn't part of the toolchain.
Is then a potential OS made solely with the programming specifications from OSDev.org wiki and forum to be compiled only with standard commands and LD scripts at most?


yes, make only makes calls to the compiler/linker and there's nothing stopping you calling these programs by yourself.

_________________
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Wiki
Compiler Development Forum


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Tue Sep 20, 2016 12:56 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 870
zenzizenzicube wrote:
~ wrote:
Is then a potential OS made solely with the programming specifications from OSDev.org wiki and forum to be compiled only with standard commands and LD scripts at most?


yes, make only makes calls to the compiler/linker and there's nothing stopping you calling these programs by yourself.
I made a video showing how to build a cross-MAKE for i686-elf anyway:
http://www.youtube.com/watch?v=RguhUpFy6zs

Code:
export PATH="$HOME/opt/cross/bin:$PATH"
cd ..
mkdir build-make
cd build-make
../make-4.2/configure --target=$TARGET --prefix="$PREFIX" --program-prefix="i686-elf-" --disable-nls
make
make install





But why aren't until now instructions in the wiki to add MAKE to the cross-toolchain?

_________________
Image http://www.archefire.org/_PROJECTS_/

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

If my website doesn't work, please reload until the webpages can display. My server is really slow.


Last edited by ~ on Tue Sep 20, 2016 1:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Tue Sep 20, 2016 1:24 pm 
Offline
Member
Member
User avatar

Joined: Thu Mar 27, 2014 3:57 am
Posts: 556
Location: Moscow, Russia
You need Make to build GCC, therefore you already have it.

_________________
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Tue Sep 20, 2016 1:34 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 244
Location: East Riding of Yorkshire, UK
~ wrote:
zenzizenzicube wrote:
~ wrote:
Is then a potential OS made solely with the programming specifications from OSDev.org wiki and forum to be compiled only with standard commands and LD scripts at most?


yes, make only makes calls to the compiler/linker and there's nothing stopping you calling these programs by yourself.
I made a video showing how to build a cross-MAKE for i686-elf anyway:
http://www.youtube.com/watch?v=RguhUpFy6zs

Code:
export PATH="$HOME/opt/cross/bin:$PATH"
cd ..
mkdir build-make
../make-4.2/configure --target=$TARGET --prefix="$PREFIX" --program-prefix="i686-elf-" --disable-nls
make
make install





But why aren't until now instructions in the wiki to add MAKE to the cross-toolchain?


You don't need a "cross make". Make doesn't generate any binaries or compile any code, it just calls other software on your computer.

_________________
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Wiki
Compiler Development Forum


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Tue Sep 20, 2016 1:43 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 870
Roman wrote:
You need Make to build GCC, therefore you already have it.
Unless probably we want to use a newer and fresh MAKE version for our project or flags that the new MAKE has, or probably a MAKE that is supposed to use our cross-toolchain (although that is supposed to be directed by environment variables).

For some reason I think that using a cross-MAKE or all existing tools as cross versions for i686-elf or for other specific targets makes me feel better, as if it was cleaner and more private, as if I could use the newest binaries available that will always be fresh whenever I want to compile my actual project.

At that massive level, it's probably actually cleaner, more stable, portable and more scalable.

It just makes me feel better.

_________________
Image http://www.archefire.org/_PROJECTS_/

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

If my website doesn't work, please reload until the webpages can display. My server is really slow.


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Wed Sep 21, 2016 6:13 am 
Offline

Joined: Mon Aug 29, 2016 12:33 pm
Posts: 7
The only reason to possibly build a "cross make" would be for it to run on the built os itself. A "i686-elf-make" is incapable of running on the build host and thus unusable to cross compile stuff^^


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Wed Sep 21, 2016 2:02 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 870
Another question is, how to enable ALL object file formats (COFF, ELF, PE, raw binary) and ALL target platforms (i386-elf, i386-pe, i686-elf, i686-pe, i486-elf, i486-pe, x86_64 or any other specific one), so that we can then tell the compiler with flags which sort of executable to produce with a single cross toolchain with all targets enabled? The default GCC feels handicapped and nonportable without all those options enabled to be used.

But isn't an i686-elf cross tool supposed to be a native binary that will produce binaries for another architecture potentially different from the one we are currently using?

If it doesn't matter that MAKE is built like a cross tool, then which are the tools that depend on a specific target architecture?

The only platform-dependent tools I know are:
LD
AS
GCC
G++


Platform-independent tools in the sense that they don't need to target a specific architecture would then be:
MAKE
M4
sed

_________________
Image http://www.archefire.org/_PROJECTS_/

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

If my website doesn't work, please reload until the webpages can display. My server is really slow.


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Wed Sep 21, 2016 3:21 pm 
Offline

Joined: Mon Aug 29, 2016 12:33 pm
Posts: 7
gcc and binutils have a clear prefix per toolchain, so for all the targets you'd each need a toolchain. And for PE you'd need another set of mingw gcc's too.
If you need a compiler that can produce object files for all kinds of targets you might want to take a look at clang, it does what i suppose you want to do.
Though tbh i still got no idea what you plan on doing, i just do not comprehend it.


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Wed Sep 21, 2016 6:54 pm 
Offline
Member
Member
User avatar

Joined: Tue Mar 06, 2007 11:17 am
Posts: 870
I would like a compiler/toolchain that can produce binaries for any target as requested with flags instead of having separate toolchains.

As is, it seems that GCC is actually a front-end for many different compiler, assembler and linker packages supplying each target architecture, so that would explain why the toolchain can only produce a single type of output, they are actually different packages.

If a GCC installation could produce more than one type of output, it would mean that there is a generic front-end managing the invocation of architecture-specific compilers/assemblers/toolchains.

_________________
Image http://www.archefire.org/_PROJECTS_/

YouTube Development Videos:
http://www.youtube.com/user/AltComp126/videos

If my website doesn't work, please reload until the webpages can display. My server is really slow.


Top
 Profile  
 
 Post subject: Re: Expected errors while building a cross compiler
PostPosted: Sat Oct 22, 2016 3:56 am 
Offline
Member
Member

Joined: Tue Oct 04, 2011 2:29 pm
Posts: 40
Location: Caen, France
~ wrote:
I would like a compiler/toolchain that can produce binaries for any target as requested with flags instead of having separate toolchains.

As is, it seems that GCC is actually a front-end for many different compiler, assembler and linker packages supplying each target architecture, so that would explain why the toolchain can only produce a single type of output, they are actually different packages.

If a GCC installation could produce more than one type of output, it would mean that there is a generic front-end managing the invocation of architecture-specific compilers/assemblers/toolchains.


Then try CLang / LLVM, it may not fulfill all your needs, but it might be a good start

_________________
Less Is More - M. Van Der Rohe


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group