From a36b96f9a469fabaa72624ae4e945f4ea8cbc842 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sun, 6 Feb 2022 02:32:17 +0000 Subject: [PATCH] Fix build on tcc with glibc 2.35 Building ksh with the tcc (tinycc) compiler failed as of glibc commit 5d98a7da. The NEWS file in that commit adds: +* When _DYNAMIC_STACK_SIZE_SOURCE or _GNU_SOURCE are defined, + PTHREAD_STACK_MIN is no longer constant and is redefined to + sysconf(_SC_THREAD_STACK_MIN). The tcc build failure seeminly had nothing to do with that -- however, deleting the PTHREAD_STACK_MIN entry and its dependent THREAD_STACK_MIN entry from conf.tab fixes the build failure. For reasons unknown, gcc didn't have a problem with it. However, these config identifiers aren't used anywhere in the ast codebase (including the full ast-open-history repo) so it should be fine to just get rid of them; ksh is not and will not be threaded. NOTE: To build ksh with tcc, you need to build the latest tcc code from . The tcc release packages in OS distributions are typically too old and will not work. Resolves: https://github.com/ksh93/ksh/issues/437 Thanks to @JohnoKing for the report. --- src/lib/libast/comp/conf.tab | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/libast/comp/conf.tab b/src/lib/libast/comp/conf.tab index e65e87659..8c68faaa7 100644 --- a/src/lib/libast/comp/conf.tab +++ b/src/lib/libast/comp/conf.tab @@ -441,7 +441,6 @@ PRIO_IO POSIX PC 1 FUW PROC_RSRC_MGR C QQ 1 L PTHREAD_DESTRUCTOR_ITERATIONS C QQ 1 L PTHREAD_KEYS_MAX C QQ 1 L -PTHREAD_STACK_MIN C QQ 1 L PTHREAD_THREADS_MAX C QQ 1 L PTRDIFF_MAX C XX 1 LMU stdint.h 65535 PTRDIFF_MIN C XX 1 LMU stdint.h -65535 @@ -556,7 +555,6 @@ THREAD_PRIO_PROTECT POSIX SC 1 CDFUW THREAD_PROCESS_SHARED POSIX SC 1 CDFUW THREAD_SAFE_FUNCTIONS POSIX SC 1 CDFUW THREAD_SPORADIC_SERVER POSIX SC 1 FUW -THREAD_STACK_MIN POSIX SC 1 LUW PTHREAD_STACK_MIN THREAD_THREADS_MAX POSIX SC 1 LMUW PTHREAD_THREADS_MAX 64 TIMEOUTS POSIX SC 1 FUW TIMERS POSIX SC 1 CDFUW