Cross compiler step one`
Cross compiler step one`
I am still a little confused on what gcc or binutils compilation options to build for the i686-elf target. I have 6.3 gcc and 2.27 binutils and I think they're the latest. I am in a linux x64 enviornment but bare bones wants i686-elf. I am considering,
--enable-multilib, i686-elf --disable-nls --without-headers
Now do I need -ffreestanding ?
I am not sure what that's for.
--enable-multilib, i686-elf --disable-nls --without-headers
Now do I need -ffreestanding ?
I am not sure what that's for.
Re: Cross compiler step one`
If you are building a crosscompiler for your kernel, you are not providing a standard C library and you are also not providing include headers (as you can see in your configure command). So you don't need to provide -ffreestanding.
osdev project, goal is to run wasm as userspace: https://github.com/kwast-os/kwast
Re: Cross compiler step one`
Ok so not providing the C library is what I want to do. What about this libgcc library. It's not a standard C library but you don't want it for kernel creation either do you?ndke wrote:If you are building a crosscompiler for your kernel, you are not providing a standard C library and you are also not providing include headers (as you can see in your configure command). So you don't need to provide -ffreestanding.
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: Cross compiler step one`
x86_64 kernel - don't forget
libgcc multilib --- http://wiki.osdev.org/Libgcc_without_red_zone
libgcc is almost required for kernel depending on what code you write... http://wiki.osdev.org/Libgcc
In my case, it was preferable to go the full distance for a full cross compiler with sysroot
http://wiki.osdev.org/OS_Specific_Toolchain
It worth learning the options for configuring binutils and gcc
Code: Select all
-mno-red-zone
libgcc is almost required for kernel depending on what code you write... http://wiki.osdev.org/Libgcc
In my case, it was preferable to go the full distance for a full cross compiler with sysroot
http://wiki.osdev.org/OS_Specific_Toolchain
It worth learning the options for configuring binutils and gcc
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: Cross compiler step one`
What do you mean "x86_64 kernel..." That is my host environment yeah but I want to build a 32 bit kernel for a 32 bit OS.dchapiesky wrote:x86_64 kernel - don't forget
libgcc multilib --- http://wiki.osdev.org/Libgcc_without_red_zoneCode: Select all
-mno-red-zone
libgcc is almost required for kernel depending on what code you write... http://wiki.osdev.org/Libgcc
In my case, it was preferable to go the full distance for a full cross compiler with sysroot
http://wiki.osdev.org/OS_Specific_Toolchain
It worth learning the options for configuring binutils and gcc
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: Cross compiler step one`
sorry - missed i686 -- but still full os specific compiler is worth it
Plagiarize. Plagiarize. Let not one line escape thine eyes...
-
- Member
- Posts: 283
- Joined: Mon Jan 03, 2011 6:58 pm
Re: Cross compiler step one`
Are you building a cross compiler to build your kernel? In which case see http://wiki.osdev.org/GCC_Cross-Compiler
If you are trying to build (on your host platform) a compiler that will compile programs to run on your OS, see http://wiki.osdev.org/OS_Specific_Toolchain
- Monk
If you are trying to build (on your host platform) a compiler that will compile programs to run on your OS, see http://wiki.osdev.org/OS_Specific_Toolchain
- Monk
Re: Cross compiler step one`
I made a video that shows how to compile a cross compiler for your custom OS kernel step by step.
If you watch it and repeat everything you see done to make the compile, or if you watch it and then repeat, then you will be able to understand how to build your cross compiler:
OSDev.org Tutorial: Build an i686-elf Cross Compiler under 64-bit Ubuntu Desktop 16.04.1
If you watch it and repeat everything you see done to make the compile, or if you watch it and then repeat, then you will be able to understand how to build your cross compiler:
OSDev.org Tutorial: Build an i686-elf Cross Compiler under 64-bit Ubuntu Desktop 16.04.1
YouTube:
http://youtube.com/@AltComp126
My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
http://youtube.com/@AltComp126
My x86 emulator/kernel project and software tools/documentation:
http://master.dl.sourceforge.net/projec ... ip?viasf=1
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: Cross compiler step one`
~ wrote:I made a video that shows how to compile a cross compiler for your custom OS kernel step by step.
4 hours 51 minutes... sounds about right... will let play while I work.... can we get a transcript
either way your effort is acknowledged and appreciated....
Now start work on x86_64, arm, ppc, sparc, and z80....
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: Cross compiler step one`
...of written and annotated instructions, where people get explanations of every twist and turn involved in the process, and turned it into a five-hour video of "watch the compiler output"?~ wrote:I made a video...
Unedited?
Every good solution is obvious once you've found it.
Re: Cross compiler step one`
Well, it's probably too slow machine; usually compiling full gnu toolchain fits into 1 hour, compiling LLVM into 1 hour and then some.Solar wrote:and turned it into a five-hour video of "watch the compiler output"?
Learn to read.
- dchapiesky
- Member
- Posts: 204
- Joined: Sun Dec 25, 2016 1:54 am
- Libera.chat IRC: dchapiesky
Re: Cross compiler step one`
3.2ghz 2 core I3 with hyperthreading does a gcc 6.3 bootstrap compiler/cross compiler/newlib/cross compiler w/sysroot in 25 minutes....
Plagiarize. Plagiarize. Let not one line escape thine eyes...
Re: Cross compiler step one`
I'm sure it should be faster than that? Are you passing j4 or j5 to make?dchapiesky wrote:3.2ghz 2 core I3 with hyperthreading does a gcc 6.3 bootstrap compiler/cross compiler/newlib/cross compiler w/sysroot in 25 minutes....
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum
Compiler Development Forum
Re: Cross compiler step one`
Well the makefile broke on me. I am using gcc-6.0.3. I build with my compiler this "isl" library, gmp, mpc, mpfr that gcc needs. The binaries I put together in a directory called 'build'. With the compiler it said no linking allowed after GCC_NO_EXECUTABLES so what's that mean. Is there a linker switch somewhere that needs turned off? I compiled with the 'configure' script these options,
--with-gmp=
--with-isl=
--with=mpc=
--with-mpfr=
To tell the compiler where they are. I also used,
--enable-languages=c --enable-multilib --without-headers --prefix=/mnt --disable-nls i686-elf
What have I left out or do I need?
--with-gmp=
--with-isl=
--with=mpc=
--with-mpfr=
To tell the compiler where they are. I also used,
--enable-languages=c --enable-multilib --without-headers --prefix=/mnt --disable-nls i686-elf
What have I left out or do I need?
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Cross compiler step one`
Let's dig a bit deeper here. Please start by telling us the development host environment - you have mentioned that it is an x86-64 CPU, but not the OS it is running under. If you could also post (or link to a repo of) the makefile and linker script, that would help as well.
Mind you, I mean the makefile and linker script for the cross-compiler build, not the one you would use for building the OS image from the cross-compiler. I have this suspicion that there is a bit of confusion there, in that it sounds as if your makefile is set to build an ELF32 file for the cross-compiler, which would not be the correct course of action if it is hosted on a 64-bit OS (and especially so if it is a host OS that doesn't use ELF as its executable format, such as Windows or MacOS). The cross-compiler might be set to target a 32-bit ELF, but the cross-compiler itself would run in the native executable format and bit width of the development host.
Mind you, I mean the makefile and linker script for the cross-compiler build, not the one you would use for building the OS image from the cross-compiler. I have this suspicion that there is a bit of confusion there, in that it sounds as if your makefile is set to build an ELF32 file for the cross-compiler, which would not be the correct course of action if it is hosted on a 64-bit OS (and especially so if it is a host OS that doesn't use ELF as its executable format, such as Windows or MacOS). The cross-compiler might be set to target a 32-bit ELF, but the cross-compiler itself would run in the native executable format and bit width of the development host.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.