Subject: Re: bug#79120: 30.1; Emacs android can't execute programs in /system/bin (127)

From: Po Lu <[email-masked]>
Date: Fri, 08 Aug 2025 14:12:36 +0800

Eli Zaretskii <[email-masked]> writes:

>> From: Theia <[email-masked]>
>> Date: Mon, 28 Jul 2025 13:16:15 -0700
>> 
>> With a fresh app install on Android 15+:
>> 1. Launch emacs
>> 2. M-x term, RET
>> 3. Error is written in buffer *terminal*:
>> 
>>   Process terminal exited abnormally with code 127
>> 
>> When I first started using emacs on android I assumed this was normal
>> and immediately jumped to using emacs with termux. However, a number
>> of built-in packages (term, tramp, etc) assume that /system/bin/sh (or
>> other programs) are executable. I'm guessing this is some change in
>> security on Android's part, but it's unclear to me the exact issue.
>> 
>> I've tested this on my phone and in an emulator. I acquired the package
>> for this test from f-droid.
>> 
>> For what it is worth, /system/bin/sh can be called from termux on
>> Android 15+, so there must be some way to get it to work.
>
> Po Lu, could you perhaps look into this?

Theia, could you test a build from the Emacs 31 branch, where the
executable loader has been adapted to the version of the runtime link
editor included in Android 15 and 16?  If the issue is not present
there, I shall backport it to Emacs 30 hopefully with plenty of time to
spare till the next release.

  https://sourceforge.net/projects/android-ports-for-gnu-emacs/files