From 625a84d59064832fb15d30029429e767b999163b Mon Sep 17 00:00:00 2001 From: gohai Date: Thu, 6 Apr 2017 16:07:37 +0200 Subject: [PATCH 1/7] ARM: Add arm64 support to build.xml Currently untested. --- build/build.xml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/build/build.xml b/build/build.xml index adc15e658..7f60a1f3a 100644 --- a/build/build.xml +++ b/build/build.xml @@ -32,13 +32,25 @@ + + + + + + + + - + + + + + @@ -348,11 +360,13 @@ + - - + + + @@ -750,7 +764,7 @@ - + @@ -932,12 +946,18 @@ + + + + + + From cb8e37ed43498e9ad368970b0082e66ba99e01ff Mon Sep 17 00:00:00 2001 From: gohai Date: Tue, 11 Apr 2017 14:43:50 +0200 Subject: [PATCH 2/7] ARM: Don't attempt to build JavaFX on arm64 --- core/build.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/build.xml b/core/build.xml index 4a9d56a45..0b82eba67 100644 --- a/core/build.xml +++ b/core/build.xml @@ -37,7 +37,10 @@ - + + + + From 5a5524b19718ad32835adaf0248fb582baf938e2 Mon Sep 17 00:00:00 2001 From: gohai Date: Thu, 6 Apr 2017 16:42:19 +0200 Subject: [PATCH 3/7] ARM: Add arm64 support to app, core & mode Currently untested. --- app/src/processing/app/Library.java | 23 ++++++++++++++++++-- app/src/processing/app/Platform.java | 7 +++++- core/library/export.txt | 4 +++- java/src/processing/mode/java/JavaBuild.java | 6 ++++- 4 files changed, 35 insertions(+), 5 deletions(-) diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 757449a64..1f2029e41 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -71,6 +71,7 @@ public class Library extends LocalContribution { if (name.equals("linux32")) return false; if (name.equals("linux64")) return false; if (name.equals("linux-armv6hf")) return false; + if (name.equals("linux-arm64")) return false; if (name.equals("android")) return false; } return true; @@ -173,6 +174,12 @@ public class Library extends LocalContribution { nativeLibraryFolder = hostLibrary; } } + if (hostPlatform.equals("linux") && System.getProperty("os.arch").equals("aarch64")) { + hostLibrary = new File(libraryFolder, "linux-arm64"); + if (hostLibrary.exists()) { + nativeLibraryFolder = hostLibrary; + } + } // save that folder for later use nativeLibraryPath = nativeLibraryFolder.getAbsolutePath(); @@ -183,6 +190,7 @@ public class Library extends LocalContribution { String platformName32 = platformName + "32"; String platformName64 = platformName + "64"; String platformNameArmv6hh = platformName + "-armv6hf"; + String platformNameArm64 = platformName + "-arm64"; // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file. // These will override anything in the platform-specific subfolders. @@ -194,6 +202,8 @@ public class Library extends LocalContribution { String[] platformList64 = platform64 == null ? null : PApplet.splitTokens(platform64, ", "); String platformArmv6hf = exportTable.get("application." + platformName + "-armv6hf"); String[] platformListArmv6hf = platformArmv6hf == null ? null : PApplet.splitTokens(platformArmv6hf, ", "); + String platformArm64 = exportTable.get("application." + platformName + "-arm64"); + String[] platformListArm64 = platformArm64 == null ? null : PApplet.splitTokens(platformArm64, ", "); // If nothing specified in the export.txt entries, look for the platform-specific folders. if (platformAll == null) { @@ -208,14 +218,17 @@ public class Library extends LocalContribution { if (platformListArmv6hf == null) { platformListArmv6hf = listPlatformEntries(libraryFolder, platformNameArmv6hh, baseList); } + if (platformListArm64 == null) { + platformListArm64 = listPlatformEntries(libraryFolder, platformNameArm64, baseList); + } - if (platformList32 != null || platformList64 != null || platformListArmv6hf != null) { + if (platformList32 != null || platformList64 != null || platformListArmv6hf != null || platformListArm64 != null) { multipleArch[i] = true; } // if there aren't any relevant imports specified or in their own folders, // then use the baseList (root of the library folder) as the default. - if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null) { + if (platformList == null && platformList32 == null && platformList64 == null && platformListArmv6hf == null && platformListArm64 == null) { exportList.put(platformName, baseList); } else { @@ -233,6 +246,9 @@ public class Library extends LocalContribution { if (platformListArmv6hf != null) { exportList.put(platformNameArmv6hh, platformListArmv6hf); } + if (platformListArm64 != null) { + exportList.put(platformNameArm64, platformListArm64); + } } } // for (String p : exportList.keySet()) { @@ -412,6 +428,9 @@ public class Library extends LocalContribution { } else if (variant.equals("armv6hf")) { String[] pieces = exportList.get(platformName + "-armv6hf"); if (pieces != null) return pieces; + } else if (variant.equals("arm64")) { + String[] pieces = exportList.get(platformName + "-arm64"); + if (pieces != null) return pieces; } return exportList.get(platformName); } diff --git a/app/src/processing/app/Platform.java b/app/src/processing/app/Platform.java index 93b62d4c8..89315b92a 100644 --- a/app/src/processing/app/Platform.java +++ b/app/src/processing/app/Platform.java @@ -195,6 +195,7 @@ public class Platform { * Return the value of the os.arch property */ static public String getNativeArch() { + // This will return "arm" for 32-bit ARM, "aarch64" for 64-bit ARM (both on Linux) return System.getProperty("os.arch"); } @@ -211,8 +212,12 @@ public class Platform { static public String getVariant(int platform, String arch, int bits) { if (platform == PConstants.LINUX && bits == 32 && "arm".equals(Platform.getNativeArch())) { - return "armv6hf"; // assume armv6hf for now + return "armv6hf"; // assume armv6hf + } else if (platform == PConstants.LINUX && + bits == 64 && "aarch64".equals(Platform.getNativeArch())) { + return "arm64"; } + return Integer.toString(bits); // 32 or 64 } diff --git a/core/library/export.txt b/core/library/export.txt index 88d0bc274..e560112de 100644 --- a/core/library/export.txt +++ b/core/library/export.txt @@ -8,4 +8,6 @@ application.windows32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-wind application.windows64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-windows-amd64.jar,gluegen-rt-natives-windows-amd64.jar application.linux32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar application.linux64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar -application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar \ No newline at end of file +application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar +# XXX: needs JOGL build +application.linux-arm64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar diff --git a/java/src/processing/mode/java/JavaBuild.java b/java/src/processing/mode/java/JavaBuild.java index 5c9c2a9d6..14c7e8e5f 100644 --- a/java/src/processing/mode/java/JavaBuild.java +++ b/java/src/processing/mode/java/JavaBuild.java @@ -709,11 +709,15 @@ public class JavaBuild { return false; } if (platform == PConstants.LINUX) { - // export the armv6hf version as well + // export the arm versions as well folder = new File(sketch.getFolder(), "application.linux-armv6hf"); if (!exportApplication(folder, platform, "armv6hf", embedJava && (bits == 32) && "arm".equals(arch))) { return false; } + folder = new File(sketch.getFolder(), "application.linux-arm64"); + if (!exportApplication(folder, platform, "arm64", embedJava && (bits == 64) && "aarch64".equals(arch))) { + return false; + } } } else { // just make a single one for this platform folder = new File(sketch.getFolder(), "application." + platformName); From 3f7a688cb327ee18fbe38f5e1e43d3fd6825a86c Mon Sep 17 00:00:00 2001 From: gohai Date: Thu, 6 Apr 2017 16:43:57 +0200 Subject: [PATCH 4/7] ARM: Fix typo s/platformNameArmv6hh/platformNameArmv6hf/ --- app/src/processing/app/Library.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/processing/app/Library.java b/app/src/processing/app/Library.java index 1f2029e41..12c15b146 100644 --- a/app/src/processing/app/Library.java +++ b/app/src/processing/app/Library.java @@ -189,7 +189,7 @@ public class Library extends LocalContribution { String platformName = platformNames[i]; String platformName32 = platformName + "32"; String platformName64 = platformName + "64"; - String platformNameArmv6hh = platformName + "-armv6hf"; + String platformNameArmv6hf = platformName + "-armv6hf"; String platformNameArm64 = platformName + "-arm64"; // First check for things like 'application.macosx=' or 'application.windows32' in the export.txt file. @@ -216,7 +216,7 @@ public class Library extends LocalContribution { platformList64 = listPlatformEntries(libraryFolder, platformName64, baseList); } if (platformListArmv6hf == null) { - platformListArmv6hf = listPlatformEntries(libraryFolder, platformNameArmv6hh, baseList); + platformListArmv6hf = listPlatformEntries(libraryFolder, platformNameArmv6hf, baseList); } if (platformListArm64 == null) { platformListArm64 = listPlatformEntries(libraryFolder, platformNameArm64, baseList); @@ -244,7 +244,7 @@ public class Library extends LocalContribution { exportList.put(platformName64, platformList64); } if (platformListArmv6hf != null) { - exportList.put(platformNameArmv6hh, platformListArmv6hf); + exportList.put(platformNameArmv6hf, platformListArmv6hf); } if (platformListArm64 != null) { exportList.put(platformNameArm64, platformListArm64); From c03263f282226c1fc6c3cc5f50a19a055d322dea Mon Sep 17 00:00:00 2001 From: gohai Date: Thu, 6 Apr 2017 16:56:11 +0200 Subject: [PATCH 5/7] ARM: Add arm64 JOGL build This is taken from http://labb.zafena.se/jogamp/aarch64/aarch64-jogamp-2.4-git.tar.gz, and probably based on: https://github.com/xranby/gluegen/commits/aarch64 https://github.com/xranby/jogl/commits/aarch64 Currently untested. --- core/library/export.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/library/export.txt b/core/library/export.txt index e560112de..a75048970 100644 --- a/core/library/export.txt +++ b/core/library/export.txt @@ -9,5 +9,4 @@ application.windows64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-wind application.linux32=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar application.linux64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar application.linux-armv6hf=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar -# XXX: needs JOGL build -application.linux-arm64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-armv6hf.jar,gluegen-rt-natives-linux-armv6hf.jar +application.linux-arm64=core.jar,jogl-all.jar,gluegen-rt.jar,jogl-all-natives-linux-aarch64.jar,gluegen-rt-natives-linux-aarch64.jar