caltry / cross-tools Goto Github PK
View Code? Open in Web Editor NEWA makefile for producing a cross-platfrom OS dev environment.
A makefile for producing a cross-platfrom OS dev environment.
cross-tools makes setting up a new cross compiler for barebones OS development easier. A safe set of configuration options has been chosen for each of the program that you need for building for your target platform. By default, (i.e., just running 'make'), it will install: * GNU Binutils * GCC (C language only) * GDB The default target host triple is arm-none-eabi. You can change this target by setting the TARGET variable for make: make [target] TARGET=mipsel You can install the tools for multiple host targets by running 'make clean' in between each target. The tools for each target will all be installed along side each-other. The default installation location is $PWD/local-prefix. You can change the installation location by setting the PREFIX variable for make: make [target] PREFIX=/usr/local
I should have separate fetch and extract targets. It can be a real pain to fix a build error if we keep re-extracting gcc and friends.
When cross compiling GCC while the current directory is in the PATH variable, compilation fails with the error message:
checking for i686-pc-linux-gnu-gcc... (cached) gcc
checking for C compiler default output file name...
configure: error: in `/tmp/dcl9934/cross-tools/build-gcc/gcc':
configure: error: C compiler cannot create executables
See `config.log' for more details.
If you go to compile gcc manually, you'll see a more useful message:
$ rm -rf build-gcc && mkdir build-gcc
$ cd build-gcc
$ ../gcc-4.7.2/configure --target=arm-none-eabi --prefix=/tmp/dcl9934/cross-tools/local-prefix --enable-languages=c --without-headers
$ make
gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../gcc-4.7.2/gcc -I../../gcc-4.7.2/gcc/build -I../../gcc-4.7.2/gcc/../include -I../../gcc-4.7.2/gcc/../libcpp/include -I../../gcc-4.7.2/gcc/../libdecnumber -I../../gcc-4.7.2/gcc/../libdecnumber/dpd -I../libdecnumber \
-o build/genconstants.o ../../gcc-4.7.2/gcc/genconstants.c
/tmp/dcl9934/cross-tools/local-prefix/arm-none-eabi/bin/as: unrecognized option '--32'
This problem here is that GCC creates a symlink to the 'as' for the target platform, and puts it in the build-gcc/gcc directory. So, when we try to compile something for the host, we end up using the target's 'as' instead!
gcc$ which as
./as
gcc$ as --verbose
GNU assembler version 2.23.1 (arm-none-eabi) using BFD version (GNU Binutils) 2.23.1
Either the user need to remove '.' from their path, or we should remove it from the environment when we build GCC by submake.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.