This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more information.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
bare-metal libraries, including C++.
What are you calling "bare-metal libraries"?
"Bare-metal" (in my understanding) refer to a toolchain that targets no "system". Generaly, you'd use a bare-metal compiler to build whatever runs on the bare-metal, without any underlying kernel of any sort.
C++ is certainly not available on bare-metal!
That's wrong. Just as with C, some parts of the standard libraries may have dependencies on the OS, but the base language itself is readily usable on "bare-metal" ... I do it frequently.
However, there's no need to use crosstool of any flavor to build a bare-metal toolchain. I use binutils, GCC and newlib to build cross bare metal toolchains.
I've attached a script that I use to build C/C++ for a mips-elf target. It's nothing fancy (it doesn't download the pieces for you), but I think you can get the jist of building using this script. Just adjust the version numbers to suit your tastes. :)
-- Michael N. Moran (h) 770 516 7918 5009 Old Field Ct. (c) 678 521 5460 Kennesaw, GA, USA 30144 http://mnmoran.org
"So often times it happens, that we live our lives in chains and we never even know we have the key." "Already Gone" by Jack Tempchin (recorded by The Eagles)
#!/bin/bash # Note: need to set PATH to point at binutils mips-elf/bin rm -f ../gcc-4.1.1/newlib ln -s ../../../newlib/1.14.0/newlib-1.14.0/newlib ../gcc-4.1.1/newlib BINUTILS_PATH=/tools/gnu/gcc/4.1.1/mips-elf/bin export PATH=$BINUTILS_PATH:$PATH ../gcc-4.1.1/configure \ --target=mips-elf \ --prefix=/tools/gnu/gcc/4.1.1/mips-elf \ --disable-newlib-supplied-syscalls \ --enable-languages=c,c++ \ --disable-shared \ --disable-libssp \ --with-newlib #nice -n 19 make CFLAGS="-O2 -fomit-frame-pointer" 2>&1 | tee make.temp #nice -n 19 make CFLAGS="-O2 -fomit-frame-pointer" # # Since binutils showed a bug with -fomit-frame-pointer, # I'm going to forego that optimization. # nice -n 19 make CFLAGS="-O2" CFLAGS_FOR_TARGET="-G0" CXXFLAGS_FOR_TARGET="-G0" # AS_FOR_TARGET=${BINUTILS_PATH}/mips-elf-as \ # LD_FOR_TARGET=${BINUTILS_PATH}/mips-elf-ld \ # AR_FOR_TARGET=${BINUTILS_PATH}/mips-elf-ar \ # RANLIB_FOR_TARGET=${BINUTILS_PATH}/mips-elf-ranlib
-- For unsubscribe information see http://sourceware.org/lists.html#faq
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |