Bug 1056 - Wrong guess on the endianness of powerpc
Summary: Wrong guess on the endianness of powerpc
Status: RESOLVED FIXED
Alias: None
Product: Gluegen
Classification: JogAmp
Component: core (show other bugs)
Version: 2.3.0
Hardware: pc_ppc all
: --- enhancement
Assignee: Sven Gothel
URL:
Depends on: 1126
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-30 05:13 CEST by tmancill
Modified: 2019-03-29 17:54 CET (History)
0 users

See Also:
Type: ---
SCM Refs:
Workaround: ---


Attachments
scilab stacktrace on ppc (710 bytes, text/plain)
2014-08-30 05:13 CEST, tmancill
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tmancill 2014-08-30 05:13:14 CEST
Created attachment 627 [details]
scilab stacktrace on ppc

Hi - in looking at the source code, it it doesn't appear that powerpc is detected as little endian x86.  Attached is an example stack trace.
Comment 1 Sven Gothel 2014-10-09 07:41:08 CEST
The static configuration makes a wrong 'guess' here
and comparison w/ dynamic probing fails.

I assume the dynamic config to reflect the true values,
otherwise our probing is false.

We probe variable type size and alignment,
as well as other values using native code
from our native library.
Some values are probed via Java.

The static value probably is at fault here.

Incompatible fields:
             static:    dynamic:
littleEndian true       false
int64*       8 / 4      8 / 8
double*      8 / 4      8 / 8
ldouble*     12 / 4     16 / 16

(*) size/alignment

It could help if you send the whole log up until this failure
w/ all debug flags enabled!

Further, please add OS and CPU information.

If you are knowledgeable about CPU cpu configurations,
maybe you can help picking the proper 
static configuration: MachineDescriptionRuntime.getStatic().
  
The usage of static values is indeed a huge issue here.
The static version is used in generated structs for
length - and the offset is generated at compile time
using the alignment and the size.

We might could move the table generation to runtime,
which would allow us to drop the static config.
However, this would require us to rewrite 
package 'jogamp.common.os.elf',
which also uses structs from the ELF headers ..
which in turn determines which native library we load.

Full cycle: The latter also contains code for probing the dynamic values.

In short: Getting rid of static config will be some work.
Comment 2 Sven Gothel 2015-02-02 00:32:10 CET
'Should' be fixed by changes for Bug 1126.

In case this (or a related) issue still persists,
please reopen this bug and comment.

Note: I don't have PPC hardware here.
Comment 3 tmancill 2015-02-04 05:33:16 CET
(In reply to comment #2)
> 'Should' be fixed by changes for Bug 1126.
> 
> In case this (or a related) issue still persists,
> please reopen this bug and comment.
> 
> Note: I don't have PPC hardware here.

Thanks!  I'll test it and follow-up.