getting toolchain to be used
David Holmes
david.holmes at oracle.com
Wed May 3 04:07:11 UTC 2017
Hi Xen,
On 3/05/2017 7:09 AM, Xen wrote:
> I understand that the build environment has changed since 1.7 but I am
> trying to build 1.7 for an older Synology device.
The info below indicates you are trying to build for ARMv5. There is no
native build for ARMv5 so I assume you are trying to cross-compile
For cross compilation you should need to set the following only:
ARCH arm
ALT_COMPILER_PATH <path to your toolchain>
ALT_OPENWIN_HOME <path to X11R6 in your toolchain>
CROSS_COMPILE_ARCH arm
EXTRA_CFLAGS <this is where you set things like -march=armv5e -marm>
the local toolchain will be used for things that need to be compiled and
executed locally as part of the build. HOST_CC should take care of that.
> I first succeeded in building it using OE but since the compiler and/or
Out of curiosity what is OE?
David
-----
> libc used was too high for the platform I am now trying to do it using
> the platform's toolchain.
>
> Unfortunately it seems it is using my own host g++ instead of the
> toolchain g++ when it ought to be using that one.
>
> I have copied many options from those used by OE. The biggest difference
> is that I am either using an older toolchain or I am not using -e.
>
> But when currently I use -e it fails immediately due to probably some
> variables being unset.
>
> What is the best way to ensure it is using my proper toolchain?
>
> here are some of the values I have defined:
>
> export ALT_OBJCOPY=${TOOLDIR}/${prefix}objcopy
> export ALT_STRIP=${TOOLDIR}/${prefix}strip
> export ALT_CPP=${TOOLDIR}/${prefix}cpp
> export ALT_GCC="${TOOLDIR}/${prefix}gcc -march=armv5e -marm
> --sysroot=$SYSROOT"
> export ALT_LD="$ALT_GCC"
> export ALT_CXX="${TOOLDIR}/${prefix}g++ -march=armv5e -marm
> --sysroot=$SYSROOT"
> export ALT_CPP_FLAGS=-lstdc++
> export ALT_CXX_FLAGS=-lstdc++
> export BUILD_CC="$ALT_GCC"
> export BUILD_LD="$ALT_GCC"
> export BUILD_GCC="$ALT_GCC"
> export BUILD_CXX="$ALT_CXX"
> export HOST_CC=gcc
> export CC_FOR_BUILD=$HOST_CC
>
> with TOOLDIR being something like arm-none-linux-gnueabi/bin
> and prefix being arm-none-linux-gnueabi-
>
> The point is that it first gives some hpp errors with ints not being
> long ints, and then later an error referencing a crt1.o file on my main
> system.
>
> which clearly indicates that my main g++ is being used.
>
> I am using the same bootstrap as OE, which is 1.6.0.
>
> I am not using the same PATH although that wouldn't matter in this sense
> I believe.
>
> This is because the "hosttools" are also in the path, just last.
>
> And their directory of "native" tools doesn't contain any compilers.
>
> So everything seems to be quite equivalent.
>
> I added variables CC and CCC and CXX to that list now...
>
> Now it does do something different! And appears to halt on conversion
> errors (float to double, int to long, int to float, ...)
>
> and I can't get it to honour any compiler flags...
>
> Well with these changed CC/CCC/CXX values it just outputs more warnings,
> ultimately I got the same errors, I fixed the first ones, now I get again.
>
> I used the wrong LD...
>
> But it's still not using my own g++. Help?
More information about the build-dev
mailing list