0

Problem when compile AJTCL with cross-compiler

asked 2014-09-10 10:38:08 -0700

congngale gravatar image

updated 2014-09-12 00:39:48 -0700

Hi All,

I met a problem when compile the Alljoyn Thin Client Library with mipsel-openwrt-linux-uclibc-gcc . I used version 14.02 which was downloaded from https://www.alljoyn.org/docs-and-downloads . It is fine if I compile the source code with default Sconscript which was using gcc. My target device is runing OpenWRT.

mipsel-openwrt-linux-uclibc-gcc -o target/linux/aj_target_crypto.o -c -Wall -pipe -static -funsigned-char -Wpointer-sign -Wimplicit-function-declaration -fno-strict-aliasing -g -DAJ_MAIN -Iinc -Itarget/linux target/linux/aj_target_crypto.c
target/linux/aj_target_crypto.c:29:25: error: openssl/aes.h: No such file or directory
target/linux/aj_target_crypto.c:30:24: error: openssl/bn.h: No such file or directory
target/linux/aj_target_crypto.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'keyState'
target/linux/aj_target_crypto.c: In function 'AJ_AES_Enable':
target/linux/aj_target_crypto.c:44: warning: implicit declaration of function 'AES_set_encrypt_key'
target/linux/aj_target_crypto.c:44: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c:44: error: (Each undeclared identifier is reported only once
target/linux/aj_target_crypto.c:44: error: for each function it appears in.)
target/linux/aj_target_crypto.c: In function 'AJ_AES_CTR_128':
target/linux/aj_target_crypto.c:62: warning: implicit declaration of function 'AES_encrypt'
target/linux/aj_target_crypto.c:62: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_AES_CBC_128_ENCRYPT':
target/linux/aj_target_crypto.c:74: warning: implicit declaration of function 'AES_cbc_encrypt'
target/linux/aj_target_crypto.c:74: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c:74: error: 'AES_ENCRYPT' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_AES_ECB_128_ENCRYPT':
target/linux/aj_target_crypto.c:79: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_RandBytes':
target/linux/aj_target_crypto.c:84: error: 'BIGNUM' undeclared (first use in this function)
target/linux/aj_target_crypto.c:84: error: 'bn' undeclared (first use in this function)
target/linux/aj_target_crypto.c:84: warning: implicit declaration of function 'BN_new'
target/linux/aj_target_crypto.c:85: warning: implicit declaration of function 'BN_rand'
target/linux/aj_target_crypto.c:86: warning: implicit declaration of function 'BN_bn2bin'
target/linux/aj_target_crypto.c:87: warning: implicit declaration of function 'BN_free'
scons: *** [target/linux/aj_target_crypto.o] Error 1
scons: building terminated because of errors.

I met new problem when try to compile Alljoyn Thin Client Library version 14.06. I just use command "scons" to build

congngale@CONGNGALE-PC:~/Work/Alljoyn/alljoyn-suite-14.06.00_beta-src/core/ajtcl$ scons
scons: Reading SConscript files ...
GTEST_DIR is not set, skipping unittest build
scons: done reading SConscript files.
scons: Building targets ...
/opt/toolchain-mipsel_gcc-4.3.3+cs_uClibc-0.9.33.2/usr/bin/mipsel-openwrt-linux-uclibc-gcc -o samples/basic/basic_client samples/basic/basic_client.o src/aj_about.o src/aj_bufio.o src/aj_bus.o src/aj_cert.o src/aj_connect.o src/aj_crc16.o src/aj_creds.o src/aj_crypto.o src/aj_debug.o src/aj_disco.o src/aj_guid.o src/aj_helper.o src/aj_init.o src/aj_introspect.o src/aj_keyauthentication.o src/aj_keyexchange.o src/aj_link_timeout.o src/aj_msg.o src/aj_nvram.o src/aj_peer.o src/aj_serial.o src/aj_serial_rx.o src/aj_serial_tx.o src/aj_std.o src ...
(more)
edit retag flag offensive close merge delete

Comments

Please show the entire scons command line you are using. Also are you building this inside the OpenWrt system or just using the compilers?

stevek ( 2014-09-10 14:21:42 -0700 )edit

I used the command "scons" to build.

congngale ( 2014-09-10 19:59:00 -0700 )edit

You have still not posted the exact scons command line that you are using. Without that, I cannot tell you how to fix the scons line.

stevek ( 2014-09-11 12:10:38 -0700 )edit

I just update the error and you can see i only use "scons" to build.

congngale ( 2014-09-12 00:33:44 -0700 )edit

scons by default does not use mipsel-openwrt-linux-uclibc-gcc. What scons related environment variables have you set? What changes have you made to the scons files?

stevek ( 2014-09-12 08:27:31 -0700 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-09-10 19:56:49 -0700

congngale gravatar image

updated 2014-11-16 23:56:01 -0700

Hi All,

I just figure out what happen with mipsel-openwrt-linux-uclibc-gcc that is the toolchain folder is not contain openssl header file (my toolchain for arm is included that) so the problem appear. To fix it problem i only need to find the place where contain the openssl header file for mipsel and include it and the problem go away.

Finally, i figured out that my problem relate to Linux kernel, It is not support eventfd. We only need upgrade Linux kernel version newer than 2.6.21.

edit flag offensive delete publish link more

Comments

Since this "answer" is still part of your question, you should move it to your questions. The ask.allseenalliance.org site is not a discussion forum, it is a question and answer forum similar to stackoverflow.

stevek ( 2014-09-11 12:07:22 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-09-10 10:38:08 -0700

Seen: 413 times

Last updated: Nov 16 '14