zeromq / libzmq

ZeroMQ core engine in C++, implements ZMTP/3.1
https://www.zeromq.org
Mozilla Public License 2.0
9.57k stars 2.34k forks source link

Cannot link libzmq.a on Android Studio (unsupported dynamic reloc R_ARM_REL32) #3881

Open vb-mich opened 4 years ago

vb-mich commented 4 years ago

Issue description

I successfully built on Linux libzmq for Android following the instructions here, now I'm trying to compile on Windows with Android Studio a shared library linking to it the static build of libzmq. The linker gives me this errors: libzmq/armeabi-v7a/libzmq.a(src_libzmq_la-address.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC libzmq/armeabi-v7a/libzmq.a(src_libzmq_la-ctx.o): requires unsupported dynamic reloc R_ARM_REL32; recompile with -fPIC

I confirm the static library has been built with fPIC as well as my library I also tried the solution here https://github.com/zeromq/libzmq/issues/2300 with no luck.

Digging on google I found this https://github.com/gavinpugh/vs-android/issues/124 Maybe a bug of Android Studio?

Environment

libzmq built on Ubuntu Linux Android Studio 3.6.3 running on Windows 10 NDK r21 (on both win and linux)

austinbenincasa commented 3 years ago

I have experienced this issue as well on Ubuntu 16.04 gcc-8 c++17 libzmq-4.3.2

vb-mich commented 3 years ago

I have experienced this issue as well on Ubuntu 16.04 gcc-8 c++17 libzmq-4.3.2

Are you using Android Studio as well?

austinbenincasa commented 3 years ago

No, forgot to follow up I had to build libzmq using the following, ./autogen.sh --with-pic then ./configure

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had activity for 365 days. It will be closed if no further activity occurs within 56 days. Thank you for your contributions.