ibireme/YYImage

Duplicate webp symbols

Closed this issue · 2 comments

This Issue is more of an observation than a bug:

Our production project (closed source) has issues linking with WebP when pulled via YYImage. We pull in YYImage+WebP in a subspec of our open source project:
https://github.com/imojiengineering/imoji-ios-sdk/blob/master/ImojiSDK.podspec#L18

I've been able to get this resolved by forking YYImage and recompiling WebP w/o libwebpdecoder here:
https://github.com/imojiengineering/YYImage/commit/b79dd0297c1925940d7470f2147dae909e73e9e6

Note that this only happens for our production project and not any other project. Therefore I'm not sure if there's a project setting we've got misconfigured.

At any rate, the error we were getting suggests that there are duplicate symbols in the WebP build. I'm curious as to why it doesn't fail for other projects.

Message

duplicate symbol _WebPMultRows in:
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdsp_la-alpha_processing.o)
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdspdecode_la-alpha_processing.o)
duplicate symbol _WebPMultARGBRows in:
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdsp_la-alpha_processing.o)
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdspdecode_la-alpha_processing.o)
duplicate symbol _WebPInitAlphaProcessing in:
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdsp_la-alpha_processing.o)
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdspdecode_la-alpha_processing.o)
duplicate symbol _WebPMultRowC in:
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdsp_la-alpha_processing.o)
    /Users/nkhoshini/projects/imoji-ios/Pods/YYImage/Vendor/WebP.framework/WebP(libwebpdspdecode_la-alpha_processing.o)

Symbol dump of YYImage/Vendor/WebP.framework/WebP

~$ nm WebP | grep  _WebPMultRows
                 U _WebPMultRows
0000000000000270 T _WebPMultRows
0000000000000270 T _WebPMultRows
                 U _WebPMultRows

Configuration
Xcode 7.3
iOS SDK 9.3
OSX 10.11

If you add -all_load or -force_load in your project's Other Link Flags, you may get the duplicate symbol error sometimes.

This may be a bug in compile script, I'll test your script (https://github.com/imojiengineering/YYImage/commit/b79dd0297c1925940d7470f2147dae909e73e9e6) and try to fix it. Thank you very much~

Cool thanks for the tip! In our project, the -all_load flag was what was causing the issue. Removing it links perfectly fine with the YYImage pod.