1 Star 0 Fork 145

任义/glibc

forked from src-openEuler/glibc 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0002-support-clang-compile.patch 24.02 KB
一键复制 编辑 原始数据 按行查看 历史
任义 提交于 2023-10-07 16:04 . support clang compile
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
From 5ce2b7eb76ecbd5d182c06c2e2c681c3269b9cce Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 10:43:28 +0800
Subject: [PATCH 1/7] patch03
---
configure | 4 ++--
configure.ac | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/configure b/configure
index 4ef38714..c73bd0df 100755
--- a/configure
+++ b/configure
@@ -5735,7 +5735,7 @@ int
main (void)
{
-#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#if (__GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)) && !defined __clang__
#error insufficient compiler
#endif
;
@@ -7276,7 +7276,7 @@ else $as_nop
extern char *strstr (const char *, const char *) __asm ("my_strstr");
char *foo (const char *a, const char *b)
{
- return __builtin_strstr (a, b);
+ return strstr (a, b);
}
EOF
if { ac_try='${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null'
diff --git a/configure.ac b/configure.ac
index 12d1f50b..e078c3f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -609,7 +609,7 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
-#if !defined __GNUC__ || __GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)
+#if (__GNUC__ < 6 || (__GNUC__ == 6 && __GNUC_MINOR__ < 2)) && !defined __clang__
#error insufficient compiler
#endif]])],
[libc_cv_compiler_ok=yes],
@@ -1449,7 +1449,7 @@ cat > conftest.c <<\EOF
extern char *strstr (const char *, const char *) __asm ("my_strstr");
char *foo (const char *a, const char *b)
{
- return __builtin_strstr (a, b);
+ return strstr (a, b);
}
EOF
dnl
--
2.27.0
From a06404237d0a3c548376e14b94da24b12f341669 Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 11:12:14 +0800
Subject: [PATCH 2/7] 0019
---
Makeconfig | 48 +++++++++++++++++++++++++++++++++++-------------
configure | 2 +-
configure.ac | 2 +-
elf/Makefile | 4 ++--
4 files changed, 39 insertions(+), 17 deletions(-)
diff --git a/Makeconfig b/Makeconfig
index 77d7fd14..6eb1a815 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -681,37 +681,59 @@ ifneq ($(have-cc-with-libunwind),yes)
else
libunwind = -lunwind
endif
-libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
+
+clang_rt = $(realpath $(call shell,$(CC) -print-file-name=libclang_rt.builtins-$(config-machine).a))
+use_clang_rt = $(call shell,sh -c "if test -f $(clang_rt) && file $(clang_rt) | grep -q archive; then echo yes; else echo no; fi")
+
+ifeq (yes,$(use_clang_rt))
+compiler_lib_share = $(call shell,$(CC) -print-file-name=libclang_rt.builtins-$(config-machine).a) $(libunwind)
+compiler_lib = $(call shell,$(CC) -print-file-name=libclang_rt.builtins-$(config-machine).a)
+compiler_lib_eh = -lunwind
+crtbegin = clang_rt.crtbegin-$(config-machine).o
+crtbeginS = clang_rt.crtbegin-$(config-machine).o
+crtbeginT = clang_rt.crtbegin-$(config-machine).o
+crtend = clang_rt.crtend-$(config-machine).o
+else
+compiler_lib_share = -lgcc_s
+compiler_lib = -lgcc
+compiler_lib_eh = -lgcc_eh
+crtbegin = crtbegin.o
+crtbeginS = crtbeginS.o
+crtbeginT = crtbeginT.o
+crtend = crtend.o
+endif
+
+libgcc_eh := -Wl,--as-needed $(compiler_lib_share) $(libunwind) -Wl,--no-as-needed
gnulib-arch =
-gnulib = -lgcc $(gnulib-arch)
-gnulib-tests := -lgcc $(libgcc_eh)
+gnulib = $(compiler_lib) $(gnulib-arch)
+gnulib-tests := $(compiler_lib) $(libgcc_eh)
static-gnulib-arch =
# By default, elf/static-stubs.o, instead of -lgcc_eh, is used to
# statically link programs. When --disable-shared is used, we use
# -lgcc_eh since elf/static-stubs.o isn't sufficient.
ifeq (yes,$(build-shared))
-static-gnulib = -lgcc $(static-gnulib-arch)
+static-gnulib = $(compiler_lib) $(static-gnulib-arch)
else
-static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
+static-gnulib = $(compiler_lib) $(compiler_lib_eh) $(static-gnulib-arch)
endif
-static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
-libc.so-gnulib := -lgcc
+static-gnulib-tests := $(compiler_lib) $(compiler_lib_eh) $(libunwind)
+libc.so-gnulib := $(compiler_lib)
endif
+preinit = $(addprefix $(csu-objpfx),crti.o)
+postinit = $(addprefix $(csu-objpfx),crtn.o)
-+prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbegin.o`
-+postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
++prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtbegin)`
++postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtend)`
# Variants of the two previous definitions for linking PIE programs.
-+prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginS.o`
-+postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtendS.o`
++prectorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtbeginS)`
++postctorS = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtend)`
# Variants of the two previous definitions for statically linking programs.
ifeq (yes,$(enable-static-pie))
# Static PIE must use PIE variants.
+prectorT = $(+prectorS)
+postctorT = $(+postctorS)
else
-+prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
-+postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
++prectorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtbeginT)`
++postctorT = `$(CC) $(sysdep-LDFLAGS) --print-file-name=$(crtend)`
endif
csu-objpfx = $(common-objpfx)csu/
elf-objpfx = $(common-objpfx)elf/
diff --git a/configure b/configure
index c73bd0df..2dacb6e7 100755
--- a/configure
+++ b/configure
@@ -7389,7 +7389,7 @@ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
foo (void) {}
EOF
libc_cv_cc_loop_to_function=no
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fno-tree-loop-distribute-patterns -c conftest.c'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
diff --git a/configure.ac b/configure.ac
index e078c3f5..03b81a8b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1506,7 +1506,7 @@ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
foo (void) {}
EOF
libc_cv_cc_loop_to_function=no
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c])
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c])
then
libc_cv_cc_loop_to_function=yes
fi
diff --git a/elf/Makefile b/elf/Makefile
index c00e2ccf..0cd5163a 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -1285,7 +1285,7 @@ $(objpfx)librtld.map: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
echo ".globl $$symbol"; \
echo "$$symbol:"; \
done | $(CC) -o $@T.o $(ASFLAGS) -c -x assembler -
- $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ -lgcc '-Wl,-)' -Wl,-Map,$@T
+ $(reloc-link) -o $@.o $@T.o '-Wl,-(' $^ $(compiler_lib) '-Wl,-)' -Wl,-Map,$@T
rm -f %@T.o $@.o
mv -f $@T $@
@@ -1315,7 +1315,7 @@ $(objpfx)rtld-libc.a: $(objpfx)librtld.mk FORCE
$(MAKE) -f $< -f rtld-Rules
$(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(objpfx)rtld-libc.a
- $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ -lgcc '-Wl,-)' \
+ $(LINK.o) -nostdlib -nostartfiles -r -o $@ '-Wl,-(' $^ $(compiler_lib) '-Wl,-)' \
-Wl,-Map,$@.map
generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
--
2.27.0
From 294805399d738561bc401345fdd2e2c3c567e8cc Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 16:43:31 +0800
Subject: [PATCH 3/7] personal change that has more error
---
configure | 33 ++++++---------------------------
sysdeps/aarch64/configure | 24 ------------------------
sysdeps/aarch64/configure.ac | 12 +-----------
3 files changed, 7 insertions(+), 62 deletions(-)
diff --git a/configure b/configure
index 2dacb6e7..9a15bfa0 100755
--- a/configure
+++ b/configure
@@ -3418,7 +3418,7 @@ See \`config.log' for more details" "$LINENO" 5; }
printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion -version; do
+for ac_option in --version -v; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -3953,7 +3953,7 @@ fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -4794,27 +4794,6 @@ fi
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-int
-main (void)
-{
-
-#ifndef __CET__
-# error no CET compiler support
-#endif
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"
-then :
- libc_cv_compiler_default_cet=yes
-else $as_nop
- libc_cv_compiler_default_cet=no
-fi
-rm -f conftest.err conftest.i conftest.$ac_ext
# Check whether --enable-cet was given.
if test ${enable_cet+y}
@@ -7155,7 +7134,7 @@ void foo (void)
i = 10;
}
EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -nostdlib -nostartfiles
conftest.c -o conftest 1>&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
@@ -7189,7 +7168,7 @@ extern __typeof (__foo) foo __attribute__ ((weak, alias ("__foo")));
extern __typeof (__foo) bar __attribute__ ((weak, alias ("foo")));
EOF
libc_cv_wno_ignored_attributes=""
-if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -c conftest.c'
+if ! { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7357,7 +7336,7 @@ if test ${libc_cv_cc_signaling_nans+y}
then :
printf %s "(cached) " >&6
else $as_nop
- if { ac_try='${CC-cc} -Werror -fsignaling-nans -xc /dev/null -S -o /dev/null'
+ if { ac_try='${CC-cc} -Werror -xc /dev/null -S -o /dev/null'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
@@ -7389,7 +7368,7 @@ __attribute__ ((__optimize__ ("-fno-tree-loop-distribute-patterns")))
foo (void) {}
EOF
libc_cv_cc_loop_to_function=no
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -Werror -fno-tree-loop-distribute-patterns -c conftest.c'
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
(eval $ac_try) 2>&5
ac_status=$?
diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure
index ca57edce..a18c82fd 100644
--- a/sysdeps/aarch64/configure
+++ b/sysdeps/aarch64/configure
@@ -350,30 +350,6 @@ if test x"$build_mathvec" = xnotset; then
build_mathvec=yes
fi
-# Check if compiler supports SVE ACLE.
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for availability of SVE ACLE" >&5
-printf %s "checking for availability of SVE ACLE... " >&6; }
-if test ${libc_cv_aarch64_sve_acle+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- cat > conftest.c <<EOF
-#include <arm_sve.h>
-EOF
- if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c'
- { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- libc_cv_aarch64_sve_acle=yes
- else
- libc_cv_aarch64_sve_acle=no
- fi
- rm conftest.c
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_aarch64_sve_acle" >&5
-printf "%s\n" "$libc_cv_aarch64_sve_acle" >&6; }
# Check if compiler is sufficient to build mathvec
if test $build_mathvec = yes; then
diff --git a/sysdeps/aarch64/configure.ac b/sysdeps/aarch64/configure.ac
index 27874ece..1a18708f 100644
--- a/sysdeps/aarch64/configure.ac
+++ b/sysdeps/aarch64/configure.ac
@@ -106,17 +106,7 @@ if test x"$build_mathvec" = xnotset; then
build_mathvec=yes
fi
-# Check if compiler supports SVE ACLE.
-AC_CACHE_CHECK(for availability of SVE ACLE, libc_cv_aarch64_sve_acle, [dnl
- cat > conftest.c <<EOF
-#include <arm_sve.h>
-EOF
- if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fsyntax-only -ffreestanding conftest.c]); then
- libc_cv_aarch64_sve_acle=yes
- else
- libc_cv_aarch64_sve_acle=no
- fi
- rm conftest.c])
+
# Check if compiler is sufficient to build mathvec
if test $build_mathvec = yes; then
--
2.27.0
From 0afe021e431cab209300baee1a41d57885f4dea8 Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 16:47:24 +0800
Subject: [PATCH 4/7] 004 patch
---
include/features.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/features.h b/include/features.h
index 7c51b4a2..a94fc1b3 100644
--- a/include/features.h
+++ b/include/features.h
@@ -515,7 +515,7 @@
/* Decide whether we can define 'extern inline' functions in headers. */
#if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
&& !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
- && defined __extern_inline
+ && defined __extern_inline && !(defined __clang__ && defined _LIBC)
# define __USE_EXTERN_INLINES 1
#endif
--
2.27.0
From 45646ed48bbe48c54f1a8ea8aebb460cd9ebb7ef Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 16:48:52 +0800
Subject: [PATCH 5/7] 0014 patch
---
argp/argp-xinl.c | 34 +++++++++++++++++++++++-----------
argp/argp.h | 10 +++-------
2 files changed, 26 insertions(+), 18 deletions(-)
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index b7cd70cc..ae41d3bd 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -25,19 +25,31 @@
# include <features.h>
#endif
-#ifndef __USE_EXTERN_INLINES
-# define __USE_EXTERN_INLINES 1
-#endif
-#define ARGP_EI
-#undef __OPTIMIZE__
-#define __OPTIMIZE__ 1
#include <argp.h>
-/* Add weak aliases. */
-#if _LIBC - 0 && defined (weak_alias)
-
+void
+__argp_usage (const struct argp_state *__state)
+{
+ __argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
+}
weak_alias (__argp_usage, argp_usage)
+
+int
+__option_is_short (const struct argp_option *__opt)
+{
+ if (__opt->flags & OPTION_DOC)
+ return 0;
+ else
+ {
+ int __key = __opt->key;
+ return __key > 0 && __key <= UCHAR_MAX && isprint (__key);
+ }
+}
weak_alias (__option_is_short, _option_is_short)
-weak_alias (__option_is_end, _option_is_end)
-#endif
+int
+__option_is_end (const struct argp_option *__opt)
+{
+ return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
+}
+weak_alias (__option_is_end, _option_is_end)
diff --git a/argp/argp.h b/argp/argp.h
index 77d696c6..b899a53b 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -518,17 +518,13 @@ extern void *__argp_input (const struct argp *__restrict __argp,
# define __option_is_end _option_is_end
# endif
-# ifndef ARGP_EI
-# define ARGP_EI __extern_inline
-# endif
-
-ARGP_EI void
+__extern_inline void
__argp_usage (const struct argp_state *__state)
{
__argp_state_help (__state, stderr, ARGP_HELP_STD_USAGE);
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_short (const struct argp_option *__opt))
{
if (__opt->flags & OPTION_DOC)
@@ -540,7 +536,7 @@ __NTH (__option_is_short (const struct argp_option *__opt))
}
}
-ARGP_EI int
+__extern_inline int
__NTH (__option_is_end (const struct argp_option *__opt))
{
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
--
2.27.0
From ee1d2a8a895d6d2df1b070db40d1239f0d99773a Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Fri, 22 Sep 2023 16:50:17 +0800
Subject: [PATCH 6/7] huawei manual patch
---
Makeconfig | 2 +-
Makefile | 30 +++++++++++++++---------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/Makeconfig b/Makeconfig
index 6eb1a815..9ef8a613 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1380,7 +1380,7 @@ endif
all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
- gnulib iconv iconvdata wctype manual shadow gshadow po argp \
+ gnulib iconv iconvdata wctype shadow gshadow po argp \
localedata timezone rt conform debug mathvec support \
dlfcn elf
diff --git a/Makefile b/Makefile
index c6d4817a..80590f24 100644
--- a/Makefile
+++ b/Makefile
@@ -465,9 +465,9 @@ $(installed-stubs): include/stubs-prologue.h subdir_install
rm -f $(objpfx)stubs.h
# This makes the Info or DVI file of the documentation from the Texinfo source.
-.PHONY: info dvi pdf html
-info dvi pdf html:
- $(MAKE) $(PARALLELMFLAGS) -C manual $@
+#.PHONY: info dvi pdf html
+#info dvi pdf html:
+# $(MAKE) $(PARALLELMFLAGS) -C manual $@
# This makes all the subdirectory targets.
@@ -731,18 +731,18 @@ dist: dist-prepare
fi
endif
-INSTALL: manual/install-plain.texi manual/macros.texi \
- $(common-objpfx)manual/pkgvers.texi manual/install.texi
- makeinfo --no-validate --plaintext --no-number-sections \
- -I$(common-objpfx)manual $< -o $@-tmp
- $(AWK) 'NF == 0 { ++n; next } \
- NF != 0 { while (n-- > 0) print ""; n = 0; print }' \
- < $@-tmp > $@-tmp2
- rm -f $@-tmp
- -chmod a-w $@-tmp2
- mv -f $@-tmp2 $@
-$(common-objpfx)manual/%: FORCE
- $(MAKE) $(PARALLELMFLAGS) -C manual $@
+#INSTALL: manual/install-plain.texi manual/macros.texi \
+# $(common-objpfx)manual/pkgvers.texi manual/install.texi
+# makeinfo --no-validate --plaintext --no-number-sections \
+# -I$(common-objpfx)manual $< -o $@-tmp
+# $(AWK) 'NF == 0 { ++n; next } \
+# NF != 0 { while (n-- > 0) print ""; n = 0; print }' \
+# < $@-tmp > $@-tmp2
+# rm -f $@-tmp
+# -chmod a-w $@-tmp2
+# mv -f $@-tmp2 $@
+#$(common-objpfx)manual/%: FORCE
+# $(MAKE) $(PARALLELMFLAGS) -C manual $@
FORCE:
iconvdata/% localedata/% po/%: FORCE
--
2.27.0
From 12c77e033696b3b4a8f20fb236c3f379c2a45399 Mon Sep 17 00:00:00 2001
From: 15859157387 <977713017@qq.com>
Date: Wed, 27 Sep 2023 09:16:26 +0800
Subject: [PATCH 7/7] my fix
---
Makeconfig | 6 +++---
elf/Makefile | 2 --
math/Makefile | 4 ----
nptl/Makefile | 1 +
stdio-common/vfscanf-internal.c | 1 -
stdlib/setenv.c | 1 -
sysdeps/posix/fpathconf.c | 24 ++++++++++++------------
sysdeps/posix/pathconf.c | 24 ++++++++++++------------
8 files changed, 28 insertions(+), 35 deletions(-)
diff --git a/Makeconfig b/Makeconfig
index 9ef8a613..b8e49999 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -886,9 +886,9 @@ else
endif
+gccwarn += -Wundef
ifeq ($(enable-werror),yes)
-+gccwarn += -Werror
++gccwarn +=
endif
-+gccwarn-c = -Wstrict-prototypes -Wold-style-definition
++gccwarn-c = -Wstrict-prototypes -Wold-style-definition -Wno-error=unsupported-floating-point-opt -Wno-error=asm-operand-widths -Wno-error=unknown-attributes
# We do not depend on the address of constants in different files to be
# actually different, so allow the compiler to merge them all.
@@ -1065,7 +1065,7 @@ CPPFLAGS = $(config-extra-cppflags) $(CPPFLAGS-config) \
$(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F))) \
-DTOP_NAMESPACE=glibc
-override CFLAGS = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
+override CFLAGS = -std=gnu11 -fgnu89-inline -Wno-error=ignored-attributes $(config-extra-cflags) \
$(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
$(+extra-math-flags) $(+extra-time-flags) \
$(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
diff --git a/elf/Makefile b/elf/Makefile
index 0cd5163a..0e17f950 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -98,7 +98,6 @@ endif
# Make sure that the compiler does not insert any library calls in tunables
# code paths.
ifeq (yes,$(have-loop-to-function))
-CFLAGS-dl-tunables.c += -fno-tree-loop-distribute-patterns
endif
all-dl-routines = $(dl-routines) $(sysdep-dl-routines)
@@ -154,7 +153,6 @@ CFLAGS-dl-minimal-malloc.op = $(no-stack-protector)
# On targets without __builtin_memset, rtld.c uses a hand-coded loop
# in _dl_start. Make sure this isn't turned into a call to regular memset.
ifeq (yes,$(have-loop-to-function))
-CFLAGS-rtld.c += -fno-tree-loop-distribute-patterns
endif
# Compile rtld itself without stack protection.
diff --git a/math/Makefile b/math/Makefile
index a9daae09..90501448 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1004,10 +1004,6 @@ CFLAGS-s_ynf.c += -fno-builtin-ynf32
# These files quiet sNaNs in a way that is optimized away without
# -fsignaling-nans.
-CFLAGS-s_modf.c += $(config-cflags-signaling-nans)
-CFLAGS-s_modff.c += $(config-cflags-signaling-nans)
-CFLAGS-s_modfl.c += $(config-cflags-signaling-nans)
-CFLAGS-s_modff128.c += $(config-cflags-signaling-nans)
$(addprefix $(objpfx),\
$(filter-out $(tests-static) $(libm-tests-vector),\
diff --git a/nptl/Makefile b/nptl/Makefile
index ffa5722e..328ac981 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -257,6 +257,7 @@ CFLAGS-pthread_once.c += $(uses-callbacks) -fexceptions \
-fasynchronous-unwind-tables
CFLAGS-pthread_cond_wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-pthread_kill.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pthread_join_common.c = -Wno-error=incompatible-pointer-types
CFLAGS-sem_wait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sem_timedwait.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-sem_clockwait.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/stdio-common/vfscanf-internal.c b/stdio-common/vfscanf-internal.c
index 9b1197d7..871b0e06 100644
--- a/stdio-common/vfscanf-internal.c
+++ b/stdio-common/vfscanf-internal.c
@@ -1560,7 +1560,6 @@ __vfscanf_internal (FILE *s, const char *format, va_list argptr,
above, but the test for "map != NULL" is done
inside the loop here and outside the loop there. */
DIAG_PUSH_NEEDS_COMMENT;
- DIAG_IGNORE_NEEDS_COMMENT (4.7, "-Wmaybe-uninitialized");
if (__glibc_unlikely (map != NULL))
wcdigits[n] = digits_extended[n];
diff --git a/stdlib/setenv.c b/stdlib/setenv.c
index cc71287f..e41cf27b 100644
--- a/stdlib/setenv.c
+++ b/stdlib/setenv.c
@@ -24,7 +24,6 @@
there seems to be no way to pacify GCC selectively, only for the
place where it's needed. Do not use DIAG_IGNORE_NEEDS_COMMENT
here, as it's not defined yet. */
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#include <errno.h>
#if !_LIBC
diff --git a/sysdeps/posix/fpathconf.c b/sysdeps/posix/fpathconf.c
index ce432962..b16671e5 100644
--- a/sysdeps/posix/fpathconf.c
+++ b/sysdeps/posix/fpathconf.c
@@ -103,23 +103,23 @@ __fpathconf (int fd, int name)
#endif
case _PC_CHOWN_RESTRICTED:
-#if _POSIX_CHOWN_RESTRICTED == -1
-# error "Invalid value for _POSIX_CHOWN_RESTRICTED"
-#endif
+#ifdef _POSIX_CHOWN_RESTRICTED
return _POSIX_CHOWN_RESTRICTED;
-
- case _PC_NO_TRUNC:
-#if _POSIX_NO_TRUNC == -1
-# error "Invalid value for _POSIX_NO_TRUNC"
+#else
+ return -1;
#endif
+ case _PC_NO_TRUNC:
+#ifdef _POSIX_NO_TRUNC
return _POSIX_NO_TRUNC;
-
- case _PC_VDISABLE:
-#if _POSIX_VDISABLE == -1
-# error "Invalid value for _POSIX_VDISABLE"
+#else
+ return -1;
#endif
+ case _PC_VDISABLE:
+#ifdef _POSIX_VDISABLE
return _POSIX_VDISABLE;
-
+#else
+ return -1;
+#endif
case _PC_SYNC_IO:
#ifdef _POSIX_SYNC_IO
return _POSIX_SYNC_IO;
diff --git a/sysdeps/posix/pathconf.c b/sysdeps/posix/pathconf.c
index 2cf0ad5a..51621370 100644
--- a/sysdeps/posix/pathconf.c
+++ b/sysdeps/posix/pathconf.c
@@ -101,23 +101,23 @@ __pathconf (const char *path, int name)
#endif
case _PC_CHOWN_RESTRICTED:
-#if _POSIX_CHOWN_RESTRICTED == -1
-# error "Invalid value for _POSIX_CHOWN_RESTRICTED"
-#endif
+#ifdef _POSIX_CHOWN_RESTRICTED
return _POSIX_CHOWN_RESTRICTED;
-
- case _PC_NO_TRUNC:
-#if _POSIX_NO_TRUNC == -1
-# error "Invalid value for _POSIX_NO_TRUNC"
+#else
+ return -1;
#endif
+ case _PC_NO_TRUNC:
+#ifdef _POSIX_NO_TRUNC
return _POSIX_NO_TRUNC;
-
- case _PC_VDISABLE:
-#if _POSIX_VDISABLE == -1
-# error "Invalid value for _POSIX_VDISABLE"
+#else
+ return -1;
#endif
+ case _PC_VDISABLE:
+#ifdef _POSIX_VDISABLE
return _POSIX_VDISABLE;
-
+#else
+ return -1;
+#endif
case _PC_SYNC_IO:
#ifdef _POSIX_SYNC_IO
return _POSIX_SYNC_IO;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ren-yi43/glibc.git
git@gitee.com:ren-yi43/glibc.git
ren-yi43
glibc
glibc
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385