Bug 159124 - [GTK] 2.4.11 fails to build with gcc 6 and glibc 2.23
Summary: [GTK] 2.4.11 fails to build with gcc 6 and glibc 2.23
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-26 03:21 PDT by Alberto Garcia
Modified: 2018-05-08 20:26 PDT (History)
2 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 2016-06-26 03:21:52 PDT
../Source/WebCore/platform/gtk/GtkClickCounter.cpp: In member function 'int WebCore::GtkClickCounter::clickCountForGdkButtonEvent(GtkWidget*, GdkEventButton*)':
../Source/WebCore/platform/gtk/GtkClickCounter.cpp:88:59: error: call of overloaded 'abs(gdouble)' is ambiguous
         || ((abs(buttonEvent->x - m_previousClickPoint.x()) < doubleClickDistance)
                                                           ^
In file included from /usr/include/c++/6/cstdlib:75:0,
                 from /usr/include/c++/6/stdlib.h:36,
                 from ../Source/WTF/wtf/FastMalloc.h:25,
                 from ../Source/JavaScriptCore/config.h:60,
                 from ../Source/WebCore/platform/gtk/GtkClickCounter.cpp:19:
/usr/include/stdlib.h:774:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/6/stdlib.h:36:0,
                 from ../Source/WTF/wtf/FastMalloc.h:25,
                 from ../Source/JavaScriptCore/config.h:60,
                 from ../Source/WebCore/platform/gtk/GtkClickCounter.cpp:19:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
../Source/WebCore/platform/gtk/GtkClickCounter.cpp:89:62: error: call of overloaded 'abs(gdouble)' is ambiguous
             && (abs(buttonEvent->y - m_previousClickPoint.y()) < doubleClickDistance)
                                                              ^
In file included from /usr/include/c++/6/cstdlib:75:0,
                 from /usr/include/c++/6/stdlib.h:36,
                 from ../Source/WTF/wtf/FastMalloc.h:25,
                 from ../Source/JavaScriptCore/config.h:60,
                 from ../Source/WebCore/platform/gtk/GtkClickCounter.cpp:19:
/usr/include/stdlib.h:774:12: note: candidate: int abs(int)
 extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
            ^~~
In file included from /usr/include/c++/6/stdlib.h:36:0,
                 from ../Source/WTF/wtf/FastMalloc.h:25,
                 from ../Source/JavaScriptCore/config.h:60,
                 from ../Source/WebCore/platform/gtk/GtkClickCounter.cpp:19:
/usr/include/c++/6/cstdlib:180:3: note: candidate: long long int std::abs(long long int)
   abs(long long __x) { return __builtin_llabs (__x); }
   ^~~
/usr/include/c++/6/cstdlib:172:3: note: candidate: long int std::abs(long int)
   abs(long __i) { return __builtin_labs(__i); }
   ^~~
GNUmakefile:51931: recipe for target 'Source/WebCore/platform/gtk/libPlatformGtk_la-GtkClickCounter.lo' failed
make[2]: *** [Source/WebCore/platform/gtk/libPlatformGtk_la-GtkClickCounter.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
Comment 1 Michael Catanzaro 2016-06-26 08:52:02 PDT
Fedora patch:

diff -Nur webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/GtkClickCounter.cpp webkitgtk-2.4.9/Source/WebCore/platform/gtk/GtkClickCounter.cpp
--- webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/GtkClickCounter.cpp	2015-05-20 03:03:24.000000000 -0600
+++ webkitgtk-2.4.9/Source/WebCore/platform/gtk/GtkClickCounter.cpp	2016-02-07 11:30:42.392686308 -0700
@@ -85,8 +85,8 @@
     guint32 eventTime = getEventTime(event);
 
     if ((event->type == GDK_2BUTTON_PRESS || event->type == GDK_3BUTTON_PRESS)
-        || ((abs(buttonEvent->x - m_previousClickPoint.x()) < doubleClickDistance)
-            && (abs(buttonEvent->y - m_previousClickPoint.y()) < doubleClickDistance)
+        || ((fabs(buttonEvent->x - m_previousClickPoint.x()) < doubleClickDistance)
+            && (fabs(buttonEvent->y - m_previousClickPoint.y()) < doubleClickDistance)
             && (eventTime - m_previousClickTime < static_cast<guint>(doubleClickTime))
             && (buttonEvent->button == m_previousClickButton)))
         m_currentClickCount++;
diff -Nur webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp webkitgtk-2.4.9/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
--- webkitgtk-2.4.9.orig/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2015-05-20 03:03:24.000000000 -0600
+++ webkitgtk-2.4.9/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp	2016-02-07 11:49:36.384691005 -0700
@@ -659,7 +659,7 @@
     if (!std::isfinite(time))
         return String::fromUTF8(_("indefinite time"));
 
-    int seconds = static_cast<int>(abs(time));
+    int seconds = static_cast<int>(fabs(time));
     int days = seconds / (60 * 60 * 24);
     int hours = seconds / (60 * 60);
     int minutes = (seconds / 60) % 60;
Comment 2 Alberto Garcia 2016-06-26 10:47:48 PDT
(In reply to comment #1)
> Fedora patch:

It works fine, thanks!