I've tried using Openwrt toolchain itself as External toolchain by the
following procedure:-
# Compile and Install the toolchain in a different path
make tools/install;
make toolchain/install
TOOLCHAIN_DIR="/opt/sw_toolchains/toolchain-mips_r2_gcc-4.7-linaro_uClibc-0.9.33.2"

Used above path by setting the following macros:-
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mips32r2 -mtune=mips32r2
-funit-at-a-time -fno-caller-saves"
CONFIG_SOFT_FLOAT=y
CONFIG_EXTERNAL_TOOLCHAIN=y
# CONFIG_NATIVE_TOOLCHAIN is not set
CONFIG_TARGET_NAME="mips-openwrt-linux-uclibc"
CONFIG_TOOLCHAIN_PREFIX="mips-openwrt-linux-uclibc-"
CONFIG_TOOLCHAIN_ROOT="/opt/sw_toolchains/toolchain-mips_r2_gcc-4.7-linaro_uClibc-0.9.33.2"
CONFIG_TOOLCHAIN_BIN_PATH="./usr/bin ./bin"
CONFIG_TOOLCHAIN_INC_PATH="./usr/include ./include"
CONFIG_TOOLCHAIN_LIB_PATH="./usr/lib ./lib"

Above method works well. But, I have trouble with setting honour-copts. As
per rules.mk and include/kernel.mk, if we set an external toolchain, the
buildsystem will not pass honour-copts to userspace packages as well as
kernel packages.

But what if we use openwrt toolchain itself as external toolchain? How we
can set fhonour copts?

One way is to pass on CONFIG_TARGET_OPTIMIZATION like:-
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -mips32r2 -mtune=mips32r2
-funit-at-a-time -fno-caller-saves -fhonour-copts"

In this case, it works for userspace apps compilation. But not on kernel
compilation. And I cannot use the same config file if the toolchain is
built from scratch. Because the buildsystem will again add honour-copts and
it will be a added twice.

Is there a way to add additional config option on external toolchain like:
Use Openwrt toolchain = y ? So that we export honour-copts as default? In
this case even we can avoid configuring toolchain prefix, libpath, include
path etc. and keep only toolchain root as configurable field.
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to