diff --git a/backend/Dockerfile b/backend/Dockerfile index 6d554679e..7539b6454 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -55,6 +55,7 @@ RUN dpkg --add-architecture i386 \ binutils-mipsel-linux-gnu \ binutils-powerpc-linux-gnu \ binutils-sh-elf \ + bzip2 \ cpp \ dj64 \ dos2unix \ @@ -102,6 +103,11 @@ RUN wget "https://github.com/OmniBlade/binutils-gdb/releases/download/omf-build/ && tar xvzf omftools-linux-x86_64.tar.gz -C /usr/bin omf-nm omf-objdump \ && rm omftools-linux-x86_64.tar.gz +# Android binutils +RUN wget "https://github.com/decompme/compilers/releases/download/compilers/android-ndk-r8e-linux-x86_64.tar.bz2" \ + && bash -c 'tar xjvf android-ndk-r8e-linux-x86_64.tar.bz2 -C /usr/bin --strip-components=5 toolchains/x86-4.7/prebuilt/linux-x86_64/bin/i686-linux-android-{as,nm,objdump}' \ + && rm android-ndk-r8e-linux-x86_64.tar.bz2 + RUN mkdir -p /etc/fonts ENV WINEPREFIX=/tmp/wine diff --git a/backend/compilers/compilers.linux.yaml b/backend/compilers/compilers.linux.yaml index 4942b9e82..d5a527cf2 100644 --- a/backend/compilers/compilers.linux.yaml +++ b/backend/compilers/compilers.linux.yaml @@ -229,3 +229,6 @@ win32: - msvc7.1 - msvc8.0 - msvc8.0p + +android_x86: + - ndk-r8e-gcc-4.7 diff --git a/backend/coreapp/compilers.py b/backend/coreapp/compilers.py index 0d4354cef..7054aa19f 100644 --- a/backend/coreapp/compilers.py +++ b/backend/coreapp/compilers.py @@ -30,6 +30,7 @@ Language, ) from coreapp.platforms import ( + ANDROID_X86, GBA, GC_WII, IRIX, @@ -1564,6 +1565,12 @@ def available_platforms() -> List[Platform]: cc=BORLAND_MSDOS_CC, ) +ANDROID_R8E_C = GCCCompiler( + id="ndk-r8e-gcc-4.7", + platform=ANDROID_X86, + cc='"$COMPILER_DIR"/toolchains/x86-4.7/prebuilt/linux-x86_64/bin/i686-linux-android-gcc -c --sysroot="$COMPILER_DIR"/platforms/android-9/arch-x86 $COMPILER_FLAGS -o "$OUTPUT" "$INPUT"', +) + _all_compilers: List[Compiler] = [ DUMMY, DUMMY_LONGRUNNING, @@ -1804,6 +1811,8 @@ def available_platforms() -> List[Platform]: # Borland, DOS BORLAND_20_C, BORLAND_31_C, + # GCC, Android + ANDROID_R8E_C, ] _compilers = OrderedDict({c.id: c for c in _all_compilers if c.available()}) diff --git a/backend/coreapp/platforms.py b/backend/coreapp/platforms.py index 4f1598fcb..bba1d6cc9 100644 --- a/backend/coreapp/platforms.py +++ b/backend/coreapp/platforms.py @@ -262,6 +262,16 @@ def from_id(platform_id: str) -> Platform: has_decompiler=True, ) +ANDROID_X86 = Platform( + id="android_x86", + name="Android x86", + description="i686", + arch="i686", + assemble_cmd='i686-linux-android-as -o "$OUTPUT" "$PRELUDE" "$INPUT"', + objdump_cmd="i686-linux-android-objdump", + nm_cmd="i686-linux-android-nm", +) + _platforms: OrderedDict[str, Platform] = OrderedDict( { "dummy": DUMMY, @@ -281,5 +291,6 @@ def from_id(platform_id: str) -> Platform: "msdos": MSDOS, "wiiu": WIIU, "win32": WIN32, + "android_x86": ANDROID_X86, } ) diff --git a/frontend/src/components/PlatformSelect/PlatformIcon.tsx b/frontend/src/components/PlatformSelect/PlatformIcon.tsx index d4331af2e..5ea6d1ded 100644 --- a/frontend/src/components/PlatformSelect/PlatformIcon.tsx +++ b/frontend/src/components/PlatformSelect/PlatformIcon.tsx @@ -2,6 +2,7 @@ import Link from "next/link"; import { platformUrl } from "@/lib/api/urls"; +import LogoAndroid from "./android.svg"; import LogoDreamcast from "./dreamcast.svg"; import LogoGBA from "./gba.svg"; import LogoGCWii from "./gc_wii.svg"; @@ -38,6 +39,7 @@ const ICONS = { switch: LogoSwitch, saturn: LogoSaturn, dreamcast: LogoDreamcast, + android_x86: LogoAndroid, }; export const PLATFORMS = Object.keys(ICONS); diff --git a/frontend/src/components/PlatformSelect/android.svg b/frontend/src/components/PlatformSelect/android.svg new file mode 100644 index 000000000..5bb806543 --- /dev/null +++ b/frontend/src/components/PlatformSelect/android.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/frontend/src/lib/i18n/locales/en/compilers.json b/frontend/src/lib/i18n/locales/en/compilers.json index a2ca267f3..9c509e19d 100644 --- a/frontend/src/lib/i18n/locales/en/compilers.json +++ b/frontend/src/lib/i18n/locales/en/compilers.json @@ -251,6 +251,8 @@ "cygnus-2.7-96Q3": "cygnus-2.7-96Q3 SOA-960904", + "ndk-r8e-gcc-4.7": "Android NDK r8e (GCC 4.7)", + "armcc_opt_level": "Optimization level", "armcc_opt_level.-O0": "No optimization", "armcc_opt_level.-O1": "Some optimization",