adobkin / libcapn

A simple C Library for interact with the Apple Push Notification Service (APNs)
MIT License
100 stars 37 forks source link

Cross compile error #23

Open sagaertj opened 8 years ago

sagaertj commented 8 years ago

When cross compiling libjansson seems to be compiled for the host.

My cmake invocation: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE= \ "/home/buildroot12git/output/host/usr/share/buildroot/toolchainfile.cmake" \ -DCMAKE_INSTALL_PREFIX=/home/buildroot12git/output/staging/usr -DUSE_CCACHE=OFF \ -DAPN_HAVE_GLIBC_STRERROR_R=OFF -DAPN_HAVE_POSIX_STRERROR_R=OFF \ -DAPN_HAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT=OFF -DAPN_HAVE_POSIX_STRERROR_R__TRYRUN_OUTPUT=OFF

[ 65%] Building C object CMakeFiles/capn.dir/src/library/apn_tokens.c.o [ 70%] Building C object CMakeFiles/capn.dir/src/library/apn_binary_message.c.o [ 75%] Building C object CMakeFiles/capn.dir/src/library/apn_array.c.o [ 80%] Building C object CMakeFiles/capn.dir/src/library/apn_strerror.c.o [ 85%] Building C object CMakeFiles/capn.dir/src/library/apn_ssl.c.o [ 90%] Building C object CMakeFiles/capn.dir/src/library/apn_log.c.o Linking C shared library lib/Release/libcapn.so /home/buildroot12git/output/host/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/../../../../arm-buildroot-linux-gnueabi/bin/ld: src/third_party/jansson/lib/libjansson.a(value.c.o): Relocations in generic ELF (EM: 3) /home/buildroot12git/output/host/usr/lib/gcc/arm-buildroot-linux-gnueabi/4.9.3/../../../../arm-buildroot-linux-gnueabi/bin/ld: src/third_party/jansson/lib/libjansson.a(value.c.o): Relocations in generic ELF (EM: 3) src/third_party/jansson/lib/libjansson.a: error adding symbols: File in wrong format collect2: error: ld returned 1 exit status make[2]: * [lib/Release/libcapn.so.2.0.0] Error 1 make[1]: * [CMakeFiles/capn.dir/all] Error 2 make: *\ [all] Error 2

Since i already have a crosscompiled libjansson in my cross toolchain , it might be cleaner to link against this one. Maybe adding some option in the cmakefile -DUSE_TARGET_LIBJANSSON ? It would make more sense to use the shared libjansson, and it would ommit the requirement for the submodule download.

Best Regards , Johan