Coder Social home page Coder Social logo

gnustep / tools-android Goto Github PK

View Code? Open in Web Editor NEW
46.0 12.0 12.0 231 KB

Objective-C on Android with Foundation, CoreFoundation, and libdispatch.

License: MIT License

Shell 100.00%
android objective-c objective-c-plus-plus gnustep foundation corefoundation libdispatch

tools-android's Introduction

GNUstep Android Toolchain

CI

This project comprises a collection of scripts to build a GNUstep toolchain for Android. The toolchain can then be used in an Android project to compile and run Objective-C code using the Foundation and CoreFoundation libraries.

The toolchain is built using the Android NDK (installed e.g. via Android Studio), and is set up to target Android API level 24 (7.0 / Nougat) and all available Android ABIs (armeabi-v7a, arm64-v8a, x86, x86_64).

Libraries

The toolchain consists of the following libraries:

Requirements

Supported host platforms are macOS and Linux.

The toolchain requires the Android NDK, which can be installed via Android Studio’s SDK Manager. The NDK installation will be located using the ANDROID_NDK_ROOT environment variable if set, or otherwise it will use the latest version in ~/Library/Android/sdk/ndk (macOS) / ~/Android/sdk/ndk (Linux). A different NDK path can also be provided using the --ndk flag when building the toolchain (see below).

Please note that NDK r21 or later is required, as earlier NDK releases contain Clang versions with bugs which prevent usage of the gnustep-2.0 Objective-C runtime.

Installation

To install a pre-built release, download it from the releases on GitHub and unpack the "GNUstep" folder into the following location depending on your OS ($GNUSTEP_HOME):

  • macOS: ~/Library/Android/GNUstep
  • Linux: ~/Android/GNUstep

Using the Toolchain

The android-examples repository contains Android Studio and Qt example projects using this project that can be used as templates for integrating Objective-C code into new or existing Android projects.

To use the toolchain from an Android project, you can use $GNUSTEP_HOME/$ABI_NAME/bin/gnustep-config to obtain various flags that should be used to compile and link Objective-C files, e.g.:

  • gnustep-config --variable=CC
  • gnustep-config --objc-flags (or --debug-flags)
  • gnustep-config --base-libs

Call gnustep-config --help to obtain the full list of available variables.

Status and Known Issues

The toolchain is being used in production in an award-winnning music app available on Google Play.

Following are some notes and known issues about using GNUstep on Android.

  • GNUstep base currently has no native integration between the Android run-loop and NSRunLoop or the libdispatch main queue, so things like -performSelector:withObject:afterDelay: or dispatching on dispatch_get_main_queue() will not work out of the box. An integration depends on the setup of the app (e.g. whether using Android Studio, Qt, or something else), and is possible to add in the app by swizzing NSRunLoop. Feel free to open an issue if this is of interest to you and you would like more information.
  • GNUstep Base is integrated with Android’s app-specific storage and uses the path returned by Context.getFilesDir() as NSHomeDirectory() and when querying for directory paths (NSLibraryDirectory, NSApplicationSupportDirectory, etc.). It also uses Context.getCacheDir() as NSTemporaryDirectory and NSCachesDirectory (with NSUserDomainMask).
  • GNUstep Base is further integrated with the Android asset manager, and supports accessing the app’s resources from [NSBundle mainBundle] via APIs such as -pathForResource:ofType: and -URLForResource:ofType:, and reading them using NSFileManager, NSFileHandle, and NSDirectoryEnumerator APIs. This is done by returning paths from NSBundle APIs with a fixed, fake, per-app prefix (Context.getPackageCodePath() without extension + /Resources), which internally get routed through the NDK’s AAsset API for reading.
  • Note that NSDirectoryEnumerator is not able to enumerate directories in the app’s main bundle due to a limitation of the AAssetDir API.
  • The app must call GSInitializeProcessAndroid() (defined in NSProcessInfo.h) on launch in order to initialize the above Android-specific functionality in GNUstep.
  • GNUstep Base doesn’t currently get the system languages on Android, which combined with the inability to list directories in the main bundle (see above) means that NSLocalizedString() won’t work out of the box even if localized strings are present in the app’s assets. As a workaround, the app should manually call -[NSUserDefaults setUserLanguages:] with a list of supported locales ordered by the user’s system language preferences.
  • GNUstep Base will also currently not return the system locale as the current NSLocale on Android (the current locale will always default to en_US_POSIX). As a workaround, the app can manually set the system’s locale identifier for the key "Locale" in NSUserDefaults, and use -[NSLocale autoupdatingCurrentLocale] to retreive the locale.
  • Android will not output stdout or stderr to logcat by default, which might cause some log or error output from GNUstep or other libraries to be missing. You can run a thread in your app to write these streams to the Android log to work around this, which is recommended for debugging.

