unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Liliana Marie Prikler <liliana.prikler@ist.tugraz.at>,
	51591@debbugs.gnu.org
Subject: bug#51591: webkitgtk fails to build on i686-linux; possibly a clang issue
Date: Fri, 05 Nov 2021 15:42:55 -0400	[thread overview]
Message-ID: <878ry2v15x.fsf@netris.org> (raw)
In-Reply-To: <9dd1626d19a68eb6ff1f51d1324692c7801b1ee7.camel@ist.tugraz.at>

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> writes:

> Am Donnerstag, den 04.11.2021, 19:15 -0400 schrieb Mark H Weaver:
[...]
>> A more conservative approach would be to apply a patch to
>> trunk/Source/WTF/wtf/CheckedArithmetic.h analogous to the one in the
>> second link I cited above, namely this one:
>> 
>>   https://trac.webkit.org/changeset/272140/webkit
>> 
>> However, it would need to be changed slightly.  The patch above
>> arranges to avoid using __builtin_mul_overflow on 32-bit ARM
>> systems.  We would need to do the same for 32-bit x86 as well.  So,
>> where the patch above has this:
>> 
>> --8<---------------cut here---------------start------------->8---
>> /* On Linux with clang, libgcc is usually used instead of compiler-
>> rt, and it does    
>>  * not provide the __mulodi4 symbol used by clang for
>> __builtin_mul_overflow    
>>  */    
>> #if COMPILER(GCC) || (COMPILER(CLANG) && !(CPU(ARM) &&
>> OS(LINUX)))    
>> #define USE_MUL_OVERFLOW 1    
>> #endif    
>> --8<---------------cut here---------------end--------------->8---
>> 
>> We would need to change "CPU(ARM)" to "(CPU(ARM) || CPU(XXX))", where
>> XXX is the appropriate symbol for 32-bit x86.  Or maybe there's
>> another solution.
>> 
>> I won't be able to look at this in the next couple of days, so
>> hopefully someone else can pick this up.
> The #else case doesn't look so bad on this, so we could for the time
> being just do #if COMPILER(GCC) or even #if 0.

I just noticed that the aforementioned patch is already applied to
upstream WebKitGTK-2.34.1, so all we would need to do is change "1" to
"0" in the following line on i686-linux systems:

  #define USE_MUL_OVERFLOW 1

I pushed the following (untested) commit to 'gnuzilla-updates' that does
exactly this, and does so in such a way that rebuilds will not be needed
on other systems.  Hopefully I didn't make a mistake.

     Regards,
       Mark


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] UNTESTED: gnu: webkitgtk: Fix build on i686-linux --]
[-- Type: text/x-patch, Size: 1889 bytes --]

From 7aaedf5d77bb0e088601f15bbbed8f7835bde774 Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Fri, 5 Nov 2021 15:31:07 -0400
Subject: [PATCH] UNTESTED: gnu: webkitgtk: Fix build on i686-linux.

Fixes <https://bugs.gnu.org/51591>.

* gnu/packages/webkit.scm (webkitgtk)[arguments]: Use quasiquote for the
argument list.  When building on i686-linux, insert a 'substitute*' form in
the 'prepare-build-environment' phase that disables of the use of
'__builtin_mul_overflow'.
---
 gnu/packages/webkit.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/webkit.scm b/gnu/packages/webkit.scm
index e54b680855..a184cc9b32 100644
--- a/gnu/packages/webkit.scm
+++ b/gnu/packages/webkit.scm
@@ -241,7 +241,7 @@ acceleration in mind, leveraging common 3D graphics APIs for best performance.")
     (build-system cmake-build-system)
     (outputs '("out" "doc"))
     (arguments
-     '(#:tests? #f ; no tests
+     `(#:tests? #f ; no tests
        #:build-type "Release" ; turn off debugging symbols to save space
        #:configure-flags (list
                           "-DPORT=GTK"
@@ -299,6 +299,13 @@ acceleration in mind, leveraging common 3D graphics APIs for best performance.")
            (lambda* (#:key inputs #:allow-other-keys)
              (setenv "CC" "clang")
              (setenv "CXX" "clang++")
+             ;; XXX Until we switch back to using GCC,
+             ;; work around <https://bugs.gnu.org/51591>.
+             ,@(if (string=? "i686-linux" (%current-system))
+                   '((substitute* "Source/WTF/wtf/CheckedArithmetic.h"
+                       (("#define USE_MUL_OVERFLOW 1")
+                        "#define USE_MUL_OVERFLOW 0")))
+                   '())
              #t))
          (add-after 'install 'move-doc-files
            (lambda* (#:key outputs #:allow-other-keys)
-- 
2.31.1


[-- Attachment #3: Type: text/plain, Size: 154 bytes --]


-- 
Disinformation flourishes because many people care deeply about injustice
but very few check the facts.  Ask me about <https://stallmansupport.org>.

  parent reply	other threads:[~2021-11-05 19:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-03 18:25 bug#51591: webkitgtk fails to build on i686-linux; possibly a clang issue Mark H Weaver
2021-11-03 21:04 ` Mark H Weaver
2021-11-04  8:03   ` Liliana Marie Prikler
2021-11-04 23:15     ` Mark H Weaver
2021-11-05  8:08       ` Liliana Marie Prikler
2021-11-05 16:24         ` Leo Famulari
2021-11-05 19:16           ` Mark H Weaver
2021-11-05 19:42         ` Mark H Weaver [this message]
2021-11-05 20:11           ` Maxime Devos
2021-11-06  6:09             ` Mark H Weaver
2021-11-07  5:46               ` Mark H Weaver
2021-11-06  7:34           ` Mark H Weaver
2021-11-05  2:38   ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878ry2v15x.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=51591@debbugs.gnu.org \
    --cc=liliana.prikler@ist.tugraz.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).