Expected errors while building a cross compiler

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: Expected errors while building a cross compiler

Post by matt11235 »

~ 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 Forum
User avatar
~
Member
Member
Posts: 1227
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Expected errors while building a cross compiler

Post by ~ »

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: Select all

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?
Last edited by ~ on Tue Sep 20, 2016 1:34 pm, edited 1 time in total.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: Expected errors while building a cross compiler

Post by Roman »

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
User avatar
matt11235
Member
Member
Posts: 286
Joined: Tue Aug 02, 2016 1:52 pm
Location: East Riding of Yorkshire, UK

Re: Expected errors while building a cross compiler

Post by matt11235 »

~ 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: Select all

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 Forum
User avatar
~
Member
Member
Posts: 1227
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Expected errors while building a cross compiler

Post by ~ »

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.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
Lowl3v3l
Posts: 8
Joined: Mon Aug 29, 2016 12:33 pm
Libera.chat IRC: Lowl3v3l

Re: Expected errors while building a cross compiler

Post by Lowl3v3l »

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^^
User avatar
~
Member
Member
Posts: 1227
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Expected errors while building a cross compiler

Post by ~ »

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
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
Lowl3v3l
Posts: 8
Joined: Mon Aug 29, 2016 12:33 pm
Libera.chat IRC: Lowl3v3l

Re: Expected errors while building a cross compiler

Post by Lowl3v3l »

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.
User avatar
~
Member
Member
Posts: 1227
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Expected errors while building a cross compiler

Post by ~ »

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.
YouTube:
http://youtube.com/@AltComp126

My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
Post Reply