For the last three points above please refer to GSInitialize.m in the examples for details.

Prerequisites for Building

The following packages are required for building the toolchain.

macOS

Install required packages via Homebrew:

brew install git-lfs cmake autoconf automake libtool pkg-config
git lfs install

Linux

Install required packages via APT:

sudo apt install git git-lfs curl cmake make autoconf libtool pkg-config texinfo python3-distutils
git lfs install

Please note that you need to have CMake version 3.15.1 or later (for libdispatch).

Building the Toolchain

Run the build.sh script to build the toolchain yourself:

Usage: ./build.sh
  --prefix INSTALL_ROOT      Install toolchain into given directory (default: see below)
  --dist-root DIST_ROOT      Make toolchain relocatable to given path relative to home folder on other machines
                             (use "HOME" as placeholder for home folder, e.g. "HOME/Library/Android/GNUstep")
  -n, --ndk NDK_PATH         Path to existing Android NDK (default: ANDROID_NDK_ROOT)
  -a, --abis ABI_NAMES       ABIs being targeted (default: "armeabi-v7a arm64-v8a x86 x86_64")
  -l, --level API_LEVEL      Android API level being targeted (default: 23)
  -b, --build BUILD_TYPE     Build type "Debug" or "Release" or "RelWithDebInfo" (default: RelWithDebInfo)
  -u, --no-update            Don't update projects to latest version from GitHub
  -c, --no-clean             Don't clean projects during build (e.g. for building local changes, only applies to first ABI being built)
  -p, --patches DIR          Apply additional patches from given directory
  -o, --only PHASE           Build only the given phase (e.g. "gnustep-base", requires previous build)
  -h, --help                 Print usage information and exit

The toolchain builds and installs the GNUstep toolchain into the following location ($GNUSTEP_HOME):

  • macOS: ~/Library/Android/GNUstep
  • Linux: ~/Android/GNUstep

The build for each supported ABI is installed into its separate subfolder at that location (both libraries and header files differ per ABI).

Acknowledgements

Based on original work by Ivan Vučica.

tools-android's People

Contributors

gcasa avatar rupertdaniel avatar triplef avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tools-android's Issues

x86 build fails due relocation linker error against libffi on x86

With the latest libffi v3.4.3 update we get the following linker error:

 Linking library libgnustep-base ...
ld.lld: error: relocation R_386_PC32 cannot be used against symbol open_temp_exec_file; recompile with -fPIC
>>> defined in /build/x86/lib/libffi.a(closures.o)
>>> referenced by closures.c
>>>               closures.o:(dlmmap_locked) in archive /build/x86/lib/libffi.a
clang++: error: linker command failed with exit code 1 (use -v to see invocation)

The libffi issue contains more details.

CI macOS build failure in libffi

The latest CI run failed on macOS while building libffi for armeabi-v7a.

libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
MAKE aarch64-apple-darwin23.5.0 :        0 * all-configured
make[1]: *** No rule to make target `all-configured'.  Stop.
make: *** [all-configured] Error 2

I was unable to reproduce this locally so far.

Building libxml2 fails

Building the toolchain fails with the following error:

### Updating project
From https://github.com/GNOME/libxml2
* [new branch]        mainline   -> origin/mainline
Your configuration specifies to merge with the ref ‘refs/heads/master’
from the remote, but no such ref was fetched.

### phases/14-libxml2.sh failed for ABI armeabi-v7a

Build failure in libffi with NDK r26

Building with the newly released NDK 26.0.10792818 results in the following build error in libffi:

../src/tramp.c:262:22: error: call to undeclared function 'open_temp_exec_file'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  tramp_globals.fd = open_temp_exec_file ();
                     ^

This was already fixed in upstream libffi, but the fix is not yet part of a public release.

Build failure in libcurl with NDK r26

libcurl/lib/formdata.c:796:10: error: call to undeclared function 'fseeko'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  return fseeko(stream, (off_t)offset, whence);
         ^

This error was also discussed in curl/curl#12086.

Build fails in libdispatch on macOS 12.6

In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic:550:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__threading_support:14:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/chrono:829:
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/ratio:157:7: error: explicit specialization of undeclared template class '__ll_add'
class __ll_add<_Xp, _Yp, -1>
      ^       ~~~~~~~~~~~~~~
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/ratio:156:1: error: templates must have C++ linkage
template <intmax_t _Xp, intmax_t _Yp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/heron/Development/gnustep/tools-android/src/libdispatch/src/internal.h:323:1: note: extern "C" language linkage specification begins here
__BEGIN_DECLS
^
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/cdefs.h:46:23: note: expanded from macro '__BEGIN_DECLS'
#define __BEGIN_DECLS extern "C" {
                      ^
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/block.cpp:31:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/internal.h:666:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims.h:220:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims/atomic.h:38:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/14.0.6/include/stdatomic.h:45:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic:550:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__threading_support:14:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/chrono:829:
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/ratio:167:50: error: no template named '__static_sign'; did you mean '__static_max'?
template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
                                                 ^
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/type_traits:2090:8: note: '__static_max' declared here
struct __static_max;
       ^
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/block.cpp:31:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/internal.h:666:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims.h:220:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims/atomic.h:38:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/14.0.6/include/stdatomic.h:45:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic:550:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__threading_support:14:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/chrono:829:
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/ratio:167:1: error: templates must have C++ linkage
template <intmax_t _Xp, intmax_t _Yp, intmax_t = __static_sign<_Yp>::value>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/heron/Development/gnustep/tools-android/src/libdispatch/src/internal.h:323:1: note: extern "C" language linkage specification begins here
__BEGIN_DECLS
^
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/sys/cdefs.h:46:23: note: expanded from macro '__BEGIN_DECLS'
#define __BEGIN_DECLS extern "C" {
                      ^
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/block.cpp:31:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/internal.h:666:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims.h:220:
In file included from /Users/heron/Development/gnustep/tools-android/src/libdispatch/src/shims/atomic.h:38:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/14.0.6/include/stdatomic.h:45:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/atomic:550:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/__threading_support:14:
In file included from /Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/chrono:829:
/Users/heron/Library/Android/sdk/ndk/25.1.8937393/toolchains/llvm/prebuilt/darwin-x86_64/sysroot/usr/include/c++/v1/ratio:171:7: error: explicit specialization of undeclared template class '__ll_sub'
class __ll_sub<_Xp, _Yp, 1>
      ^       ~~~~~~~~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [src/CMakeFiles/dispatch.dir/block.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 38%] Built target bsdtests
make[1]: *** [src/CMakeFiles/dispatch.dir/all] Error 2
make: *** [all] Error 2

### phases/12-libdispatch.sh failed for ABI armeabi-v7a

The previous toolchain build has been restored. The failed build can be found at:

ndk

I appear to have the right NDK installed

Missing: How to configure Android project for GNUstep use

As an iOS developer with little Android experience (which makes GNUstep especially tempting) I had no problem going from the toolchain setup instructions to the sample project. However, configuring your own new or existing Android project for GNUstep is not yet documented.

Looking at the linked android-examples I tried the following (maybe this can be used as a draft for a new section at the end of the existing README, once it works):

  1. New project in Android Studio
    a. Basic Fragment with View Model
    b. Enable Kotlin

  2. Create folder app/src/main/cpp

  3. Add CMakeLists.txt () to cpp folder

  4. Edit CMakeLists.txt to include your Objective-C implementation (.m) files in OBJECTIVEC_SRCS

  5. Edit app/build.gradle. Add:

    externalNativeBuild {
    cmake {
    cppFlags ""
    }
    }
    ndk {
    // ABIs supported by GNUstep toolchain
    abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
    }

  6. Edit MainActivity class: Add

    init {
    System.loadLibrary(„native-lib“)
    }

So far this fails at System.loadLibrary("native-lib") with following error:

2020-02-12 12:32:19.933 985-985/zoziapps.ch.sousvidecelsius E/AndroidRuntime: FATAL EXCEPTION: main
Process: zoziapps.ch.sousvidecelsius, PID: 985
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt6__ndk111__call_onceERVmPvPFvS2_E" referenced by "/data/app/zoziapps.ch.sousvidecelsius-qgnwdnfRmeXSFCUffVd7bw==/lib/x86/libgnustep-base.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at zoziapps.ch.sousvidecelsius.MainActivity.(MainActivity.kt:15)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:43)
at android.app.Instrumentation.newActivity(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2831)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Issue building...

I have installed the latest Android Studio and NDK. I am getting the following failure... I believe it didn't properly patch libffi...

### Building
MAKE i386-apple-darwin23.5.0 :        0 * all-all
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in include
make[3]: Nothing to be done for `all'.
Making all in testsuite
make[3]: Nothing to be done for `all'.
Making all in man
make[3]: Nothing to be done for `all'.
depbase=`echo src/arm/ffi.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/arm/ffi.lo -MD -MP -MF $depbase.Tpo -c -o src/arm/ffi.lo ../src/arm/ffi.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/arm/sysv.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src  -I. -I../include -Iinclude -I../src -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -MT src/arm/sysv.lo -MD -MP -MF $depbase.Tpo -c -o src/arm/sysv.lo ../src/arm/sysv.S &&\
	mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/arm/ffi.lo -MD -MP -MF src/arm/.deps/ffi.Tpo -c ../src/arm/ffi.c -o src/arm/ffi.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -I. -I../include -Iinclude -I../src -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -MT src/arm/sysv.lo -MD -MP -MF src/arm/.deps/sysv.Tpo -c ../src/arm/sysv.S -o src/arm/sysv.o
depbase=`echo src/prep_cif.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/prep_cif.lo -MD -MP -MF $depbase.Tpo -c -o src/prep_cif.lo ../src/prep_cif.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/types.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/types.lo -MD -MP -MF $depbase.Tpo -c -o src/types.lo ../src/types.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/raw_api.lo ../src/raw_api.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/java_raw_api.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/java_raw_api.lo -MD -MP -MF $depbase.Tpo -c -o src/java_raw_api.lo ../src/java_raw_api.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/closures.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/closures.lo -MD -MP -MF $depbase.Tpo -c -o src/closures.lo ../src/closures.c &&\
	mv -f $depbase.Tpo $depbase.Plo
