PM28.7.0 + glibc 2.30 - build error

Talk about code development, features, specific bugs, enhancements, patches, and similar things.
Forum rules
Please keep everything here strictly on-topic.
This board is meant for Pale Moon source code development related subjects only like code snippets, patches, specific bugs, git, the repositories, etc.

This is not for tech support! Please do not post tech support questions in the "Development" board!
Please make sure not to use this board for support questions. Please post issues with specific websites, extensions, etc. in the relevant boards for those topics.

Please keep things on-topic as this forum will be used for reference for Pale Moon development. Expect topics that aren't relevant as such to be moved or deleted.
User avatar
biopsin
Fanatic
Fanatic
Posts: 122
Joined: 2016-02-07, 17:15

PM28.7.0 + glibc 2.30 - build error

Unread 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.78 / selfcompiled latest Palemoon (gcc-13.2.0) / GTK2

bgstack15
Fanatic
Fanatic
Posts: 121
Joined: 2018-01-22, 23:04

Re: PM28.7.0 + glibc 2.30 - build error

Unread 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: 35636
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: PM28.7.0 + glibc 2.30 - build error

Unread 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.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

Locked