]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
fix: backport pjproject stdatomic.h GCC 4.8 build failure patch
authorphoneben <3232963@gmail.com>
Tue, 21 Apr 2026 13:08:18 +0000 (16:08 +0300)
committergithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Tue, 21 Apr 2026 16:45:50 +0000 (16:45 +0000)
pjproject 2.16 (bundled) fails to build on GCC 4.8 (CentOS/RHEL 7)
due to a false positive C11 atomics detection introduced in pjproject
commit #4570. A fix has been submitted upstream to pjproject (#4933).

Adding a local patch to third-party/pjproject/patches/ until a fixed
version of pjproject is bundled in Asterisk.

Fixes build error:
../src/pj/os_core_unix.c:52:27: fatal error: stdatomic.h: No such file or directory

Resolves: #1883

third-party/pjproject/patches/0060-fix-stdatomic-gcc48.patch [new file with mode: 0644]

diff --git a/third-party/pjproject/patches/0060-fix-stdatomic-gcc48.patch b/third-party/pjproject/patches/0060-fix-stdatomic-gcc48.patch
new file mode 100644 (file)
index 0000000..3fddb97
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/pjlib/src/pj/os_core_unix.c
++++ b/pjlib/src/pj/os_core_unix.c
+@@ -47,7 +47,10 @@
+ #if PJ_HAS_THREADS
+ #  if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
+-                                && !defined(__STDC_NO_ATOMICS__)
++                                && !defined(__STDC_NO_ATOMICS__)  \
++                                && (!defined(__GNUC__) || defined(__clang__) \
++                                || __GNUC__ > 4 \
++                                || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
+ #    define HAS_STD_ATOMICS 1
+ #    include <stdatomic.h>
+ #  else
\ No newline at end of file