-
Notifications
You must be signed in to change notification settings - Fork 560
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
Cpan install failed on Android. #22627
Comments
Please could you show:
Is the fundamental problem that described by https://github.com/termux/termux-packages/wiki/Termux-and-Android-10 with an open-ended discussion under termux/termux-app#2155 ? Finally, how does this relate to local::lib please? |
Here is the output of
Here is the strace file The problem I think is that when perl wants its own binary path but get the linker64 path, we use linker64 to execute every executable file so linker64 is the argv[0]. At first I was thinking that changing the /proc/self/exe to the perl binary path will solve the problem but it doesn't. So I searched for argv[0] and now I'm going to try changing the argv[0] to argv[1] because argv[0] is always the linker64, I hope that work. Here Andio is my own app and same problem is occurring in termux's Play Store version. |
I tried changing the argv[0] to argv[1] but it doesn't work, I have changed only |
I guess that means we should not be using the linux code for making $^X an absolute path on android then. I'd guess that's the |
How can we disable it? |
That depends on how you build it. Adding a |
Okay, I'll try it as well |
Now I'm getting this error while compiling 5.41.4, am I Missing any library?
|
Locale on Android has always been weird. I think @khwilliamson is better equipped to answer that question. I guess 3c45ca2 needs some refinement. |
On 9/29/24 04:09, Leon Timmermans wrote:
Now I'm getting this error while compiling 5.41.4, am I Missing any
library?
Locale on Android has always been weird. I think @khwilliamson
<https://github.com/khwilliamson> is better equipped to answer that
question. I guess 3c45ca2
<3c45ca2> needs some refinement.
Those symbols if not available on the system are defined in
perl_langinfo.h, which is included unconditionally in perl.h
I recall that Android's locale implementation was crippled, though that
was a long time ago.
For the time being, to get you going sooner and avoid likely other
locale-related issues,I suggest adding the following to your Configure
options
…-Accflags='-DNO_LOCALE'
You could generate a locale.i and send it to me, and/or look for a
langinfo.h system hdr and send it to me
—
Reply to this email directly, view it on GitHub
<#22627 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA2DH34JAX3ADAXWTZTTVTZY7GWLAVCNFSM6AAAAABO7JWKU6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBRGI4TKMRRGM>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Where is this langinfo.h or locale.i is located approximately? I use termux's package builder so I somewhat don't know about it...... |
I searched langinfo.h in android ndk, I don't find any. |
If you run But adding that Configure option should have gotten you (hopefully much) further along. The locale.i is just to help me figure out for the future what we can do to avoid this particular issue |
And yeah, I forgot to tell you that after using that configure option |
I ran make locale.i after configuration and this is what I get |
Is there a |
Okay. Renamed this file from config.h to .txt |
Attached is the file |
I hope this will get you past this problem. Let us know. |
I am getting this error.
Here is the strace of the miniperl
|
Run Configure, adding to your normal options, the flags |
Here is the config.sh file: And running the command |
Try applying this patch setlocale.txt |
Still same error |
Is the strace the same? |
Some lines with the error and options:
Strace: |
I really need to see locale.i. In a log of compiling so far, there should have been a line |
Based on the earlier compilation command-line you should be able to get the preprocessed source with:
You may also want the result of separate runs with The |
Locale.i without any dlocale or debugging.
File: Locale.i with
File: Locale.i with
File: |
Add to your Configure options |
Here I have used this command to generate locale.i
I have added the --Accflags but clang tells that it doesn't used this flag so I removed --Accflags and only put --DNO_POSIX_2008_LOCALE |
Several things: There is only a single Earlier, gcc was being used, and now clang. Is that deliberate? And do you need threads? Generally, it's best to not use threads when trying to get things set up initially. They are a complication that can be dealt with later. I think that if you use just the single dash, it will work a lot better, and you should get a lot further in your compilation. The previous version you sent me of locale.i, did not have You can examine the generated config.sh file and look at the line very near the top that starts
|
I use termux's package builder scripts. This is the configure options:
Now I am trying without the |
I got the problem, the problem is with the perl-locale you provided. I skip copying the perl-locale file to the source-code's one and that segmentation fault is fixed but after some time it gives error about that locale.c error. |
I'm unsure which error you are referring to. If it is the ones like where it says
then the solution is to use the You did uncover a bug there, and that file should fix it. |
To save some typing, I assumed that if a system had these glibc-only locale categories, that it would have all elements that comprise them. For example with LC_PAPER, the elements are the height and width of a piece of paper. It doesn't make any sense to have LC_PAPER without any dimensions available. But Android has LC_PAPER without paper dimensions; the same with all the other elements in the glibc category extensions. See GH Perl#22627. I believe that means that these categories are useless on this platform. But this commit now checks each element for existence individually; removing the assumption that if the category exists, the element must too.
Sorry by mistake I told perl-locale but it's perl-langinfo.h file. I was referring to this error #22627 (comment) But perl-langinfo.h file you gave that triggers the miniperl's segmentation fault (core dump) |
Ok, with the perl_langinfo.h file I gave you that generates the strace problem, send me config.sh and config.i |
Here is the config.sh Here is the config.h Here is the config.i Sorry I don't know how to generate config.i and i saw that there is config.h so I ran that locale.c >locale.i command |
See GH Perl#22627. Glibc has a few locale categories that aren't used elsewhere, AFAIK. Android has a crippled implementation of them, in that it has none of the items that comprise the categories. In a typical langinfo.h, these are enum fields, so their existence can't be checked with an #ifdef, but in Android, everything is a #define, so much be checked with #ifdef. To get around this without writing a Configure probe, this commit just creates #defines when they are missing the category (which catches the non-Androids) or when using Android.
I'm sorry. I meant I want |
Here is the command I used for creating locale.i
But it's output is:
Here is the config.sh: Here is the locale.i: Here is the configuration command I have used to configure:
I have copied your perl-langinfo.h file to its destination. |
Sorry I'm late, I was changing the installation prefix, because some other packages have some errors. |
Please send a copy of the output of the make step. Does the strace output still look the same? If not, send it as well. |
Here is the Recent compilation log:
And config log: Strace: |
Can someone copy that a hello world .c program compiled with Android SDK, no perl core code, that does offsetof() on all the high priority structs might be needed. and a copy of that locale-archive file. vague memories from some months ago, Android does not use glibc b/c licensing/IP reasons, and instead uses https://en.wikipedia.org/wiki/Newlib plus since Android is a walled garden or soon to be one (native code/mprotect(EXEC) is deprecated but no hard kill date yet), you need to think twice if you are using a supported API or not perhaps Google forgot to delete that very popular .so file from Ubuntu and your accidentally linking to an abandoned untested out of date .so In 2020, poking around inside a App store commercial app, written in C++ compiled for ARM, IDK why this was done, but to call basic POSIX/Ubuntu .so functions, they started the JVM/Dex, load the typedefs of those C structs inside the .so, from their C++ code at runtime, and get back JVM FFI method objects, that they then call, instead of using ELF linking. IDK why that was done, lack of time, lack of correct knowlege devs, App store policy, or somehow the ".so" file in the JVM, through FFI, "works" but direct ELF linking doesn't. So either the .h headers are only meant to be fed into an IDL generater, then fed into the JVM, and some kind of thunking or runtime patching magic is happening in the JVM, vs calling the same functions from the C linker. I didn't research it beyond a few hours back then, but a C++ app, creating Java CB objects, then using Java's FFI, to call back into standard Ubuntu FOSS .so files, unusual and curious. |
Your make output you sent is from your build platform; using gcc. I don't understand cross compilation very much. I was given this link, but haven't had a chance to read it yet: https://www.netbsd.org/~sno/talks/nrpm/Cross-Compiling-For-Perl-Hackers.pdf What I need is the log for the clang build on your android device. |
Log while compiling clang or other? |
I don't understand. I don't need anything to do with compiling clang itself, which is what I interpret you as asking. I do need the log of the compilation where clang is being used as the compiler of perl. |
Sorry, it will take some days. Because my uncle's child splitted tea over my laptop and service centre told that it will take upto 20 days. |
See GH #22627. Glibc has a few locale categories that aren't used elsewhere, AFAIK. Android has a crippled implementation of them, in that it has none of the items that comprise the categories. In a typical langinfo.h, these are enum fields, so their existence can't be checked with an #ifdef, but in Android, everything is a #define, so much be checked with #ifdef. To get around this without writing a Configure probe, this commit just creates #defines when they are missing the category (which catches the non-Androids) or when using Android.
I'm sorry to share that the device I previously mentioned, which unfortunately suffered a tea spill, has experienced a hard drive failure. As a result, I've lost my entire codebase. After careful consideration, I've decided not to pursue developing a similar project in the future. |
Closing this ticket per OP report. Please open a fresh ticket if you want to start anew. Thank you very much. |
Module: local::lib
Description
As we all know starting from Android 10 execution of binary is forbidden on Android. To overcome this problem we execute the binary with /system/bin/linker64 binaryname arguments. So the problem here is we add prefix of the linker64 to the binary that is executing but when perl try to get its own exe it always return the linker64 not perl I tried to fix this and repaced /proc/self/exe with the perl path but it didn't work.
Steps to Reproduce
You can try this on termux on play store. Although I encountered this error in my app and also in termux.
Expected behavior
Should work as does in termux's GitHub varient.
Perl configuration
The text was updated successfully, but these errors were encountered: