Description: add support for s390x arch. Author: Gilles Filippini --- /dev/null +++ b/make/scripts/make.gluegen.all.linux-s390x.sh @@ -0,0 +1,24 @@ +#! /bin/sh + +# -Dc.compiler.debug=true \ +# -Dgluegen.cpptasks.detected.os=true \ +# -DisUnix=true \ +# -DisLinux=true \ +# -DisLinuxX86=true \ +# -DisX11=true \ + +MACHINE=s390x +ARCH=s390x +TRIPLET=s390x-linux-gnu + +export TARGET_PLATFORM_LIBS=/usr/lib/$TRIPLET +export TARGET_JAVA_LIBS=/usr/lib/jvm/java-7-openjdk-$ARCH/jre/lib/$MACHINE + +export GLUEGEN_CPPTASKS_FILE="lib/gluegen-cpptasks-linux-$MACHINE.xml" + +#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org" +export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet" + +ant \ + -Drootrel.build=build-linux-$MACHINE \ + $* 2>&1 | tee make.gluegen.all.linux-$MACHINE.log --- a/src/java/jogamp/common/os/PlatformPropsImpl.java +++ b/src/java/jogamp/common/os/PlatformPropsImpl.java @@ -527,6 +527,7 @@ public abstract class PlatformPropsImpl *
  • linux-ia64
  • *
  • linux-sparcv9
  • *
  • linux-risc2.0
  • + *
  • linux-s390x
  • *
  • freebsd-i586
  • *
  • freebsd-amd64
  • *
  • hpux-hppa
  • @@ -593,6 +594,9 @@ public abstract class PlatformPropsImpl case PA_RISC2_0: _and_arch_tmp = "risc2.0"; break; + case S390X: + _and_arch_tmp = "s390x"; + break; default: throw new InternalError("Unhandled CPUType: "+cpuType); } --- a/src/java/jogamp/common/os/elf/ElfHeaderPart1.java +++ b/src/java/jogamp/common/os/elf/ElfHeaderPart1.java @@ -412,6 +412,15 @@ public class ElfHeaderPart1 { cpuName = "ppc64"; abiType = ABIType.GENERIC_ABI; break; + case EM_S390: + // Can be 32 or 64 bits + if( 64 == getArchClassBits() ) { + cpuName = "s390x"; + } else { + cpuName = "s390"; + } + abiType = ABIType.GENERIC_ABI; + break; case EM_SH: cpuName = "superh"; abiType = ABIType.GENERIC_ABI; --- a/src/java/com/jogamp/common/os/Platform.java +++ b/src/java/com/jogamp/common/os/Platform.java @@ -77,7 +77,9 @@ public class Platform extends PlatformPr /** Itanium */ IA64, /** Hitachi SuperH */ - SuperH; + SuperH, + /** IBM ESA/390 and zSystems */ + S390; } public enum CPUType { @@ -118,9 +120,13 @@ public class Platform extends PlatformPr /** SPARC 64bit, big endian */ SPARCV9_64(CPUFamily.SPARC, false), /** PA_RISC2_0 64bit, ??? endian */ - PA_RISC2_0(CPUFamily.PA_RISC, false); + PA_RISC2_0(CPUFamily.PA_RISC, false), // 17 + /** S390X 64bit big endian */ + S390X(CPUFamily.S390, true); + // 18 + public final CPUFamily family; public final boolean is32Bit; @@ -201,6 +207,8 @@ public class Platform extends PlatformPr return MIPS_32; } else if( cpuABILower.startsWith("superh") ) { return SuperH; + } else if( cpuABILower.equals("s390x") ) { + return S390X; } else { throw new RuntimeException("Please port CPUType detection to your platform (CPU_ABI string '" + cpuABILower + "')"); } --- a/src/java/com/jogamp/common/os/MachineDataInfo.java +++ b/src/java/com/jogamp/common/os/MachineDataInfo.java @@ -73,6 +73,7 @@ public class MachineDataInfo { private final static int[] align_sparc_32_sunos = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 }; private final static int[] align_x86_32_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 4, 4 }; private final static int[] align_lp64_unix = { 1, 2, 4, 8, 4, 8, 4, 8, 16, 8 }; + private final static int[] align_s390_64_unix = { 1, 2, 4, 8, 4, 8, 4, 8, 8, 8 }; private final static int[] align_x86_64_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 16, 8 }; /** @@ -108,9 +109,11 @@ public class MachineDataInfo { X86_32_WINDOWS( size_x86_32_windows, align_x86_32_windows), /** LP64 Unix, e.g.: {@link Platform.CPUType#X86_64} Unix, {@link Platform.CPUType#ARM64} EABI, {@link Platform.CPUType#PPC64} Unix, .. */ LP64_UNIX( size_lp64_unix, align_lp64_unix), + /** {@link Platform.CPUType#S390X} Unix */ + S390_64_UNIX( size_lp64_unix, align_s390_64_unix), /** {@link Platform.CPUType#X86_64} Windows */ X86_64_WINDOWS( size_x86_64_windows, align_x86_64_windows); - // 8 + // 9 public final MachineDataInfo md; --- a/src/java/jogamp/common/os/MachineDataInfoRuntime.java +++ b/src/java/jogamp/common/os/MachineDataInfoRuntime.java @@ -112,6 +112,8 @@ public class MachineDataInfoRuntime { } else { if( osType == Platform.OSType.WINDOWS ) { return StaticConfig.X86_64_WINDOWS; + } else if ( Platform.CPUType.S390X == cpuType ) { + return StaticConfig.S390_64_UNIX; } else { // for all 64bit unix types (x86_64, aarch64, sparcv9, ..) return StaticConfig.LP64_UNIX;