Trying to cross compile openssl-sys-extras (in hyper) from OSX to ARMv7


#1

I am trying to cross compile openssl-sys-extras (a hyper dependency) from OSX to ARMv7. After copying all header files from my raspberry pi into my OSX,

When I run the following command:
$ cargo build --target=armv7-unknown-linux-gnueabihf --release

the output is

/usr/local/linaro/arm-linux-gnueabihf-raspbian/include/stdio.h:364:12: error: old-style parameter declarations in prototyped function definition
extern int sprintf (char *__restrict __s,

and the info form my gcc is:
` $ /usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --v``

/usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/usr/local/linaro/arm-linux-gnueabihf-raspbian/bin/…/libexec/gcc/arm-linux-gnueabihf/4.9.1/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /Users/knut/Development/cross-tools/cross-build/build/src/gcc-linaro-4.9-2014.05/configure --build=x86_64-build_apple-darwin13.3.0 --host=x86_64-build_apple-darwin13.3.0 --target=arm-linux-gnueabihf --prefix=/Users/knut/Development/cross-tools/cross-build/install --with-sysroot=/Users/knut/Development/cross-tools/cross-build/install/arm-linux-gnueabihf/libc --enable-languages=c,c++,fortran --disable-multilib --enable-multiarch --with-arch=armv6 --with-tune=arm1176jz-s --with-fpu=vfp --with-float=hard --with-pkgversion=‘crosstool-NG linaro-1.13.1-4.9-2014.05 - Linaro GCC 4.9-2014.05’ --with-bugurl=https://bugs.launchpad.net/gcc-linaro --enable-__cxa_atexit --enable-libmudflap --enable-libgomp --enable-libssp --with-gmp=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --with-mpfr=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --with-mpc=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --with-isl=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --with-cloog=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --with-libelf=/Users/knut/Development/cross-tools/cross-build/build/arm-linux-gnueabihf/build/static --enable-threads=posix --disable-libstdcxx-pch --enable-linker-build-id --enable-plugin --enable-gold --with-local-prefix=/Users/knut/Development/cross-tools/cross-build/install/arm-linux-gnueabihf/libc --enable-c99 --enable-long-long --with-float=hard
Thread model: posix
gcc version 4.9.1 20140505 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.05 - Linaro GCC 4.9-2014.05)

Any ideas how to fix it?


#2

This looks like an issue with your toolchain to be honest. What happens when you run arm-linux-gnueabihf-gcc -c on openssl_shim.c?


#3

Indeed I get that error. I wonder if the versions of stdio.h and the compiler are incompatible. I got the former from my raspberry pi and the later I just got the latest version available as a binary for OSX.


#4

You have to use the include files that come with your compiler. On Linux, they come as part of the “libc-dev” package, I imagine whatever way you used to install the cross compiler will also have a way to install those headers.