cisco / libsrtp

Library for SRTP (Secure Realtime Transport Protocol)
Other
1.2k stars 472 forks source link

An error occurred when compiling libsrtp-v2.3.0 from the ARM-Linux compiler #541

Closed remainfox closed 3 years ago

remainfox commented 3 years ago

gcc versoon

root@brian:depends# arm-linux-gcc -v
Using built-in specs.
COLLECT_GCC=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc.br_real
COLLECT_LTO_WRAPPER=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/libexec/gcc/arm-buildroot-linux-gnueabihf/6.5.0/lto-wrapper
Target: arm-buildroot-linux-gnueabihf
Configured with: ./configure --prefix=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host --sysconfdir=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/etc --enable-static --target=arm-buildroot-linux-gnueabihf --with-sysroot=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/arm-buildroot-linux-gnueabihf/sysroot --enable-__cxa_atexit --with-gnu-ld --disable-libssp --disable-multilib --with-gmp=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host --with-mpc=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host --with-mpfr=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host --with-pkgversion='Buildroot 2018.02-rc3-g03cc10792-dirty' --with-bugurl=http://bugs.buildroot.net/ --disable-libquadmath --enable-tls --disable-libmudflap --enable-threads --without-isl --without-cloog --disable-decimal-float --with-abi=aapcs-linux --with-cpu=cortex-a35 --with-fpu=vfpv4 --with-float=hard --with-mode=arm --enable-languages=c,c++ --with-build-time-tools=/home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/arm-buildroot-linux-gnueabihf/bin --enable-shared --disable-libgomp
Thread model: posix
gcc version 6.5.0 (Buildroot 2018.02-rc3-g03cc10792-dirty) 

compile error as follows

checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc accepts -g... yes
checking for /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc -E
checking whether we are using the GNU C++ compiler... yes
checking whether /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-g++ accepts -g... yes
checking for arm-linux-ar... ar
checking the archiver (ar) interface... ar
checking for arm-linux-ranlib... arm-linux-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking whether /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc accepts -Werror... yes
checking whether /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc accepts -fPIC... yes
checking whether /home/brian/rk3326/buildroot/output/rockchip_rk3326_32/host/bin/arm-linux-gcc accepts -Wno-language-extension-token... no
checking for ANSI C header files... (cached) yes
checking for unistd.h... (cached) yes
checking for byteswap.h... yes
checking for stdint.h... (cached) yes
checking for sys/uio.h... yes
checking for inttypes.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for machine/types.h... no
checking for sys/int_types.h... no
checking for sys/socket.h... yes
checking for netinet/in.h... yes
checking for arpa/inet.h... yes
checking for windows.h... no
checking for int8_t... yes
checking for uint8_t... yes
checking for int16_t... yes
checking for uint16_t... yes
checking for int32_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking size of unsigned long... 4
checking size of unsigned long long... 8
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for socket... yes
checking for inet_aton... yes
checking for usleep... yes
checking for sigaction... yes
checking whether to enable debug logging in all modules... no
checking for arm-linux-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking whether to leverage OpenSSL crypto... yes
checking whether to leverage NSS crypto... no
checking for user specified OpenSSL directory... /home/brian/rk3326/app/webrtc/depends/install
checking for crypto... yes
checking for library containing EVP_EncryptInit... none required
checking for library containing EVP_aes_128_ctr... none required
checking for library containing EVP_aes_128_gcm... none required
checking if OPENSSL_cleanse is broken... configure: error: in `/home/brian/rk3326/app/webrtc/depends/build/libsrtp-2.3.0':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
Makefile:3: recipe for target 'all' failed
remainfox commented 3 years ago

build compile flags:

export CC=arm-linux-gcc
  $ ./configure --prefix=/home/brian/rk3326/app/webrtc/depends/install \
 LDFLAGS=-L/home/brian/rk3326/app/webrtc/depends/install/lib \
 LIBS=-lssl -lcrypto CFLAGS=-I/home/brian/rk3326/app/webrtc/depends/install/include \
 --enable-openssl --with-openssl-dir=/home/brian/rk3326/app/webrtc/depends/install \ 
--host=arm-linux --target=arm-linux
thinkski commented 3 years ago

Ran into the same issue. The problem is the AC_RUN_IFELSE macro for the OPENSSL_cleanse check is called without a fourth argument for what to do when cross-compiling. Will put a PR up shortly.

thinkski commented 3 years ago

Actually, looks like this was already fixed by f379f48.

pabuhler commented 3 years ago

Closing this as it seams to be fixed, feel free to reopen if still an issue