1
0
mirror of https://sourceware.org/git/glibc.git synced 2026-01-06 11:51:29 +03:00

Add include/libc-misc.h

Add include/libc-misc.h to provide miscellaneous definitions for both
glibc build and test:

1. Move inhibit_stack_protector to libc-misc.h and add Clang support.
2. Add test_inhibit_stack_protector for glibc testing.
3. Move inhibit_loop_to_libcall to libc-misc.h.
4. Add test_cc_inhibit_loop_to_libcall to handle TEST_CC != CC and
replace inhibit_loop_to_libcall with test_cc_inhibit_loop_to_libcall
in glibc tests.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Reviewed-by: Sam James <sam@gentoo.org>
This commit is contained in:
H.J. Lu
2024-12-20 05:31:05 +08:00
parent 56cdc529fb
commit 494eb254c3
8 changed files with 203 additions and 67 deletions

View File

@@ -47,7 +47,7 @@ IMPL (memmove, 1)
/* Naive implementation to verify results. */
char *
inhibit_loop_to_libcall
test_cc_inhibit_loop_to_libcall
simple_memmove (char *dst, const char *src, size_t n)
{
char *ret = dst;

View File

@@ -64,7 +64,7 @@ IMPL (MEMSET, 1)
/* Naive implementation to verify results. */
CHAR *
inhibit_loop_to_libcall
test_cc_inhibit_loop_to_libcall
SIMPLE_MEMSET (CHAR *s, int c, size_t n)
{
CHAR *r = s, *end = s + n;

View File

@@ -40,16 +40,7 @@ extern impl_t __start_impls[], __stop_impls[];
#undef __USE_STRING_INLINES
/* We are compiled under _ISOMAC, so libc-symbols.h does not do this
for us. */
#include "config.h"
#ifdef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
# define inhibit_loop_to_libcall \
__attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
#else
# define inhibit_loop_to_libcall
#endif
#include "libc-misc.h"
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>