- Thu Oct 02, 2014 7:25 am
#1111
jcmvbkbc wrote:Build crosstool-NG:
$ ./bootstrap && ./configure --prefix=`pwd` && make && make install
Configure it for lx106:
$ ./ct-ng xtensa-lx106-elf
And build the toolchain:
$ ./ct-ng build
Great! That's neat.
I had to make a few changes to get it working though.
First, 'custom_config' variable in scripts/arc/xtensa.sh was not defined, changed that to custom_overlay:
Code: Select alldiff --git a/scripts/build/arch/xtensa.sh b/scripts/build/arch/xtensa.sh
index e4adae8..7e49312 100644
--- a/scripts/build/arch/xtensa.sh
+++ b/scripts/build/arch/xtensa.sh
@@ -51,9 +51,9 @@ CT_ConfigureXtensa() {
CT_Abort
fi
- CT_DoLog EXTRA "Using '${custom_config}' from ${custom_location}"
- CT_DoExecLog DEBUG ln -sf "${custom_location}/${custom_config}" \
- "${CT_TARBALLS_DIR}/${custom_config}"
+ CT_DoLog EXTRA "Using '${custom_overlay}' from ${custom_location}"
+ CT_DoExecLog DEBUG ln -sf "${custom_location}/${custom_overlay}" \
+ "${CT_TARBALLS_DIR}/${custom_overlay}"
CT_DoExecLog DEBUG touch "${CT_SRC_DIR}/.${basename}.configuring"
Next, some notes for those on a Mac.
- Create a case-sensitive filesystem image and mount it somewhere before cloning crosstool-NG:
$ hdiutil create -size 10g -fs "Case-sensitive HFS+" -volname ESPTools ESPTools.sparsebundle
$ hdiutil attach ESPTools.sparsebundle
$ ln -s /Volumes/ESPTools/ esptools - Install gcc 4.9. I use macports, homebrew should also work. Note that you may also need to install other packages, I might have had them installed already. If you use macports, don't forget to set the default gcc:
$ sudo port select gcc mp-gcc49 - When running configure, encourage it to pick the GNU version of grep (which also has to be installed via macports/homebrew):
grep=/opt/local/bin/grep ./configure --prefix=`pwd` - Before doing ct-ng build, run menuconfig ($ ./ct-ng menuconfig), go into "C compiler" and disable "Link libstdc++ statically into the gcc binary". Otherwise crosstool-NG will feed '-static' option to gcc, but on OS X gcc doesn't have it.
Hope that helps someone.