PM28.7.0 + glibc 2.30 - build error

The place to report Pale Moon specific bugs on Linux and other operating systems.
Locked
User avatar
biopsin
Moon lover
Moon lover
Posts: 75
Joined: 2016-02-07, 17:15

PM28.7.0 + glibc 2.30 - build error

Post by biopsin » 2019-08-30, 04:26

Good mornig,
I hit a snag yesterday bulding PM,

/builddir/UXP-PM28.7.0_Release/js/src/jsnativestack.cpp:30:1: error: 'pid_t gettid()' was declared 'extern' and later 'static' [-fpermissive]

found reported Bug 1533969 - Fix build error with newer glibc
https://hg.mozilla.org/mozilla-central/rev/7b85bf9c5210

With some adaptation, building finnish.

Code: Select all

--- tools/profiler/tasktracer/GeckoTaskTracer.cpp	2019-08-23 01:47:27.000000000 +0200
+++ tools/profiler/tasktracer/GeckoTaskTracer.cpp	2019-08-29 18:02:44.541959971 +0200
@@ -25,20 +25,14 @@
 #if defined(__GLIBC__)
 #include <unistd.h>
 #include <sys/syscall.h>
-static inline pid_t gettid()
-{
-  return (pid_t) syscall(SYS_gettid);
-}
+#define gettid() static_cast<pid_t>(syscall(SYS_gettid))
 #elif defined(XP_MACOSX)
 #include <unistd.h>
 #include <sys/syscall.h>
-static inline pid_t gettid()
-{
-  return (pid_t) syscall(SYS_thread_selfid);
-}
+#define gettid() static_cast<pid_t>(syscall(SYS_thread_selfid))
 #elif defined(LINUX)
 #include <sys/types.h>
-pid_t gettid();
+#pid_t gettid();
 #endif
 
 // NS_ENSURE_TRUE_VOID() without the warning on the debug build.


--- js/src/jsnativestack.cpp	2019-08-29 17:45:10.000000000 +0200
+++ js/src/jsnativestack.cpp	2019-08-29 17:53:58.382003265 +0200
@@ -26,11 +26,7 @@
 #  include <sys/syscall.h>
 #  include <sys/types.h>
 #  include <unistd.h>
-static pid_t
-gettid()
-{
-    return syscall(__NR_gettid);
-}
+#  define gettid() static_cast<pid_t>(syscall(__NR_gettid))
 # endif
 
 #else
voidlinux_x64 glibc-2.30 / Palemoon_latest release (gcc-9.3.0)

bgstack15
Moonbather
Moonbather
Posts: 68
Joined: 2018-01-22, 23:04

Re: PM28.7.0 + glibc 2.30 - build error

Post by bgstack15 » 2019-08-30, 14:05

Discussed previously already on this forum. I don't remember any conclusions, but I remember the exact topic.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 26662
Joined: 2011-08-28, 17:27
Location: 58°2'16"N 14°58'31"E
Contact:

Re: PM28.7.0 + glibc 2.30 - build error

Post by Moonchild » 2019-08-30, 14:25

The conclusions were that you should have a look at properly #ifdef-ing it based on glibc version; but nothing happened after that.
"There will be times when the position you advocate, no matter how well framed and supported, will not be accepted by the public simply because you are who you are." -- Merrill Rose
Image

Locked