pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: webkit24-gtk on/for powerpc



> On Sat, Aug 04, 2018 at 03:22:00PM +0200, Havard Eidnes wrote:
>> And ... the build is careful to hide the actual invocation of the
>> compiler, so this frustrates the tradutional method of manually
>> repeating the compiler invocation but with "-E -dD" and inspect the
>> results of the preprocessing logic, sigh!  How does people deal with
>> this?!?
>
> work.log

Thanks, that got me further.

Now I'm faced with this gem from Sources/autotools/SetupCompilerFlags.m4:

# Some architectures need to add libatomic explicitly
AC_LANG_PUSH([C++])
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <atomic>
int main() {
   std::atomic<int64_t> i(0);
   i++;
   return 0;
}
]])], has_atomic=yes, has_atomic=no)
AC_LANG_POP([C++])
if test "$has_atomic" = "no"; then
   LIBS="$LIBS -latomic"
fi

On 32-bit powerpc the C++ configure snippet program will fail to
link because we don't provide or emulate 8-byte atomics, so it
insists on adding -latomic which it can't find when linking the
first program.  I suspect that once I remove -latomic, the
resulting program will fail to link.

Boo!

Well, adding a test for "don't do this on NetBSD" got me further, and
at least across the first hurdle with linking the first program.
However, we build with -Wcast-align, and the code trips a massive
amount of "increases required alignemnt of target type" warnings, so
I'm not exactly confident this being able to work even if it does
manage to complete the build...

.... (some ~24 hours later) ...

The build completed without any fatal build errors!
And it even managed to install, yay!

Attached below is the diff I'm using now (omitting the diff to
distinfo).  Yes, I know, I disable YARR_JIT twice, while once should
be enough.

Regards,

- Håvard
Index: patches/patch-Source_WTF_wtf_Platform.h
===================================================================
RCS file: /cvsroot/pkgsrc/www/webkit24-gtk/patches/patch-Source_WTF_wtf_Platform.h,v
retrieving revision 1.3
diff -u -r1.3 patch-Source_WTF_wtf_Platform.h
--- patches/patch-Source_WTF_wtf_Platform.h	24 Apr 2017 15:40:12 -0000	1.3
+++ patches/patch-Source_WTF_wtf_Platform.h	7 Aug 2018 09:47:36 -0000
@@ -1,6 +1,7 @@
 $NetBSD: patch-Source_WTF_wtf_Platform.h,v 1.3 2017/04/24 15:40:12 wiz Exp $
 
-Add support for sparc and sparc64, disable ASSEMBLER and YARR_JIT for now
+Add support for sparc and sparc64, disable ASSEMBLER for now.
+Turn off YARR_JIT if JIT is turned off.
 
 --- Source/WTF/wtf/Platform.h.orig	2016-04-10 06:48:36.000000000 +0000
 +++ Source/WTF/wtf/Platform.h
@@ -31,25 +32,23 @@
      || CPU(MIPS64) \
      || CPU(PPC64) \
      || CPU(PPC64LE)
-@@ -824,7 +837,7 @@
- #define ENABLE_REGEXP_TRACING 0
- 
- /* Yet Another Regex Runtime - turned on by default for JIT enabled ports. */
--#if !defined(ENABLE_YARR_JIT) && (ENABLE(JIT) || ENABLE(LLINT_C_LOOP))
-+#if !defined(ENABLE_YARR_JIT) && (ENABLE(JIT) || ENABLE(LLINT_C_LOOP)) && !CPU(SPARC64) && !CPU(SPARC)
- #define ENABLE_YARR_JIT 1
- 
- /* Setting this flag compares JIT results with interpreter results. */
-@@ -837,10 +850,12 @@
- #if defined(ENABLE_ASSEMBLER) && !ENABLE_ASSEMBLER
- #error "Cannot enable the JIT or RegExp JIT without enabling the Assembler"
- #else
-+#if !CPU(SPARC) && !CPU(SPARC64)
- #undef ENABLE_ASSEMBLER
- #define ENABLE_ASSEMBLER 1
+@@ -668,6 +681,7 @@
+ /* Disable the JITs if we're forcing the cloop to be enabled */
+ #if defined(ENABLE_LLINT_C_LOOP) && ENABLE_LLINT_C_LOOP
+ #define ENABLE_JIT 0
++#define ENABLE_YARR_JIT 0
+ #define ENABLE_DFG_JIT 0
+ #define ENABLE_FTL_JIT 0
  #endif
+@@ -757,9 +771,11 @@
+ /* If the jit is not available, enable the LLInt C Loop: */
+ #if !ENABLE(JIT)
+ #undef ENABLE_LLINT        /* Undef so that we can redefine it. */
++#undef ENABLE_YARR_JIT     /* Undef so that we can redefine it. */
+ #undef ENABLE_LLINT_C_LOOP /* Undef so that we can redefine it. */
+ #undef ENABLE_DFG_JIT      /* Undef so that we can redefine it. */
+ #define ENABLE_LLINT 1
++#define ENABLE_YARR_JIT 0
+ #define ENABLE_LLINT_C_LOOP 1
+ #define ENABLE_DFG_JIT 0
  #endif
-+#endif
- 
- /* If the Disassembler is enabled, then the Assembler must be enabled as well: */
- #if ENABLE(DISASSEMBLER)
--- /dev/null	2018-08-07 11:44:14.052212330 +0200
+++ patches/patch-Source_autotools_SetupCompilerFlags.m4	2018-08-06 10:25:02.008246532 +0200
@@ -0,0 +1,18 @@
+$NetBSD$
+
+NetBSD doesn't have -latomic.
+
+--- Source/autotools/SetupCompilerFlags.m4.orig	2016-04-10 06:48:38.000000000 +0000
++++ Source/autotools/SetupCompilerFlags.m4
+@@ -69,6 +69,9 @@ int main() {
+ }
+ ]])], has_atomic=yes, has_atomic=no)
+ AC_LANG_POP([C++])
+-if test "$has_atomic" = "no"; then
+-   LIBS="$LIBS -latomic"
++if test "`(uname -s)`" != "NetBSD"; then
++   # no -latomic on NetBSD...
++   if test "$has_atomic" = "no"; then
++      LIBS="$LIBS -latomic"
++   fi
+ fi


Home | Main Index | Thread Index | Old Index