depbase=`echo src/tramp.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
	/bin/sh ./libtool  --tag=CC   --mode=compile /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I..  -I. -I../include -Iinclude -I../src   -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/tramp.lo -MD -MP -MF $depbase.Tpo -c -o src/tramp.lo ../src/tramp.c &&\
	mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/closures.lo -MD -MP -MF src/.deps/closures.Tpo -c ../src/closures.c -o src/closures.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/java_raw_api.lo -MD -MP -MF src/.deps/java_raw_api.Tpo -c ../src/java_raw_api.c -o src/java_raw_api.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/types.lo -MD -MP -MF src/.deps/types.Tpo -c ../src/types.c -o src/types.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/raw_api.lo -MD -MP -MF src/.deps/raw_api.Tpo -c ../src/raw_api.c -o src/raw_api.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/prep_cif.lo -MD -MP -MF src/.deps/prep_cif.Tpo -c ../src/prep_cif.c -o src/prep_cif.o
libtool: compile:  /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang -DHAVE_CONFIG_H -I. -I.. -I. -I../include -Iinclude -I../src -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -MT src/tramp.lo -MD -MP -MF src/.deps/tramp.Tpo -c ../src/tramp.c -o src/tramp.o
../src/java_raw_api.c:328:46: warning: 'ffi_java_raw_size' is deprecated [-Wdeprecated-declarations]
  328 |   ffi_java_raw *raw = (ffi_java_raw*)alloca (ffi_java_raw_size (cif));
      |                                              ^
include/ffi.h:315:56: note: 'ffi_java_raw_size' has been explicitly marked deprecated here
  315 | size_t ffi_java_raw_size (ffi_cif *cif) __attribute__((deprecated));
      |                                                        ^
../src/java_raw_api.c:331:3: warning: 'ffi_java_ptrarray_to_raw' is deprecated [-Wdeprecated-declarations]
  331 |   ffi_java_ptrarray_to_raw (cif, avalue, raw);
      |   ^
include/ffi.h:311:93: note: 'ffi_java_ptrarray_to_raw' has been explicitly marked deprecated here
  311 | void ffi_java_ptrarray_to_raw (ffi_cif *cif, void **args, ffi_java_raw *raw) __attribute__((deprecated));
      |                                                                                             ^
In file included from ../src/closures.c:572:
../src/dlmalloc.c:3390:7: warning: variable 'nfences' set but not used [-Wunused-but-set-variable]
 3390 |   int nfences = 0;
      |       ^
2 warnings generated.
1 warning generated.
/bin/sh ./libtool  --tag=CC   --mode=link /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang  -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions  -L/Users/heron/Library/Android/GNUstep/armeabi-v7a/lib -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--gc-sections -Wl,--exclude-libs,libunwind.a -o libffi_convenience.la  src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/tramp.lo   src/arm/ffi.lo src/arm/sysv.lo -lc++_shared
/bin/sh ./libtool  --tag=CC   --mode=link /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/armv7a-linux-androideabi24-clang  -Wall -g -O2 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -fPIC -mthumb -fexceptions -no-undefined -version-info `grep -v '^#' ../libtool-version`   '-L/Users/heron/Library/Android/GNUstep/armeabi-v7a/lib' -Xcompiler '-fuse-ld=lld' '-Wl,--build-id=sha1' '-Wl,--no-rosegment' '-Wl,--gc-sections' '-Wl,--exclude-libs,libunwind.a'  -L/Users/heron/Library/Android/GNUstep/armeabi-v7a/lib -fuse-ld=lld -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--gc-sections -Wl,--exclude-libs,libunwind.a -o libffi.la -rpath /Users/heron/Library/Android/GNUstep/armeabi-v7a/lib src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/tramp.lo  src/arm/ffi.lo src/arm/sysv.lo -lc++_shared
libtool: link: /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar cr .libs/libffi_convenience.a  src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/tramp.o src/arm/ffi.o src/arm/sysv.o
libtool: link: /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ar cr .libs/libffi.a  src/prep_cif.o src/types.o src/raw_api.o src/java_raw_api.o src/closures.o src/tramp.o src/arm/ffi.o src/arm/sysv.o
libtool: link: /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib .libs/libffi_convenience.a
libtool: link: /Users/heron/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-ranlib .libs/libffi.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
MAKE i386-apple-darwin23.5.0 :        0 * all-configured
make[1]: *** No rule to make target `all-configured'.  Stop.
make: *** [all-configured] Error 2

### phases/13-libffi.sh failed for ABI armeabi-v7a

Building with NDK r25 fails

The default NDK version of the GitHub Actions runner images has been updated to r25, which makes the CI builds fail with the following error:

CMake Error at /Users/runner/Library/Android/sdk/ndk/25.1.8937393/build/cmake/android-legacy.toolchain.cmake:168 (message): 15866 Disabling Neon is no longer supported

CI: fix automatic pre-release

The latest CI builds failed in the prerelease stage because artifact download failed, so the builds were not uploaded to the prerelease:

Run actions/download-artifact@v3
No artifact name specified, downloading all artifacts
Creating an extra directory for each artifact that is being downloaded
Unable to find any artifacts for the associated workflow
There were 0 artifacts downloaded

It might be that this is related to actions/upload-artifact@v3 being deprecated, maybe updating to v4 could fix this.

libxml2 not found when building libxslt

[...]
checking for fprintf... yes
checking for snprintf... yes
checking for vfprintf... yes
checking for vsprintf... yes
checking for vsnprintf... yes
checking for sscanf... yes
checking for clock_gettime... yes
checking for perl... perl
checking for python... /usr/bin/python
PYTHON is pointing at /usr/bin/python
Found Python version 2.7
Found libxml2-python module
could not find python2.7/Python.h
Disabling crypto support
Enabling debugger
Enabling profiler
checking for armv7a-linux-androideabi-xml2-config... no
checking for xml2-config... /Users/jbheuschen/Library/Android/GNUstep/armeabi-v7a/bin/xml2-config
configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/.

### phases/17-libxslt.sh failed for ABI armeabi-v7a

The previous toolchain build has been restored. The failed build can be found at:
/Users/jbheuschen/Library/Android/GNUstep.failed

Unfortunately, I'm unable to build the project as the libxslt-phase always fails to configure, saying it couldn't find the previously-built libxml2. The libxml2 build-phase, however, compiles and installs successfully. Hence, the libxml2 files in "Android/GNUStep/amreabi-v7a" are present, too. I have to admit, though, that I'm not very experienced with this kind of stuff - I hope I didn't miss something. Is this a known problem and can it be fixed? Thanks in advance for any help!

My system:
OS: macOS 11.3.1 (M1/arm64)
CMake: 3.20.2
Android NDK: 22.1.7171670
build.log

How can I learn more about it?

Hi,

I would like to know more about the project.
Put simply, what’s this about and what I can do with this? Writing Android apps using Objective-C?
What would be the pros?

Best

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.