Bugzilla – Attachment 615 Details for
Bug 1014
support for mips/mipsel in gluegen2 version 2.1.5
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patch for mips/mipsel support
add-mips-support.patch (text/plain), 7.83 KB, created by
Dejan Latinovic
on 2014-05-30 18:01:01 CEST
(
hide
)
Description:
proposed patch for mips/mipsel support
Filename:
MIME Type:
Creator:
Dejan Latinovic
Created:
2014-05-30 18:01:01 CEST
Size:
7.83 KB
patch
obsolete
>diff -uNr gluegen2-2.1.5.orig/src/java/com/jogamp/common/os/MachineDescription.java gluegen2-2.1.5/src/java/com/jogamp/common/os/MachineDescription.java >--- gluegen2-2.1.5.orig/src/java/com/jogamp/common/os/MachineDescription.java 2014-03-10 13:56:04.000000000 +0000 >+++ gluegen2-2.1.5/src/java/com/jogamp/common/os/MachineDescription.java 2014-05-28 14:09:01.000000000 +0000 >@@ -60,7 +60,11 @@ > /** {@link Platform.CPUType#X86_64} Little Endian Windows */ > X86_64_WINDOWS(Platform.CPUType.X86_64), > /** {@link Platform.CPUType#SPARC_32} Big Endian Solaris */ >- SPARC_32_SUNOS(Platform.CPUType.SPARC_32); >+ SPARC_32_SUNOS(Platform.CPUType.SPARC_32), >+ /** {@link Platform.CPUType#MIPS_32} Big Endian Unix */ >+ MIPS_32_UNIX(Platform.CPUType.MIPS_32), >+ /** {@link Platform.CPUType#MIPSEL_32} Little Endian Unix */ >+ MIPSEL_32_UNIX(Platform.CPUType.MIPSEL_32); > > public final Platform.CPUType cpu; > >@@ -77,6 +81,7 @@ > private final static int[] size_x86_64_unix = { 4, 8, 4, 8, 16, 8, 4096 }; > private final static int[] size_x86_64_windows = { 4, 4, 4, 8, 16, 8, 4096 }; > private final static int[] size_sparc_32_sunos = { 4, 4, 4, 8, 16, 4, 8192 }; >+ private final static int[] size_mips_32_unix = { 4, 4, 4, 8, 8, 4, 4096 }; > > /* arch os i8, i16, i32, i64, int, long, float, doubl, ldoubl, ptr */ > private final static int[] align_armeabi = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 }; >@@ -86,6 +91,7 @@ > private final static int[] align_x86_64_unix = { 1, 2, 4, 8, 4, 8, 4, 8, 16, 8 }; > private final static int[] align_x86_64_windows = { 1, 2, 4, 8, 4, 4, 4, 8, 16, 8 }; > private final static int[] align_sparc_32_sunos = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 }; >+ private final static int[] align_mips_32_unix = { 1, 2, 4, 8, 4, 4, 4, 8, 8, 4 }; > > public enum StaticConfig { > /** {@link MachineDescription.ID#ARMle_EABI } */ >@@ -101,7 +107,11 @@ > /** {@link MachineDescription.ID#X86_64_WINDOWS } */ > X86_64_WINDOWS(ID.X86_64_WINDOWS, true, size_x86_64_windows, align_x86_64_windows), > /** {@link MachineDescription.ID#SPARC_32_SUNOS } */ >- SPARC_32_SUNOS(ID.SPARC_32_SUNOS, false, size_sparc_32_sunos, align_sparc_32_sunos); >+ SPARC_32_SUNOS(ID.SPARC_32_SUNOS, false, size_sparc_32_sunos, align_sparc_32_sunos), >+ /** {@link MachineDescription.ID#MIPS_32_UNIX } */ >+ MIPS_32_UNIX(ID.MIPS_32_UNIX, false, size_mips_32_unix, align_mips_32_unix), >+ /** {@link MachineDescription.ID#MIPSEL_32_UNIX } */ >+ MIPSEL_32_UNIX(ID.MIPSEL_32_UNIX, true, size_mips_32_unix, align_mips_32_unix); > > public final ID id; > public final MachineDescription md; >diff -uNr gluegen2-2.1.5.orig/src/java/com/jogamp/common/os/Platform.java gluegen2-2.1.5/src/java/com/jogamp/common/os/Platform.java >--- gluegen2-2.1.5.orig/src/java/com/jogamp/common/os/Platform.java 2014-05-26 14:57:41.000000000 +0000 >+++ gluegen2-2.1.5/src/java/com/jogamp/common/os/Platform.java 2014-05-28 14:09:01.000000000 +0000 >@@ -113,6 +113,8 @@ > MIPS_32( CPUFamily.MIPS, 0x0001), > /** MIPS 64bit */ > MIPS_64( CPUFamily.MIPS, 0x0002), >+ /** MIPS 32bit LE*/ >+ MIPSEL_32( CPUFamily.MIPS, 0x0004), > /** Itanium default */ > IA64( CPUFamily.IA64, 0x0000), > /** PA_RISC2_0 */ >diff -uNr gluegen2-2.1.5.orig/src/java/jogamp/common/os/MachineDescriptionRuntime.java gluegen2-2.1.5/src/java/jogamp/common/os/MachineDescriptionRuntime.java >--- gluegen2-2.1.5.orig/src/java/jogamp/common/os/MachineDescriptionRuntime.java 2014-03-10 13:56:04.000000000 +0000 >+++ gluegen2-2.1.5/src/java/jogamp/common/os/MachineDescriptionRuntime.java 2014-05-28 14:09:01.000000000 +0000 >@@ -78,6 +78,8 @@ > case ARMv5: > case ARMv6: > case ARMv7: >+ case MIPS_32: >+ case MIPSEL_32: > case SPARC_32: > case PPC: > return true; >@@ -95,6 +97,10 @@ > if( isCPUArch32Bit(cpuType) ) { > if( cpuType.getFamily() == Platform.CPUFamily.ARM && littleEndian) { > return StaticConfig.ARMle_EABI; >+ } else if( cpuType == Platform.CPUType.MIPS_32) { >+ return StaticConfig.MIPS_32_UNIX; >+ } else if( cpuType == Platform.CPUType.MIPSEL_32) { >+ return StaticConfig.MIPSEL_32_UNIX; > } else if( osType == Platform.OSType.WINDOWS ) { > return StaticConfig.X86_32_WINDOWS; > } else if( osType == Platform.OSType.MACOS ) { >diff -uNr gluegen2-2.1.5.orig/src/java/jogamp/common/os/PlatformPropsImpl.java gluegen2-2.1.5/src/java/jogamp/common/os/PlatformPropsImpl.java >--- gluegen2-2.1.5.orig/src/java/jogamp/common/os/PlatformPropsImpl.java 2014-03-10 13:56:04.000000000 +0000 >+++ gluegen2-2.1.5/src/java/jogamp/common/os/PlatformPropsImpl.java 2014-05-28 14:09:01.000000000 +0000 >@@ -298,6 +298,8 @@ > return CPUType.PPC; > } else if( archLower.equals("mips") ) { // android > return CPUType.MIPS_32; >+ } else if( archLower.equals("mipsel") ) { >+ return CPUType.MIPSEL_32; > } else { > throw new RuntimeException("Please port CPU detection to your platform (" + OS_lower + "/" + archLower + ")"); > } >@@ -406,6 +408,9 @@ > } else if ( eh.isMips() ) { > cpuType[0] = CPUType.MIPS_32; // FIXME > abiType[0] = ABIType.GENERIC_ABI; >+ } else if ( eh.isMipsel() ) { >+ cpuType[0] = CPUType.MIPSEL_32; >+ abiType[0] = ABIType.GENERIC_ABI; > } > res = eh; > } catch(Throwable t) { >@@ -501,6 +506,8 @@ > * <li>linux-i586</li> > * <li>linux-armv6</li> > * <li>linux-armv6hf</li> >+ * <li>linux-mips</li> >+ * <li>linux-mipsel</li> > * <li>android-armv6</li> > * <li>macosx-universal</li> > * <li>solaris-sparc</li> >@@ -525,6 +532,12 @@ > case ARMv7: > _os_and_arch = "armv6"; // TODO: sync with gluegen-cpptasks-base.xml > break; >+ case MIPS_32: >+ _os_and_arch = "mips"; >+ break; >+ case MIPSEL_32: >+ _os_and_arch = "mipsel"; >+ break; > case SPARC_32: > _os_and_arch = "sparc"; > break; >diff -uNr gluegen2-2.1.5.orig/src/java/jogamp/common/os/elf/ElfHeader.java gluegen2-2.1.5/src/java/jogamp/common/os/elf/ElfHeader.java >--- gluegen2-2.1.5.orig/src/java/jogamp/common/os/elf/ElfHeader.java 2014-03-10 13:56:04.000000000 +0000 >+++ gluegen2-2.1.5/src/java/jogamp/common/os/elf/ElfHeader.java 2014-05-28 14:10:07.000000000 +0000 >@@ -484,12 +484,19 @@ > > /** > * Returns true if {@link #getMachine() machine} is a 32 or 64 bit MIPS CPU >- * of type {@link #EM_MIPS}, {@link #EM_MIPS_X} or {@link #EM_MIPS_RS3_LE}. */ >+ * of type {@link #EM_MIPS} or {@link #EM_MIPS_X}. */ > public final boolean isMips() { > final short m = getMachine(); > return EM_MIPS == m || >- EM_MIPS_X == m || >- EM_MIPS_RS3_LE == m; >+ EM_MIPS_X == m; >+ } >+ >+ /** >+ * Returns true if {@link #getMachine() machine} is a 32 MIPS CPU >+ * of type {@link #EM_MIPS_RS3_LE}. */ >+ public final boolean isMipsel() { >+ final short m = getMachine(); >+ return EM_MIPS_RS3_LE == m; > } > > /** Returns the processor-specific flags associated with the file. */ >@@ -568,6 +575,8 @@ > machineS=", itanium"; > } else if( isMips() ) { > machineS=", mips"; >+ } else if( isMipsel() ) { >+ machineS=", mipsel"; > } else { > machineS=""; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1014
: 615