-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cross compiler, added automated cross compiler build script. Closes #67 #320
Open
Barteks2x
wants to merge
4
commits into
raphydaphy:master
Choose a base branch
from
Barteks2x:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,4 @@ kernel/o/ | |
*.swp | ||
*.d | ||
genInitrd/make_initrd | ||
cross/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
To compile Q-OS you need to compile a cross compiler. | ||
|
||
Needed packages | ||
--------------- | ||
|
||
gcc 5.x | ||
g++ 5.x | ||
GNU Make | ||
GNU Bison | ||
Flex | ||
Texinfo | ||
ISL (optional) | ||
CLooG (optional) | ||
|
||
For Mac users: | ||
If you use OS X 10.7 or older you need to install gcc and do this: | ||
|
||
# This is only necessary for OS X users running 10.7 or below. | ||
export CC=/usr/bin/gcc-5.X | ||
export CXX=/usr/bin/g++-5.X | ||
export CPP=/usr/bin/cpp-5.X | ||
export LD=/usr/bin/gcc-5.X | ||
|
||
note: don't make these permanent | ||
|
||
Installing | ||
---------- | ||
Run build_cross_compiler.sh script. | ||
After it's finished run: | ||
|
||
. ./set_path.sh | ||
|
||
Note: you need to do that every time you start new console sessioi. Or permanently change your $PATH. | ||
|
||
Compiling Q-OS | ||
-------------- | ||
To compile: | ||
|
||
make | ||
|
||
To compile and run: | ||
|
||
make qemu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/bin/sh | ||
|
||
mkdir cross | ||
cd cross | ||
|
||
export PREFIX="$(pwd)" | ||
export TARGET="i686-elf" | ||
export PATH="$PREFIX/bin:$PATH" | ||
|
||
echo $PREFIX $TARGET $PATH | ||
|
||
BINUTILS_VER="binutils-2.25.1" | ||
wget http://ftp.gnu.org/gnu/binutils/$BINUTILS_VER.tar.bz2 | ||
tar -xvf $BINUTILS_VER.tar.bz2 | ||
mkdir build-binutils | ||
cd build-binutils | ||
../$BINUTILS_VER/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror | ||
make -j4 | ||
make install | ||
cd .. | ||
|
||
GMP_VER="gmp-6.1.0" | ||
MPFR_VER="mpfr-3.1.3" | ||
MPC_VER="mpc-1.0.3" | ||
GCC_VER="gcc-5.3.0" | ||
#prepare GCC for installation | ||
wget https://gmplib.org/download/gmp/$GMP_VER.tar.lz | ||
wget http://www.mpfr.org/mpfr-current/$MPFR_VER.tar.gz | ||
wget ftp://ftp.gnu.org/gnu/mpc/$MPC_VER.tar.gz | ||
tar --lzip -xvf $GMP_VER.tar.lz | ||
tar -xvf $MPFR_VER.tar.gz | ||
tar -xvf $MPC_VER.tar.gz | ||
wget ftp://ftp.gnu.org/gnu/gcc/gcc-5.3.0/$GCC_VER.tar.gz | ||
tar -xvf $GCC_VER.tar.gz | ||
mv $GMP_VER $GCC_VER/gmp | ||
mv $MPFR_VER $GCC_VER/mpfr | ||
mv $MPC_VER $GCC_VER/mpc | ||
|
||
which -- $TARGET-as || echo $TARGET-as is not in the PATH | ||
|
||
mkdir build-gcc | ||
cd build-gcc | ||
../$GCC_VER/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers | ||
make -j4 all-gcc | ||
make -j4 all-target-libgcc | ||
make install-gcc | ||
make install-target-libgcc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
contains() { | ||
string="$1" | ||
substring="$2" | ||
if test "${string#*$substring}" != "$string" | ||
then | ||
return 0 # $substring is in $string | ||
else | ||
return 1 # $substring is not in $string | ||
fi | ||
} | ||
|
||
cd cross | ||
export PREFIX="$(pwd)" | ||
export TARGET="i686-elf" | ||
export ADD_PATH="$PREFIX/bin" | ||
if ! contains $PATH $ADD_PATH | ||
then | ||
export PATH="$ADD_PATH:$PATH" | ||
echo "PATH set to $PATH" | ||
else | ||
echo "Path already set" | ||
fi | ||
cd .. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, typo.