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
Perl for Android Architecture #17246
Comments
I think it should be related with this issue #16821 , but I already try to remove Sysroot and re-build again but it not yet resolve |
#16821 was for a native build under Termux, rather than a cross-compile, so you probably do need to set SYSROOT. I haven't done a cross-compile build before, but am installing an android emulator under Linux now and will try this week. |
Thank you for your quick response. |
I've had a go this evening using NDK r20, targeting API 29, on a 64-bit Debian-derived Linux system, following the OP's steps from the initial post. However, this combination didn't even get as far as the reported problem. Problems:
Out of time tonight, will try again another evening. |
@kingvhit does make succeed if you change the SYSROOT variable to the following?
I set my Linux build environment up to broadly match your Darwin environment and that SYSROOT resulted in a successful make. ($HOST_TAG here is linux-x86_64.) make test is running, but not sure how long it will take on this VM/emulated device. |
Huh, make test shows masses of failures to investigate. A functioning perl binary does end up on the emulated Android device, even though there is plenty of module/environment breakage. |
Hi @richardleach
C Compiler I am using now is clang with API 21 target. But with the old sysroot It can be done by |
|
Configure seems to be picking things - not necessarily correctly - up on my Linux host that it doesn't on your Darwin host. Please could you attach the config.sh that Configure creates with the new SYSROOT? |
I've had a few goes with the original SYSROOT and setting -Dusrinc and -Dincpth to point to e.g. $TOOLCHAIN/sysroot/usr/include, but so far without success. The SYSROOT=$TOOLCHAIN/sysroot route might work if you add |
@richardleach : Thank for you suggest, I have to change the SYSROOT path and using Also when I try to run
This is our ENV after changed
Bellow as the script that I ran Seem like that |
Config.sh
|
Noting for comparison that the most obvious output from the test failures I got for the last build were failures to find just 3 symbols, specifically:
The latter function is explicitly marked as either obsolete or explicitly disallowed by SELinux (see https://android.googlesource.com/platform/bionic/+/master/docs/status.md). The full list of POSIX functions listed on that page is: Missing functions are either obsolete or explicitly disallowed by SELinux:
Missing functionality:
That page is also has a useful list of the libc symbols introduced with each Android API level. |
Perl furnishes a my_strlcpy if the system doesn't already have strlcpy(). Configure should have set this in config.h under HAS_STRLCPY. |
Looking a little deeper, I see that config.sh indicates that strlcpy is present. In that case, perl doesn't define my_strlcpy. I looked at Cwd. It is wanting my_strlcpy always. And it gets it from Devel::PPPort. I looked at that code, and it looks right to me. So I don't know what is happening. I think a .i file might help |
I don't have many experts for some of the above links, but I will learn it from now on. https://drive.google.com/file/d/1SeUU6sxzNItMsIohh-Dk_6oPUk4y3Atr/view?usp=sharing try to use by remote into a shell of android device based
This is finally working, but still not test with the |
@khw Happy to provide a .i file, but need a dummies guide - which .c file(s) do you want it for? It looks like Configure is setting the values pertaining to these 3 symbols correctly in config.sh:
|
@khw - still happy to provide a .i file, but need a dummies guide - which .c file(s) do you want it for? @kingvhit - how are you getting on? Are you getting particular errors when trying runtime.getruntime().exec() ? I built a basic Android app in Android Studio and was getting Permission Denied errors when trying to run Perl from /data/local/tmp/perl. I think this is because I was targeting the latest API version and Android 10, when the stricter SELinux policy puts more limitations on the locations from which an app can run native executables. I'll try targetting an older Android combo when less busy. Discussions I found useful included:
If this seems to be your main problem now, sounds like more of a general Android development issue than something directly relating to Perl. |
@richardleach: I can run Runtime.exec() right now but with the When switching to |
On 12/1/19 5:56 PM, Richard Leach wrote:
@khw <https://github.com/khw> - still happy to provide a .i file, but
need a dummies guide - which .c file(s) do you want it for?
Thanks for reminding me about this.
If you
cd to dist/PathTools
make Cwd.i
and send me the file Cwd.i, I'll take a look
|
So introduced from somewhere at link time? |
Description
Hi All, I want to make a perl binary and run on Android OS 5.0+.
As I checked on README.android, this is very outdated I guest, so I do it by self.
I have to download the source code of Perl as of version
perl-5.30.0.tar.gz
then unzip into storage.All right, this is my steps just I do.
The configuration is built successfully as expected results, the
config.sh
alsomake file
is generated.So, I ran the
make
command and got some problems that I didn't know whyFull log
Expected behavior
make file successfully and got the
perl
binary-based android architect.Perl configuration
NDK version: latest version on Google r20
https://developer.android.com/ndk/downloads
ToolChain:
From r19, Google officially make a Tool Chain are standalone toolchains
So I didn't run a standalone toolchain script. See the EVN of
TOOLCHAIN
SYSROOT
Attached config.sh and MakeFile as bellow
config.sh.txt
Makefile.txt
OS: Mac OS Catalina
version 10.15.1
The text was updated successfully, but these errors were encountered: