Bug 278858 - [GTK] [2.45.91] Fails to build in armhf: expected identifier before numeric constant
Summary: [GTK] [2.45.91] Fails to build in armhf: expected identifier before numeric c...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-29 07:46 PDT by Alberto Garcia
Modified: 2024-09-19 08:01 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Garcia 2024-08-29 07:46:39 PDT
This is the error message:

In file included from /usr/include/X11/Xlib.h:44,
                 from Source/WebKit/UIProcess/gtk/PointerLockManagerX11.cpp:32:
build-soup3/bmalloc/Headers/bmalloc/EligibilityResult.h:35:5: error: expected identifier before numeric constant
   35 |     Success,
      |     ^~~~~~~
build-soup3/bmalloc/Headers/bmalloc/EligibilityResult.h:35:5: error: expected ‘}’ before numeric constant


I think that the 'Success' macro in X11/X.h conflicts with the same value in the EligibilityKind enum:

https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/blob/xorgproto-2024.1/include/X11/X.h?ref_type=tags#L350

https://github.com/WebKit/WebKit/blob/webkitgtk-2.45.91/Source/bmalloc/bmalloc/EligibilityResult.h#L35

I haven't investigated yet why this is not happening in other architectures.
Comment 1 Alberto Garcia 2024-08-30 06:58:52 PDT
FWIW I can work around this by using the system malloc in this build.
Comment 2 Alberto Garcia 2024-09-19 07:43:15 PDT
Disabling bmalloc seems to be causing problems on armhf, see bug 279883

I managed to fix the build by changing the order of the Xlib.h include, but I still haven't checked why other architectures are not affected:

--- a/Source/WebKit/UIProcess/gtk/PointerLockManagerX11.cpp
+++ b/Source/WebKit/UIProcess/gtk/PointerLockManagerX11.cpp
@@ -29,10 +29,10 @@
 #if PLATFORM(X11)
 
 #include "WebPageProxy.h"
-#include <X11/Xlib.h>
 #include <gtk/gtk.h>
 #include <wtf/TZoneMallocInlines.h>
 #include <wtf/glib/GRefPtr.h>
+#include <X11/Xlib.h>
 
 #if USE(GTK4)
 #include <gdk/x11/gdkx.h>
Comment 3 Alberto Garcia 2024-09-19 08:01:21 PDT
And this is almost certainly the commit that introduced this build failure:

https://commits.webkit.org/282294@main

(the changes to PointerLockManagerX11.cpp)