aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-23 03:58:54 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-23 04:51:30 +0800
commitb587e7d45c7aed0d1b1ab97d9c7d451df4837aa1 (patch)
tree78d64fac980b1a9c8199b02e6d75283583d31af9
parent2271e0d2b606637870daa2a39894eb8d8bbfe5dc (diff)
downloadglibc-b587e7d45c7aed0d1b1ab97d9c7d451df4837aa1.zip
glibc-b587e7d45c7aed0d1b1ab97d9c7d451df4837aa1.tar.gz
glibc-b587e7d45c7aed0d1b1ab97d9c7d451df4837aa1.tar.bz2
Fix build without stack protector [BZ #32494]
Without stack protector, inhibit_stack_protector is undefined during build: In file included from <command-line>: ./../include/libc-symbols.h:665:3: error: expected ';' before '__typeof' 665 | __typeof (type_name) *name##_ifunc (__VA_ARGS__) \ | ^~~~~~~~ ./../include/libc-symbols.h:676:3: note: in expansion of macro '__ifunc_resolver' 676 | __ifunc_resolver (type_name, name, expr, init, static, __VA_ARGS__) | ^~~~~~~~~~~~~~~~ ./../include/libc-symbols.h:703:3: note: in expansion of macro '__ifunc_args' 703 | __ifunc_args (type_name, name, expr, init, arg) | ^~~~~~~~~~~~ ./../include/libc-symbols.h:790:3: note: in expansion of macro '__ifunc' 790 | __ifunc (redirected_name, name, expr, void, INIT_ARCH) | ^~~~~~~ ../sysdeps/x86_64/multiarch/memchr.c:29:1: note: in expansion of macro 'libc_ifunc_redirected' 29 | libc_ifunc_redirected (__redirect_memchr, memchr, IFUNC_SELECTOR ()); | ^~~~~~~~~~~~~~~~~~~~~ 1. Fix a typo in include/libc-symbols.h to define inhibit_stack_protector for build. 2. Don't include <config.h> in include/libc-symbols.h since it has been included in include/libc-misc.h. 3. Change #include "libc-misc.h" to #include <libc-misc.h> in string/test-string.h. This fixes BZ #32494. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r--include/libc-misc.h2
-rw-r--r--include/libc-symbols.h2
-rw-r--r--string/test-string.h2
3 files changed, 2 insertions, 4 deletions
diff --git a/include/libc-misc.h b/include/libc-misc.h
index 23fc1c1..7658b4b 100644
--- a/include/libc-misc.h
+++ b/include/libc-misc.h
@@ -60,7 +60,7 @@
# ifdef HAVE_CC_NO_STACK_PROTECTOR
# define inhibit_stack_protector cc_inhibit_stack_protector
# else
-# define test_inhibit_stack_protector
+# define inhibit_stack_protector
# endif
#endif
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index ff3555b..56ae610 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -84,8 +84,6 @@
# error "glibc must not be compiled with -ffast-math"
#endif
-#include <config.h>
-
/* Obtain the definition of symbol_version_reference. */
#include <libc-symver.h>
diff --git a/string/test-string.h b/string/test-string.h
index 6375972..3b885af 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -40,7 +40,7 @@ extern impl_t __start_impls[], __stop_impls[];
#undef __USE_STRING_INLINES
-#include "libc-misc.h"
+#include <libc-misc.h>
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>