]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix build without stack protector [BZ #32494]
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 22 Dec 2024 19:58:54 +0000 (03:58 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 22 Dec 2024 20:51:30 +0000 (04:51 +0800)
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>
include/libc-misc.h
include/libc-symbols.h
string/test-string.h

index 23fc1c1f60cf069a15f76ea180236f342bc44323..7658b4b972a9e7b81cae4b59f3d80b42254791d1 100644 (file)
@@ -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
 
index ff3555be9d6ee96eb2111d6ca790815d3b4a2d5a..56ae61015df45a6abb60cd13382b2fa900d5508c 100644 (file)
@@ -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>
 
index 6375972ea8313c07468ecca623ea0511371d5c61..3b885aff6bd1dc54cf28630da2b0d4c4175801c1 100644 (file)
@@ -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>