forked from paveltkv/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0012-sailfishos-build-Fix-build-error-with-newer-glibc.patch
44 lines (36 loc) · 1.54 KB
/
0012-sailfishos-build-Fix-build-error-with-newer-glibc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Raine Makelainen <[email protected]>
Date: Fri, 24 Jul 2020 15:45:12 +0300
Subject: [PATCH] [sailfishos][build] Fix build error with newer glibc.
This fix is insprired by https://bugzilla.mozilla.org/show_bug.cgi?id=1533969
--------------------------------------------------------------------------
Bug 1533969 - Fix build error with newer glibc. r=nbp
New glibc versions provide a wrapper for gettid, which means that our stuff
fails to build with:
```
/home/emilio/src/moz/gecko/js/src/util/NativeStack.cpp:28:14: error: static declaration of 'gettid' follows non-static declaration
static pid_t gettid() { return syscall(__NR_gettid); }
^
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration is here
extern __pid_t gettid (void) __THROW;
```
Differential Revision: https://phabricator.services.mozilla.com/D22829
Signed-off-by: Raine Makelainen <[email protected]>
---
tools/profiler/core/platform.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/profiler/core/platform.h b/tools/profiler/core/platform.h
index c8fc60484e6c..5c5ca38b3a80 100644
--- a/tools/profiler/core/platform.h
+++ b/tools/profiler/core/platform.h
@@ -47,7 +47,7 @@
#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(GP_OS_darwin)
#include <unistd.h>
#include <sys/syscall.h>
--
2.26.2