Linux/ppc64 - PM28.5.0 - fix for "compile time error: static assertion failed"

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
rpxrpx

Linux/ppc64 - PM28.5.0 - fix for "compile time error: static assertion failed"

Unread post by rpxrpx » 2019-05-24, 22:01

On Linux/PPC64 the compilation of Palemoon 28.5.0 fails during compile time because of failing static assertions. It looks like this on the terminal:
/usr/src/UXP-PM28.5.0_Release/js/src/gc/Heap.h:935:1: error: static assertion failed: Ensure our ChunkBitmap actually covers all arenas.
146:24.72 static_assert(ArenaBitmapBytes * ArenasPerChunk == sizeof(ChunkBitmap),
146:24.72 ^~~~~~~~~~~~~
146:24.72 /usr/src/UXP-PM28.5.0_Release/js/src/gc/Heap.h:948:1: error: static assertion failed: If the chunk padding is larger than an arena, we should have one more arena.
146:24.72 static_assert(ChunkPadSize < BytesPerArenaWithHeader,
146:24.72 ^~~~~~~~~~~~~
146:24.72 /usr/src/UXP-PM28.5.0_Release/js/src/gc/Heap.h:960:41: error: size of array ‘padding’ is negative
146:24.72 uint8_t padding[ChunkPadSize];
146:24.72 ^

Thanks to git bisect I could track the bug down. The commit a2786c051173286c9d7ccee2c3c6a19c15966322 changed the file js/src/jstypes.h:

from
)
-/* Additional GCC defines are when running on Solaris, AIX, and HPUX */
-# if defined(__x86_64__) || defined(__sparcv9) || \
- defined(__64BIT__) || defined(__LP64__)
-# define JS_64BIT
-# endif
-#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Sun Studio C/C++ */
-# if defined(__x86_64) || defined(__sparcv9)
#
to
+# if defined(__x86_64__) || defined(__64BIT__)
# define JS_64BIT
# endif
in short: sparcv9 and LP64 were removed. For reasons I do not know under Linux/ppc64 LP64 is defined, and 64BIT is not.

Palemoon 28.5.0 compiles fine if the check for LP64 is added again.
# if defined(__x86_64__) || defined(__64BIT__) || defined(__LP64__)

Dear developers, please change this back in the official source code.
You may refer to this in the bug tracker as issue 1092: https://github.com/MoonchildProductions/UXP/issues/1092

Furthermore I would welcome a short enlightenment about LP64. What exactly does it mean?

Thank you very much.

rpxrpx

Re: Linux/ppc64 - PM28.5.0 - fix for "compile time error: static assertion failed"

Unread post by rpxrpx » 2019-05-31, 21:28

To finalize this post I want to mention that the patch is included in the current trunk as e24e6346b70d3d212e9c9b7aa14f79f1d3ea86e8.

Many thanks go to wolfbeast who fixed this within 20 minutes after my post to this forum. :!:

:thumbup: :thumbup: :thumbup:

Locked