Hi,

jca@ found the missing symbol :)

Here is a diff that:

- fix the undefined reference to `WTF::Optional<unsigned long>
  JSC::parse<unsigned long>(char const*)'. The conditional is supposed
  to be '( OS(OPENBSD) && CPU(PPC) )' instead of using defined()s but
  the former does not work.
- drop the `__mulodi4' powerpc workaround since we use libcompiler_rt
  that provides this symbol
- Add a safety revision bump

It builds fine on powerpc [0] and amd64. The runtime improved compared
to previous versions, static html works now, but javascript leads to
blank pages, using www/surf.

Comments/feedback are welcome,

Charlène.


[0] https://bin.charlenew.xyz/webkitgtk4.log


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/webkitgtk4/Makefile,v
retrieving revision 1.117
diff -u -p -u -p -r1.117 Makefile
--- Makefile    13 Apr 2020 14:02:59 -0000      1.117
+++ Makefile    16 Apr 2020 10:35:25 -0000
@@ -13,6 +13,7 @@ PORTROACH =           limitw:1,even
 COMMENT =              GTK+ port of the WebKit rendering engine
 
 V =                    2.28.1
+REVISION =             0
 DISTNAME =             webkitgtk-${V}
 PKGNAME =              webkitgtk4-${V}
 EXTRACT_SUFX =         .tar.xz
Index: patches/patch-Source_JavaScriptCore_runtime_Options_cpp
===================================================================
RCS file: patches/patch-Source_JavaScriptCore_runtime_Options_cpp
diff -N patches/patch-Source_JavaScriptCore_runtime_Options_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-Source_JavaScriptCore_runtime_Options_cpp     16 Apr 2020 
10:35:25 -0000
@@ -0,0 +1,27 @@
+$OpenBSD$
+
+powerpc fix for:
+undefined reference to `WTF::Optional<unsigned long>
+JSC::parse<unsigned long>(char const*)'
+
+Index: Source/JavaScriptCore/runtime/Options.cpp
+--- Source/JavaScriptCore/runtime/Options.cpp.orig
++++ Source/JavaScriptCore/runtime/Options.cpp
+@@ -88,7 +88,7 @@ Optional<OptionsStorage::Unsigned> parse(const char* s
+     return WTF::nullopt;
+ }
+ 
+-#if CPU(ADDRESS64) || OS(DARWIN)
++#if CPU(ADDRESS64) || OS(DARWIN) || ( defined(__OpenBSD__) && 
defined(__powerpc__) )
+ template<>
+ Optional<OptionsStorage::Size> parse(const char* string)
+ {
+@@ -97,7 +97,7 @@ Optional<OptionsStorage::Size> parse(const char* strin
+         return value;
+     return WTF::nullopt;
+ }
+-#endif // CPU(ADDRESS64) || OS(DARWIN)
++#endif // CPU(ADDRESS64) || OS(DARWIN) || ( defined(__OpenBSD__) && 
defined(__powerpc__) )
+ 
+ template<>
+ Optional<OptionsStorage::Double> parse(const char* string)
Index: patches/patch-Source_WTF_wtf_CheckedArithmetic_h
===================================================================
RCS file: patches/patch-Source_WTF_wtf_CheckedArithmetic_h
diff -N patches/patch-Source_WTF_wtf_CheckedArithmetic_h
--- patches/patch-Source_WTF_wtf_CheckedArithmetic_h    25 Mar 2019 14:03:49 
-0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,52 +0,0 @@
-$OpenBSD: patch-Source_WTF_wtf_CheckedArithmetic_h,v 1.1 2019/03/25 14:03:49 
cwen Exp $
-
-macppc linking fix: with ports-clang, libgcc is used instead of compiler-rt,
-and it does not provide the __mulodi4 symbol used by clang for
-__builtin_mul_overflow.
-
-Other !base-clang archs should be added if they can
-go up to the final linking parts.
-
-see https://bugs.webkit.org/show_bug.cgi?id=190208
-
-Index: Source/WTF/wtf/CheckedArithmetic.h
---- Source/WTF/wtf/CheckedArithmetic.h.orig
-+++ Source/WTF/wtf/CheckedArithmetic.h
-@@ -31,6 +31,10 @@
- #include <stdint.h>
- #include <type_traits>
- 
-+#if COMPILER(GCC_COMPATIBLE) && !(defined(__clang__) && defined(__powerpc__))
-+#define USE_MUL_OVERFLOW 1
-+#endif
-+
- /* Checked<T>
-  *
-  * This class provides a mechanism to perform overflow-safe integer arithmetic
-@@ -360,7 +364,7 @@ template <typename LHS, typename RHS, typename ResultT
- 
-     static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) 
WARN_UNUSED_RETURN
-     {
--#if COMPILER(GCC_COMPATIBLE)
-+#if USE(MUL_OVERFLOW) 
-         ResultType temp;
-         if (__builtin_mul_overflow(lhs, rhs, &temp))
-             return false;
-@@ -433,7 +437,7 @@ template <typename LHS, typename RHS, typename ResultT
- 
-     static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) 
WARN_UNUSED_RETURN
-     {
--#if COMPILER(GCC_COMPATIBLE)
-+#if USE(MUL_OVERFLOW)
-         ResultType temp;
-         if (__builtin_mul_overflow(lhs, rhs, &temp))
-             return false;
-@@ -496,7 +500,7 @@ template <typename ResultType> struct ArithmeticOperat
- 
-     static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result)
-     {
--#if COMPILER(GCC_COMPATIBLE)
-+#if USE(MUL_OVERFLOW)
-         ResultType temp;
-         if (__builtin_mul_overflow(lhs, rhs, &temp))
-             return false;

Reply via email to