Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yandex maps mobile modifying problem #15

Open
c-villain opened this issue May 6, 2022 · 5 comments
Open

Yandex maps mobile modifying problem #15

c-villain opened this issue May 6, 2022 · 5 comments

Comments

@c-villain
Copy link

c-villain commented May 6, 2022

Hi,
I am currently using ur tools to modify binary framework Yandex maps mobile...
Link to framework is taken from here...
Every time am getting zerofill error...

ld: in /Users/c-villain/Library/Developer/Xcode/DerivedData/Utkonos-flitswrpfdrvoncmykfarjwnxqce/Build/Products/Debug-iphonesimulator/YandexMapsMobile.framework/YandexMapsMobile(YMKSearchMasstransit2xObjectMetadata_Binding.mm.o), section __DATA/__bss has type zero-fill but non-zero file offset file '/Users/c-villain/Library/Developer/Xcode/DerivedData/Utkonos-flitswrpfdrvoncmykfarjwnxqce/Build/Products/Debug-iphonesimulator/YandexMapsMobile.framework/YandexMapsMobile' for architecture arm64

build on Xcode 13.3.1

any ideas what's going wrong?...

@igor-makarov
Copy link

@bogo I've checked this out very thoroughly. It appears that the Yandex SDK has non-zero offsets in S_ZEROFILL sections before the modification. So the iPhone version also doesn't build. This is not a problem with the Transmogrifier.

I've additionally discovered some Unix horrors in the Yandex SDK:

  • The original ar file format does not support file paths, only file names. GNU ar supports paths but macOS doesn't have it.
  • It's possible to add multiple different files with the same name to an ar archive and the linker accepts this.
  • When extracting using ar x, the files with the same filename overwrite each other so only one ends up extracted.
  • This overwrite also happens with files that have differently cased names because macOS isn't case-sensitive (e.g. Initialize.cpp.o and initialize.cpp.o).
  • It's not possible to extract these separate file instances by using ar directly. Only possible by a hack, e.g. extracting the first one using ar p and then removing it using ar d in a loop.
  • Adding files to an archive using ar crv also conflates the different copies that have the same name. To append, ar cqv needs to be used.

I've made a hacked build of xcframework_converter that handles all of this, plus the zero-fill patch: https://github.com/igor-makarov/XCFrameworkConverter/releases/tag/0.4.0-hack-zerofill

@mixdesign
Copy link

@igor-makarov Hey, Igor. Thanks for your work on converter. I tried the patched version to fix an issue for YandexMapsMobile, but still have same error on device build (arm64). I tried 0.7.0 version and 0.4.0-hack-zerofill separately. Same error!

I'm using converter from Podfile. I'm in Xcode 14.0.1 right now.

@igor-makarov
Copy link

Hey @mixdesign! I haven't looked at the new versions of the Yandex SDK because I don't actually use it.

It appears that the Yandex company isn't maintaining it very well, and I'm not sure how sustainable it is to constantly work around its quirks. I haven't got bandwidth right now to check it again.

Sorry about the late reply, but I don't have an answer.

@igor-makarov
Copy link

@mixdesign
Although now that I recall it, the newest SDK versions are supposed to have XCFramework packaging and not require the converter.

@mixdesign
Copy link

@igor-makarov yeah, thanks for your time and thoughts. I just found that there are fresh libs based on xcframeworks :) Link: https://github.com/CocoaPods/Specs/tree/master/Specs/d/d/0/YandexMapsMobile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants