LinuxPlatform: allow -64 flag with rpi target to force 64-bit ARM

Still 32-bit by default, though.
This commit is contained in:
Josh Tynjala
2023-03-01 13:52:13 -08:00
parent 35fcf9abdd
commit 60ac10aa50

View File

@@ -126,14 +126,16 @@ class LinuxPlatform extends PlatformTarget
} }
else if (architecture == Architecture.ARMV7) else if (architecture == Architecture.ARMV7)
{ {
// TODO: can we assume this is actually a Pi? probably not. -JT
isRaspberryPi = true; isRaspberryPi = true;
is64 = false;
} }
} }
if (project.targetFlags.exists("rpi")) if (project.targetFlags.exists("rpi"))
{ {
isRaspberryPi = true; isRaspberryPi = true;
is64 = false; is64 = !targetFlags.exists("64");
} }
if (project.targetFlags.exists("neko") || project.target != cast System.hostPlatform) if (project.targetFlags.exists("neko") || project.target != cast System.hostPlatform)
@@ -183,7 +185,7 @@ class LinuxPlatform extends PlatformTarget
} }
else if (isRaspberryPi) else if (isRaspberryPi)
{ {
ProjectHelper.copyLibrary(project, ndll, "RPi", "", ProjectHelper.copyLibrary(project, ndll, "RPi" + (is64 ? "64" : ""), "",
(ndll.haxelib != null (ndll.haxelib != null
&& (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dso" : ".ndll", applicationDirectory, && (ndll.haxelib.name == "hxcpp" || ndll.haxelib.name == "hxlibc")) ? ".dso" : ".ndll", applicationDirectory,
project.debug, targetSuffix); project.debug, targetSuffix);
@@ -384,17 +386,34 @@ class LinuxPlatform extends PlatformTarget
if (targetFlags.exists("rpi")) if (targetFlags.exists("rpi"))
{ {
commands.push([ if (is64)
"-Dlinux", {
"-Drpi", commands.push([
"-Dtoolchain=linux", "-Dlinux",
"-DBINDIR=RPi", "-Drpi",
"-DCXX=arm-linux-gnueabihf-g++", "-Dtoolchain=linux",
"-DHXCPP_M32", "-DBINDIR=RPi64",
"-DHXCPP_STRIP=arm-linux-gnueabihf-strip", "-DHXCPP_ARM64",
"-DHXCPP_AR=arm-linux-gnueabihf-ar", "-DCXX=aarch64-linux-gnu-g++",
"-DHXCPP_RANLIB=arm-linux-gnueabihf-ranlib" "-DHXCPP_STRIP=aarch64-linux-gnu-strip",
]); "-DHXCPP_AR=aarch64-linux-gnu-ar",
"-DHXCPP_RANLIB=aarch64-linux-gnu-ranlib"
]);
}
else
{
commands.push([
"-Dlinux",
"-Drpi",
"-Dtoolchain=linux",
"-DBINDIR=RPi",
"-DHXCPP_M32",
"-DCXX=arm-linux-gnueabihf-g++",
"-DHXCPP_STRIP=arm-linux-gnueabihf-strip",
"-DHXCPP_AR=arm-linux-gnueabihf-ar",
"-DHXCPP_RANLIB=arm-linux-gnueabihf-ranlib"
]);
}
} }
else if (targetFlags.exists("hl") && System.hostArchitecture == X64) else if (targetFlags.exists("hl") && System.hostArchitecture == X64)
{ {
@@ -482,7 +501,7 @@ class LinuxPlatform extends PlatformTarget
{ {
if (isRaspberryPi) if (isRaspberryPi)
{ {
context.ndlls[i].path = NDLL.getLibraryPath(ndll, "RPi", "lib", ".a", project.debug); context.ndlls[i].path = NDLL.getLibraryPath(ndll, "RPi" + (is64 ? "64" : ""), "lib", ".a", project.debug);
} }
else else
{ {