Open Ashish2000L opened 1 week ago
the first question would be, did you set ANDROID_NDK_ROOT and your PATH environment variables properly, as per the NOTES-ANDROID.md instructions? From the above, I don't see a reference to doing so
the first question would be, did you set ANDROID_NDK_ROOT and your PATH environment variables properly, as per the NOTES-ANDROID.md instructions? From the above, I don't see a reference to doing so
Apologies, I have updated environment variables in the above problem. Below are the variables I have set:-
ANDROID_NDK_ROOT=C:\Users\51010384\AppData\Local\Android\Sdk\ndk\27.0.11902837 PATH=%ANDROID_NDK_ROOT%\toolchains\llvm\prebuilt\windows-x86_64\bin
so you're msl installation seems to be off, in that you don't have llvm-ar installed (it is perhaps just named ar, unsure).
I am guessing your Configure command failed because prefix is misspelled:
perl Configure android-arm -static --predix=D:\OpenSSL_Android --openssldir=D:\OpenSSL_Android
should be
perl Configure android-arm -static --prefix=D:\OpenSSL_Android --openssldir=D:\OpenSSL_Android
I have checked with the correct command as well, it is still showing the same error i.e
no NDK arm-linux-androideabi-gcc on $PATH at (eval 12) line 143.
if msl is what causing the issues, how to make on. what should I do in that case? Also why it is not working in wsl environment, do I have to install openssl project different way when working with wsl?
|no NDK arm-linux-androideabi-gcc on $PATH |at (eval 12) line 143.
It looks like the config target you selected is looking for gcc as a compiler, but your PATH is pointing to the binaries for clang.
If you want to use gcc you need to adjust your Path variable to point to the gcc tool chain for android
If you want to use clang...I'm on my phone so I can't look it up, but I believe there is an android -arm-clang target you need to select so the compiler command gets selected properly
The NDK I have downloaded i.e r26 till r23, all are having clang in their toolchain. I was looking for gcc but I wasn't able to find it. Is there a way by changing in the Configure file we can make it look for android-arm-clang file instead of gcc?
I have downloaded the windows zip for ndk from r26 to r23.
It supposed to detect that automatically, favoring clang over gcc as the latter is being phased out by android. Which makes me wonder why the proper clang prefix isn't getting found.
I suppose the next step would be to start adding some print statements in the Configurations/15-android.conf file aourd the comment:
# see if there is NDK clang on $PATH, "universal" or "standalone"
To determine why the proper clang compiler prefix isn't getting chosen
the above config dump you are seeing are coming when I am using wsl. When using wsl it was able to find the clang abi file but I am getting another file not found error when trying to make the file.
armv7a-linux-androideabi34-clang -I. -Iinclude -Iapps/include -pthread -Wall -O3 -DOPENSSL_USE_NODELETE -DOPENSSLDIR=""/mnt/d/OpenSSL_Android"" -DENGINESDIR=""/mnt/d/OpenSSL_Android/lib/engines-3"" -DMODULESDIR=""/mnt/d/OpenSSL_Android/lib/ossl-modules"" -DOPENSSL_BUILDING_OPENSSL -DNDEBUG -c -o apps/lib/libapps-lib-tlssrp_depr.o apps/lib/tlssrp_depr.c rm -f apps/libapps.a llvm-ar rs apps/libapps.a apps/lib/libapps-lib-app_libctx.o apps/lib/libapps-lib-app_params.o apps/lib/libapps-lib-app_provider.o apps/lib/libapps-lib-app_rand.o apps/lib/libapps-lib-app_x509.o apps/lib/libapps-lib-apps.o apps/lib/libapps-lib-apps_opt_printf.o apps/lib/libapps-lib-apps_ui.o apps/lib/libapps-lib-columns.o apps/lib/libapps-lib-engine.o apps/lib/libapps-lib-engine_loader.o apps/lib/libapps-lib-fmt.o apps/lib/libapps-lib-http_server.o apps/lib/libapps-lib-log.o apps/lib/libapps-lib-names.o apps/lib/libapps-lib-opt.o apps/lib/libapps-lib-s_cb.o apps/lib/libapps-lib-s_socket.o apps/lib/libapps-lib-tlssrp_depr.o make[1]: llvm-ar: No such file or directory make[1]: [Makefile:3285: apps/libapps.a] Error 127 make[1]: Leaving directory '/mnt/c/Users/user/Downloads/openssl-openssl-3.3.1/openssl-openssl-3.3.1' make: [Makefile:1668: build_sw] Error 2`
I am not sure how to get these files or may be I am unable to set the files in their correct location. I am using the windows directory path
/mnt/c
but it is looking for /app to search for the files.
do I have to make some changes in saving the files in different location? Any workaround I can do to fix this issue?
see if there is NDK clang on $PATH, "universal" or "standalone"
I have tried applying your suggestion by adding below print statements
my $triarch = $triplet{$arch}; my $cflags; my $cppflags;
# see if there is NDK clang on $PATH, "universal" or "standalone"
my $clang_path = which("clang");
my $is_valid_clang_path = ($clang_path =~ m|^$ndk/.*/prebuilt/([^/]+)/|)? "path valid" : "path invalid";
print "clang path found at -> $clang_path\n";
print "is valid clang path-> $is_valid_clang_path\n";
print "triarch path is -> $triarch\n";
I have found that the path it is checking for clang it is finding it as invalid in windows, I am getting logs as :
clang path found at -> C:\Users\user\AppData\Local\Android\Sdk\ndk\270~1.119\TOOLCH~1\llvm\prebuilt\WINDOW~1\bin\clang.EXE is valid clang path-> path invalid triarch path is -> arm-linux-androideabi
what sort of changes I make in regx to make it work for windows so that it find my clang directly as valid?
Cross-compiling for Android on Windows is not supported currently.
We would welcome pull requests that would add the support.
I am trying to build the static library for the android-arm platform from my windows 11 pc.
I have set the respective environment variables in windows from the NOTE-Android.md:-
I have ran the below command and came into issue:
`
I have done research on this issue before and found few of this as active issue, some are suggesting to use the linux but my project is built on windows and I require this library to work in android. I am using Microsoft visual studio 2022, using developer powershell by microsoft visual studio and running code in win32, but I need my current project in android application so I have to have a static file.
I have tried using wsl, but it is giving error
`
below is the configdata.pm --dump when using wsl:
Perl information:
Enabled features:
Disabled features:
Config target attributes:
Recorded environment:
Makevars:
NOTE: These variables only represent the configuration view. The build file template may have processed these variables further, please have a look at the build file for more exact data: Makefile
build file:
build file templates:
Can you please share any resource or something else I could you to fix this error and can run the same using windows machine for get static archive of android-arm.