View Issue Details

IDProjectCategoryView StatusLast Update
0000290Cinelerra-GG[All Projects] Bugpublic2019-09-02 20:10
Reporterferdnyc Assigned Togoodguy  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version2019-08 
Summary0000290: PATCH: guicast build fails under glibc 2.30 due to gettid() redefinition
Descriptionglibc 2.30 added gettid() to the library (https://sourceware.org/bugzilla/show_bug.cgi?id=6399), causing the definition in cinelerra-5.1/guicast/thread.h to result in a compile error:

g++ `cat x86_64/c_flags` -DMSGQUAL=bccapture -c bccapture.C -o x86_64/bccapture.o
BUILDSTDERR: In file included from bcfilebox.h:38,
BUILDSTDERR: from bcresources.h:33,
BUILDSTDERR: from bccapture.C:23:
BUILDSTDERR: thread.h:30:19: error: 'int gettid()' was declared 'extern' and later 'static' [-fpermissive]
BUILDSTDERR: 30 | static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
BUILDSTDERR: | ^~~~~~
BUILDSTDERR: In file included from /usr/include/unistd.h:1170,
BUILDSTDERR: from thread.h:27,
BUILDSTDERR: from bcfilebox.h:38,
BUILDSTDERR: from bcresources.h:33,
BUILDSTDERR: from bccapture.C:23:
BUILDSTDERR: /usr/include/bits/unistd_ext.h:34:16: note: previous declaration of '__pid_t gettid()'
BUILDSTDERR: 34 | extern __pid_t gettid (void) __THROW;
BUILDSTDERR: | ^~~~~~
BUILDSTDERR: cc1plus: warning: unrecognized command line option '-Wno-unknown-warning'
BUILDSTDERR: make[2]: *** [Makefile:123: x86_64/bccapture.o] Error 1

The attached patch, largely inspired by the libselinux fix (https://github.com/SELinuxProject/selinux/commit/707e4b8610733b5c9eaac0f00239778f3edb23c2), wraps the definition of gettid() in a glibc version check.
TagsNo tags attached.

Activities

PhyllisSmith

PhyllisSmith

2019-08-31 03:39

manager   ~0002056

Patch has been applied, checked into GIT, and will in the 2019-08-31 builds tomorrow.
PhyllisSmith

PhyllisSmith

2019-08-30 13:39

manager   ~0002053

Thank you again. He looked at this and plans to put it in today (as long as nothing else goes wrong).
ferdnyc

ferdnyc

2019-08-30 03:14

reporter  

cinelerra-gg-gettid-check.patch (925 bytes)
From 846c2679997e939ff84d709a8270a425375ccaf6 Mon Sep 17 00:00:00 2001
From: "FeRD (Frank Dana)" <[email protected]>
Date: Thu, 29 Aug 2019 22:48:58 -0400
Subject: [PATCH] Don't redefine gettid() on glibc 2.30+

---
 cinelerra-5.1/guicast/thread.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cinelerra-5.1/guicast/thread.h b/cinelerra-5.1/guicast/thread.h
index 216ecd2..b6a1be8 100644
--- a/cinelerra-5.1/guicast/thread.h
+++ b/cinelerra-5.1/guicast/thread.h
@@ -27,7 +27,11 @@
 #include <unistd.h>
 #include <sys/syscall.h>
 
-static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
+// Newer glibc >= 2.30 provides gettid() in unistd
+#if !defined(__GLIBC_PREREQ) || !__GLIBC_PREREQ(2, 30)
+    static inline int gettid() { return syscall(SYS_gettid, 0, 0, 0); }
+#endif
+
 
 // The thread does not autodelete by default.
 // If autodelete is 1 the thread autodeletes.
-- 
2.21.0

Issue History

Date Modified Username Field Change
2019-08-30 03:14 ferdnyc New Issue
2019-08-30 03:14 ferdnyc File Added: cinelerra-gg-gettid-check.patch
2019-08-30 13:38 PhyllisSmith Assigned To => goodguy
2019-08-30 13:38 PhyllisSmith Status new => assigned
2019-08-30 13:39 PhyllisSmith Status assigned => acknowledged
2019-08-30 13:39 PhyllisSmith Note Added: 0002053
2019-08-31 03:39 PhyllisSmith Status acknowledged => resolved
2019-08-31 03:39 PhyllisSmith Resolution open => fixed
2019-08-31 03:39 PhyllisSmith Fixed in Version => 2019-08
2019-08-31 03:39 PhyllisSmith Note Added: 0002056
2019-09-02 20:10 PhyllisSmith Status resolved => closed