zlib icon indicating copy to clipboard operation
zlib copied to clipboard

Fix the problem of using static library linking

Open xengine-qyt opened this issue 1 year ago • 4 comments

xengine-qyt avatar Nov 30 '23 03:11 xengine-qyt

@madler: What do you think?

Neustradamus avatar Dec 17 '23 20:12 Neustradamus

Cross-compiling to static libraries on Android platforms requires this option for linking and compiling. ndk-android ./configure --static

xengine-qyt avatar Dec 22 '23 08:12 xengine-qyt

@madler: Can you look this PR?

Neustradamus avatar Jan 23 '24 08:01 Neustradamus

fixed this:https://github.com/madler/zlib/issues/882

xengine-qyt avatar Mar 08 '24 09:03 xengine-qyt

Thanks. Applied, though avoiding double -fPIC's.

madler avatar Mar 30 '24 03:03 madler

This actually resolved an issue I was having for days, it was very similar to the one referenced on #882: lib/libz.a(zutil.o): relocation R_X86_64_PC32 against symbol `z_errmsg' can not be used when making a shared object; recompile with -fPIC

I don't know much about the double -fPIC but it surely did some trick.

PS: I've tried configure with CHOST, --static, tried to build with cmake and a bunch of other things, but this was the actual solution.

PSS: Sorry for commenting in a closed PR, but this was such a relief to find, that I felt that was going to be worth sharing my experience.

raphaelts3 avatar Jun 06 '24 03:06 raphaelts3