Hi Ard,

Thanks for your help. I had attempted to do something similar before for klibc package. There were few hurdles 1. I could not increase the disk size of the foundation model (didn't know how to do that. Could not find anything on the manual) and I needed larger disk space to first compile linux headers. May be for gmp I will not need that. 2. I was having trouble accessing internet from inside the foundation model and was running into difficulties copying files into the model, i.e. I could mount my build machine files from inside the foundation model but not the other way round. I remember struggling with this for few days before I settled with having all the code sit on the build machine and mounting them from inside the foundation model. This worked fine for the klibc package. Now this gmp package simply takes too long to build natively on the foundation model, so i was doing cross compiling to aarch64 equivalent of the MPN primitive functions. But now that I am done with that I would like to test and debug the code, so need something faster.

I will still give what you suggested a try. If I don't succeed, may be I will have to simply find a faster server where the foundation model is faster. let me know if you have any other ideas.

Thanks and Regards,
Anil




On 13 November 2013 13:38, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
On 13 November 2013 07:41, Anil Singhar <anil.singhar@linaro.org> wrote:

> Thanks for your response. Here is the error I get when I do the "make check"
> step on the foundation model after having done the "configure" and "make"
> steps on the x86_64 linux build machine. I used the configure options you
> provided.
>
> 1. On x86_64 linux build machine:
> ---------------------------------------------------

[...]

> --------------------------------------------------
> 2. On Foundation Model I encounter the following errors when doing "make
> check"
> -------------------------------------------------
> root@genericarmv8:~/anilss/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64# make
> check
> make  check-recursive
> make[1]: Entering directory
> `/home/root/anilss/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64'
> Making check in tests
> make[2]: Entering directory
> `/home/root/anilss/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64/tests'
> Making check in .
> make[3]: Entering directory
> `/home/root/anilss/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64/tests'
> make  libtests.la t-bswap t-constants t-count_zeros t-gmpmax t-hightomask
> t-modlinv t-popc t-parity t-sub
> make[4]: Entering directory
> `/home/root/anilss/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64/tests'
> /bin/bash ../libtool --tag=CC   --mode=compile aarch64-linux-gnu-gcc
> -std=gnu99 -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -pedantic
> -fomit-frame-pointer -march=armv8-a -mtune=generic -c -o memory.lo memory.c
> libtool: compile:  aarch64-linux-gnu-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I..
> -I.. -O2 -pedantic -fomit-frame-pointer -march=armv8-a -mtune=generic -c
> memory.c  -fPIC -DPIC -o .libs/memory.o
> ../libtool: line 1128: aarch64-linux-gnu-gcc: command not found

Hello Anil,

Apparently, this package does not like to be configured and compiled
on one arch and then tested on another. And frankly, this is somewhat
of an exotic case, so I am not sure how representative your test
results are going to be.

I think there are two ways to address this:
- create symlinks with aarch64-linux-gnu- prefix linking to gcc, ld,
as etc on the model as required;
- do the build on the model using distcc, this way the actual
compilation work will be performed on your build machine but the
source and build trees would live inside the model (perhaps someone
else could confirm whether distcc needs elaborate support in the
project usually, but I don't think this is the case)

Regards,
Ard.



> On 12 November 2013 19:20, Wookey <wookey@wookware.org> wrote:
>>
>> +++ Anil Singhar [2013-11-12 18:44 +0530]:
>> >    Hi,
>> >
>> >    I am trying to cross compile a package wi the following steps.  The
>> > build
>> >    goes fine except that when I try to run the same on the foundation
>> > model
>> >    it doesn't work. Here are all the steps in details:
>> >
>> >    1. Installed the linaro gcc and set up the environment as follows:
>> >
>> > ------------------------------------------------------------------------------------------------
>> >    export
>> >
>> > AARCH64_TOOLCHAIN=/home/anilss/Linaro/tools/gcc-linaro-aarch64-linux-gnu-4.7-2013.04-20130415_linux/bin
>> >    export PATH=$PATH:$AARCH64_TOOLCHAIN
>> >    export ARCH=aarch64
>> >    export CROSS_COMPILE=aarch64-linux-gnu-
>> >
>> >    2. Now on my build machine (x86_64 machine running linux), from
>> > source
>> >    root of the package (i.e. GMP) I want to cross compile:
>> >
>> > anilss@anilss:~/Linaro/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64$./configure
>> >    --build=coreisbr-unknown-linux-gnu --host=aarch64-linux-gnu
>> >    --target=aarch64-linux-gnu
>> >    anilss@anilss:~/Linaro/pkgs/gmp/cross_arm64/gmp-5.1.3-aarch64$make
>> >
>> >    3. Then On the foundation model, where the above source tree is
>> > mounted, I
>> >    do:
>> >    $ make check
>> >
>> >    However this fails.
>>
>> You have to say _how_ it fails for anyone to have any chance of helping.
>>
>> >    Any ideas on what is going wrong..?
>> >    Also is the triplet correct for host and foundation model (running oe
>> >    linux)?
>>
>> Maybe. Not sure what a coreisbr-unknown-linux-gnu is.
>>
>> Here is a build log from an (ubuntu) gmp cross-build which might give some
>> clues:
>>
>> http://people.linaro.org/~wookey/buildd/quantal-arm64/sbuild-ma/gmp_2:5.0.2+dfsg-2ubuntu2arm64-quantal-bootstrap-arm64-20121117-234708.6930.log
>> where the configure line was:
>>  ../configure --prefix=/usr --enable-cxx --enable-fat --build
>> x86_64-linux-gnu --host aarch64-linux-gnu --target aarch64-linux-gnu
>> --libdir=/usr/lib/aarch64-linux-gnu \
>>         AR=aarch64-linux-gnu-ar CC="aarch64-linux-gnu-gcc" CFLAGS="-Wall
>> -g  -O3 -Wa,--defsym,USES_THUMB=1" \
>>         CXX="aarch64-linux-gnu-g++" CXXFLAGS=""
>>
>> There are probably some OE crossbuild logs online somewhere you could
>> compare with too, which would be more directly relevant.
>>
>> Wookey
>> --
>> Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
>> http://wookware.org/
>>
>> _______________________________________________
>> linaro-dev mailing list
>> linaro-dev@lists.linaro.org
>> http://lists.linaro.org/mailman/listinfo/linaro-dev
>
>
>
> _______________________________________________
> linaro-dev mailing list
> linaro-dev@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-dev
>