This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Trying to compile ubuntu 12.04 with Openswan for OMAP4 on ubutu12.04 64 Bit

I have to make IPSEC stack run on a self designed OMAP4 USB board with an alternative aes_generic.c and blowfish.c algos.
I want to check the same between two Pandabaord ES Rev B1 and subsequently on the actual board.
Now when on my system I start with compiling GMP for Openswan it gives me error on ./configure command.
./configure --host=arm-none-linux-gnueabi --prefix=/home/harsh/GMP/
configure: error: Oops, mp_limb_t is 64 bits, but the assembler code
in this configuration expects 32 bits.
Is there a consolidated document which can guide me compiling for various devices from scratch to end.

  • Hi Harsh,

    Can try  to unset the CFLAGS env variable?

    Regards,

    Boyko

  • Hi Boyko,


    Thanks for the prompt reply.


    I have already tried that.
    I would like to add here that I have exported the ARCH, CROSS_COMPILE AND TOOLCHAIN variables to bash_rc while compiling OS for the custom board. I hope that is not putting up any problem.

  • Hi,

    You need to tell the crosscompiler that your system is 64bit, Have you set any other arguments like CC, ABI ,xarch etc.

    (./configure ABI=32)

    Regards,

    Boyko

  • I have already export the CC, arch and toolchain variables to the bashrc. Can you suggest something else.
    The ABI=32 is not a valid argument it says when i use it with ./configure. I have been suggested by someone to use 32 Bit host. I am shifting to it and will try to give it a shot today.

  • Hi Boyko, Shifting to a 32 Bit Host worked for me and the ./configure command for GMP ran successfully. But the very next command "make" gave me following output:


    harsh32bit@harsh32bitWS:~/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0$ make
    make  all-recursive
    make[1]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0'
    Making all in tests
    make[2]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests'
    Making all in .
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests'
    make[3]: Nothing to be done for `all-am'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests'
    Making all in devel
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/devel'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/devel'
    Making all in mpn
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpn'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpn'
    Making all in mpz
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpz'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpz'
    Making all in mpq
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpq'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpq'
    Making all in mpf
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpf'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/mpf'
    Making all in rand
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/rand'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/rand'
    Making all in misc
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/misc'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/misc'
    Making all in cxx
    make[3]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/cxx'
    make[3]: Nothing to be done for `all'.
    make[3]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests/cxx'
    make[2]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/tests'
    Making all in mpn
    make[2]: Entering directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/mpn'
    /bin/bash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_`echo add_n | sed 's/_$//'`    -O2 -pedantic -fomit-frame-pointer -Wa,--noexecstack `test -f 'add_n.asm' || echo './'`add_n.asm
    libtool: compile:  ../mpn/m4-ccas --m4=m4 gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -O2 -pedantic -fomit-frame-pointer -Wa,--noexecstack add_n.asm  -fPIC -DPIC -o .libs/add_n.o
    m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_add_n -DPIC add_n.asm >tmp-add_n.s
     gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_add_n -O2 -pedantic -fomit-frame-pointer -Wa,--noexecstack tmp-add_n.s -fPIC -DPIC -o .libs/add_n.o
    tmp-add_n.s: Assembler messages:
    tmp-add_n.s:74: Error: no such instruction: `ldr r12,[r13,'
    tmp-add_n.s:75: Error: no such instruction: `stmfd r13!,{r8,r9,r14}'
    tmp-add_n.s:76: Error: expecting operand after ','; got nothing
    tmp-add_n.s:77: Error: no such instruction: `b .Lent'
    tmp-add_n.s:85: Error: no such instruction: `stmfd r13!,{r8,r9,r14}'
    tmp-add_n.s:86: Error: no such instruction: `cmn r0,'
    tmp-add_n.s:87: Error: no such instruction: `tst r3,'
    tmp-add_n.s:88: Error: no such instruction: `beq .Lskip1'
    tmp-add_n.s:89: Error: no such instruction: `ldr r12,[r1],'
    tmp-add_n.s:90: Error: no such instruction: `ldr r14,[r2],'
    tmp-add_n.s:91: Error: too many memory references for `adc'
    tmp-add_n.s:92: Error: invalid char '[' beginning operand 2 `[r0]'
    tmp-add_n.s:94: Error: no such instruction: `tst r3,'
    tmp-add_n.s:95: Error: no such instruction: `beq .Lskip2'
    tmp-add_n.s:96: Error: no such instruction: `ldmia r1!,{r8,r9}'
    tmp-add_n.s:97: Error: no such instruction: `ldmia r2!,{r12,r14}'
    tmp-add_n.s:98: Error: too many memory references for `adc'
    tmp-add_n.s:99: Error: too many memory references for `adc'
    tmp-add_n.s:100: Error: no such instruction: `stmia r0!,{r8,r9}'
    tmp-add_n.s:102: Error: no such instruction: `bics r3,r3,'
    tmp-add_n.s:103: Error: no such instruction: `beq .Lrtn'
    tmp-add_n.s:104: Error: no such instruction: `stmfd r13!,{r4,r5,r6,r7}'
    tmp-add_n.s:106: Error: no such instruction: `ldmia r1!,{r4,r5,r6,r7}'
    tmp-add_n.s:107: Error: no such instruction: `ldmia r2!,{r8,r9,r12,r14}'
    tmp-add_n.s:108: Error: too many memory references for `adc'
    tmp-add_n.s:109: Error: too many memory references for `sub'
    tmp-add_n.s:110: Error: too many memory references for `adc'
    tmp-add_n.s:111: Error: too many memory references for `adc'
    tmp-add_n.s:112: Error: too many memory references for `adc'
    tmp-add_n.s:113: Error: no such instruction: `stmia r0!,{r4,r5,r6,r7}'
    tmp-add_n.s:114: Error: no such instruction: `teq r3,'
    tmp-add_n.s:115: Error: no such instruction: `bne .Ltop'
    tmp-add_n.s:117: Error: no such instruction: `ldmfd r13!,{r4,r5,r6,r7}'
    tmp-add_n.s:119: Error: too many memory references for `adc'
    tmp-add_n.s:120: Error: no such instruction: `ldmfd r13!,{r8,r9,r15}'
    make[2]: *** [add_n.lo] Error 1
    make[2]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/mpn'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/harsh32bit/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0'
    make: *** [all] Error 2

    Do you have any workaround or pointers for this?



  • HI All,

    The GMP V6.0.0 got compiled after few trials. Even after having the ARCH, TOOLCHAIN and CROSS_COMPILER variables in `.bashrc` I had to `export` the following:

        export ARCH=arm<BR>
        export PATH=/home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/bin/:$PATH<BR>
        export CROSS_COMPILE=arm-none-linux-gnueabi-<BR>

    Then following commands were observed:<BR>

        ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --prefix=/home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/
         
        make clean
        make
        make install

    Then Soft-linking GMP Library to Toolchain

        ~/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/lib/gcc/arm-none-linux-gnueabi/4.7.3  
        # ln -s ~/Work/Projects/BSQ_VVDN/packages/gmp-6.0.0/.libs/libgmp.so libgmp.so

    I had the GMP compiled successfully although the `make check` reported all test failed.

        9 of 9 tests failed.

    Now when I try to cross compile Openswan-2.6.41 after making changes in CROSSCOMPILE.sh and do this `make programs` I get this error:

    > In file included from /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/include/certs.h:24:0,from /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/lib/libopenswan/id.c:42:
        /home/harsh32bit/Work/Projects/BSQ_VVDN/packages/openswan-2.6.41/include/secrets.h:20:41: fatal error: gmp.h: No such file or directory
        compilation terminated

    So is it because 'make check' for GMP is also failing. Can some please help me resolve it. Am I missing some variables?

  • Further inputs from customer:

    1.       Can you let me know what is the base software release you are using? Is it TI or is it BiSquare?
    - The Linux kernel version is 3.10 which is open source and the SDK came from TI.

    2.       Does this code build on any earlier version of Ubuntu or any other PC environments? Which all?

    - I did build it on Ubuntu 12.04 64 Bit and now Its on Ubuntu 12.04 32 Bit.

    3.       Can you list the tool chain version used here and their sources (Links/paths)? And send us the full list of command logs you have tried ?

    - Toolchain Name: arm-2013.05-24-arm-none-linux-gnueabi-i686-pc-linux-gnu
      Paths:

       Toolchain- /home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-SourceryCodeBenchLite-arm/bin/arm-none-linux-gnueabi-
       CrossCompile- /home/harsh32bit/Work/Projects/BSQ_VVDN/BISQUARE/gcc-linaro-arm/bin/arm-linux-gnueabihf-

       Arch- arm

      Please find attachment for the command logs.

    4.       From the logs it seems like the assembly commands are not getting interpreted as valid. So some where your tool chain needs to be rechecked for any issues…Kindly recheck on this

    - I have compiled the kernel and flashed it on the board and have checked few interfaces like wifi and bluetooth. Had this been a toolchian problem the board shouldn't have worked. Never-the-less I will recheck on this.

    I believe its some variable I need to set while compiling GMP. Please note that "make check" command for GMP finds all the tests failed, may be this leads to compilation fail for opensawn.