Open cirosantilli opened 7 years ago
Any progress on this yet? Right now I'm using v3.13.1 for building on Linux and v3.16 for iOS, due to all previous versions apparently being deprecated due to a system-call which does not exist in iOS 11 anymore.
@simpers nope. Cocos really needs some packaging love :-)
Why I want to do this:
Specs:
Steps to Reproduce:
cmake -DBUILD_SHARED_LIBS:BOOL=ON && make
(Using gcc 6.3 from my distro)Outcome: link fails with:
However, freetype is already compiled with
-fPIC
if you compile it yourself, https://github.com/cocos2d/cocos2d-x-3rd-party-libs-src/blob/d020d9ef98dea233992802d151afdbbbff3acd8e/contrib/src/main.mak#L288 so I think it is about having the prebuilt binary built with an old GCC? So I just compile it myself with:and copy into the prebuilts and it works.
Next, the link fails with:
libz.a
gets built together with freetype:linux/z/prebuilt/x86_64/libz.a
, which uses libz functions, however for some reason it is not present in the binaries https://github.com/cocos2d/cocos2d-x-3rd-party-libs-bin/tree/8d1bf3e7199948755c98a36a59bf15c50943e27e andmake VERBOSE=1
says it is not used during link, only:which ends up looking for my system's shared library, which cannot be used for a shared link .
I also don't understand the error because:
readelf
says that the/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/libz.so
on my system does haveinflateEnd
.I then copy pasted the failing linker command, and replaced all
-lz
entries with the full path to the builtlibz.a
and the link now works, andcpp-tests
runs!However, even after the link works, I sill have the following conerns:
libcocos2dInternal.so
, should be justlibcocos2d.so
.libcocos2d.so
does exist but is much smaller, not sure what it is for.