From 36a8709d525b2ea770d1075800f4f25e33c13f6e Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Tue, 23 Jul 2019 02:50:11 +0300 Subject: [PATCH 1/2] Workaround for GCC 5+ noreturn issue --- config/compilers/compiler_gcc.h.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/config/compilers/compiler_gcc.h.in b/config/compilers/compiler_gcc.h.in index 9e7f6204..22b28343 100644 --- a/config/compilers/compiler_gcc.h.in +++ b/config/compilers/compiler_gcc.h.in @@ -6,13 +6,17 @@ #define DUK_VA_COPY(dest,src) __va_copy(dest,src) #endif -#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 20500L) -/* since gcc-2.5 */ +#if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 20500L) && (DUK_F_GCC_VERSION < 50000L) +/* Since gcc-2.5. + * + * Disabled temporarily in GCC 5+ because of an unresolved noreturn-related + * issue: https://github.com/svaarala/duktape/issues/2155. + */ #define DUK_NORETURN(decl) decl __attribute__((noreturn)) #endif #if defined(DUK_F_GCC_VERSION) && (DUK_F_GCC_VERSION >= 40500L) -/* since gcc-4.5 */ +/* Since gcc-4.5. */ #define DUK_UNREACHABLE() do { __builtin_unreachable(); } while (0) #endif From a355919b3a7b8ec60b20834dbed7f35ff3c5a2b1 Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Tue, 23 Jul 2019 02:52:08 +0300 Subject: [PATCH 2/2] Releases: GCC 5+ noreturn workaround --- RELEASES.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RELEASES.rst b/RELEASES.rst index 39c5ad21..9a19e83a 100644 --- a/RELEASES.rst +++ b/RELEASES.rst @@ -3532,6 +3532,12 @@ Planned * Use GCC (>= 5.0) and Clang builtin bswap macros, add internal DUK_BSWAP64() macro (GH-2122) +* Short term workaround for a noreturn-related issue with GCC 5+ (GH-2155) + where some internal duk_require_constructor_call() calls are entirely + missing in compiler output in certain circumstances (GCC 5+, noreturn + attributes enabled, debugger support enabled); the workaround is to + disable noreturn macros for GCC 5+ for now (GH-2156) + * Improve assertion coverage for internal structures during mark-and-sweep (GH-2092)