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

[Bug]: lipo -info Crashes when Given any Static Library Compiled for Android #2109

Open
1 task done
GuyEP-Modulate opened this issue Dec 14, 2024 · 6 comments
Open
1 task done
Assignees
Labels

Comments

@GuyEP-Modulate
Copy link

Description

Steps to Reproduce

Run llvm-lipo with the following library, which was compiled for Android.
libopus.android.zip

Expected Results

The architecture of the library will be printed.

Actual Results

Lipo fails:

$ /Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo -info libopus.a
Non-fat file: libopus.a is architecture: PLEASE submit a bug report to https://github.com/android-ndk/ndk/issues and include the crash backtrace.
Stack dump:
0.	Program arguments: /Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo -info libopus.a
 #0 0x000000010481c590 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x1001c4590)
 #1 0x000000010481af18 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x1001c2f18)
 #2 0x000000010481cecc (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x1001c4ecc)
 #3 0x0000000190b44184 (/usr/lib/system/libsystem_platform.dylib+0x180484184)
 #4 0x00000001047b6164 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x10015e164)
 #5 0x0000000104660fc4 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x100008fc4)
 #6 0x0000000104661720 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x100009720)
 #7 0x000000010465f138 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x100007138)
 #8 0x000000010465e65c (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x10000665c)
 #9 0x0000000104665754 (/Users/guy/Library/Android/sdk/ndk/28.0.12674087/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-lipo+0x10000d754)
#10 0x000000019078c274
Segmentation fault: 11

Upstream bug

No response

Commit to cherry-pick

No response

I am using a supported NDK

  • I have checked and the NDK I'm using is currently supported

Affected versions

r27, r28

Host OS

Mac

Host OS version

15.1.1

Affected ABIs

arm64-v8a

@DanAlbert
Copy link
Member

@pirama-arumuga-nainar idk what llvm-lipo is. Is that something we support, or something that was shipped by accident?

@github-project-automation github-project-automation bot moved this to Awaiting triage in LLVM Jan 7, 2025
@DanAlbert DanAlbert added this to LLVM Jan 7, 2025
@enh-google
Copy link
Collaborator

it's only useful for Apple's mach-o "universal" binaries (formerly called "fat" binaries, hence the "lipo" pun).

probably shouldn't crash on ELF binaries though!

@DanAlbert
Copy link
Member

Ah, yeah, so not useful for the NDK and probably a thing we should just remove to save space.

@DanAlbert DanAlbert added this to NDK r29 Jan 7, 2025
@github-project-automation github-project-automation bot moved this to Unconfirmed in NDK r29 Jan 7, 2025
@pirama-arumuga-nainar
Copy link
Collaborator

Correct, llvm-lipo can only handle macho binaries.

@pirama-arumuga-nainar
Copy link
Collaborator

@Sharjeel-Khan has r.android.com/3445363 to remove llvm-lipo from Linux and Windows prebuilts. However, we need it in Darwin prebuilts for bootstrapping new toolchains. @DanAlbert you can remove the Darwin llvm-lipo during NDK packaging.

@DanAlbert
Copy link
Member

@DanAlbert you can remove the Darwin llvm-lipo during NDK packaging.

That was my plan. Will do that for r29 (will probably ignore it for r28).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Awaiting triage
Status: Unconfirmed
Development

No branches or pull requests

4 participants