Missing linker/linker64 ELF

482 views
Skip to first unread message

She Bu (BuShe)

unread,
Feb 5, 2024, 10:12:37 AMFeb 5
to android-ndk
I am trying to compile a certain project for Android cross-platform using Android NDK on Ubuntu platform and I am getting the following error:

qemu-aarch64: Could not open '/system/bin/linker64': No such file or directory

I checked https://android.googlesource.com/platform/bionic/ and got some information.

So is there a way to use linker/linker64 on the Ubuntu platform?

enh

unread,
Feb 5, 2024, 10:19:48 AMFeb 5
to andro...@googlegroups.com
that means you're trying to _run_ an Android executable on your host.
you don't want to do that. you'll want to make sure you're
cross-compiling correctly (and may have to fix the project so that it
doesn't try to run executables locally when cross-compiling).
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/3030ca6d-64ab-4779-8265-d8c18b25b9can%40googlegroups.com.

John Dallman

unread,
Feb 5, 2024, 12:18:16 PMFeb 5
to andro...@googlegroups.com
Could you explain a bit more what you're trying to do? 

/system/bin/linker and /system/bin/linker64 are the 32-bit and 64-bit loaders on an Android device. Their job is to start a process. They should not be involved with compiling or linking software for Android; they're only used when it is to be run. 

They're called "linker" because they do the job of putting a process together from an executable and shared libraries. "Dynamic  linker" is a more accurate term for them. They're separate from the kind of linker which reads .o object files and builds an executable or a shared library. 

John

--
Message has been deleted

She Bu (BuShe)

unread,
Feb 5, 2024, 2:29:14 PMFeb 5
to android-ndk
Thanks for getting back to me,

I know what is linker/linker64 runs on Android device.

I can point directly to this problem occurring in building Node.js for the Android platform (especially for the ARM architecture). 

Using arm64 as the target architecture, for example, during some cross-compilation process the build produced a binary, icupkg: ELF 64-bit LSB pie executable ... interrupter /system/bin/linker64 .... 

And qemu-aarch64 needs to execute this binary, so it needs linker64. 

We tried to copy linker64 from the Android device to the appropriate path, and the project compiled.

enh

unread,
Feb 5, 2024, 2:32:27 PMFeb 5
to andro...@googlegroups.com
On Mon, Feb 5, 2024 at 11:29 AM She Bu <guzheny...@gmail.com> wrote:
>
> Thanks for getting back to me,
>
> I know what is linker/linker64 runs on Android device.
>
> I can point directly to this problem occurring in building Node.js for the Android platform (especially for the ARM architecture).
>
> Using arm64 as the target architecture, for example, during some cross-compilation process the build produced a binary, icupkg: ELF 64-bit LSB pie executable ... interrupter /system/bin/linker64 ....
>
> And qemu-aarch64 needs to execute this binary, so it needs linker64.
>
> We tried to copy linker64 from the Android device to the appropriate path, and the project compiled.

yes, but it probably got the wrong results --- typically when a
generated binary is run during a build, it's for a configure-style
test. if you're running the wrong architecture/OS binary, you'll get a
"fail" that doesn't actually represent what's available on the device.
this is a classic mistake when people haven't taken cross-compilation
into account. you'll want to check the resulting configuration and/or
talk to the maintainer of the build about fixing it for
cross-compilation.
>> You received this message because you are subscribed to a topic in the Google Groups "android-ndk" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-ndk/3Ep6zD3xxSY/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to android-ndk...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAH1xqgmeVuFn%3Dpg5XGpYYmomVCKs%3DqUDR0hrigdqd-6qPkAo2w%40mail.gmail.com.
>
> --
> You received this message because you are subscribed to the Google Groups "android-ndk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/CAN_N8jYNEs_AvmPcqyj6pUoDb9fh8Yur9XVtD67YfHSE%2BXeryA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages