2022-05-02 10:51:51 +00:00
|
|
|
|
# Emerald GCC
|
|
|
|
|
|
2023-09-24 04:39:04 +00:00
|
|
|
|
[![Drone CI](https://img.shields.io/drone/build/perosar/emerald-gcc?logo=drone&logoColor=blue&server=https%3A%2F%2Fdrone.tildegit.org)](https://drone.envs.netg/perosar/emerald-gcc)
|
2022-05-02 10:51:51 +00:00
|
|
|
|
|
|
|
|
|
## About
|
|
|
|
|
|
|
|
|
|
A toolchain to cross compile to Android. This outputs executables that link against Android's libc(bionic).
|
|
|
|
|
This is a personal project.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Why
|
|
|
|
|
|
|
|
|
|
Android’s GCC was deprecated in favor of LLVM Clang and removed from Android in January 2020.
|
|
|
|
|
Some projects still require GCC for building.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## How to use
|
|
|
|
|
|
2023-09-24 04:39:04 +00:00
|
|
|
|
- Get tarball from latest [gitea release](https://tildegit.org/perosar/emerald-gcc/releases)
|
2022-05-02 10:51:51 +00:00
|
|
|
|
- Extract
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ tar -xJf file.tar.xz
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Modify PATH
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ export PATH="$(pwd)/aarch64-linux-android-emerald/bin:$PATH"
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Test
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
$ aarch64-linux-android-gcc --version
|
|
|
|
|
$ aarch64-linux-android-gcc test.c -o test
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Run on Android (e.g. with Termux)
|
|
|
|
|
|
|
|
|
|
## Target
|
|
|
|
|
|
|
|
|
|
Compiled executables should run properly on Android 8 and above.
|
|
|
|
|
|
|
|
|
|
## Credits
|
|
|
|
|
- Patches from [its-pointless](https://github.com/its-pointless)
|
|
|
|
|
- Patches from [Android GCC 4.9](https://android.googlesource.com/toolchain/gcc)
|
|
|
|
|
- Sysroot from [NDK](https://github.com/android/ndk)
|
2022-05-13 11:01:41 +00:00
|
|
|
|
- Align fix script from [termux-ndk](https://github.com/Lzhiyong/termux-ndk/blob/master/patches/align_fix.py)
|
2022-05-02 10:51:51 +00:00
|
|
|
|
- Wiki pages from [Termux](https://github.com/termux)
|