Initial commit
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
--- a/sysdeps/x86/fpu/math-barriers.h
|
||||
+++ b/sysdeps/x86/fpu/math-barriers.h
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef X86_MATH_BARRIERS_H
|
||||
#define X86_MATH_BARRIERS_H 1
|
||||
|
||||
-#ifdef __SSE2_MATH__
|
||||
+#if defined __SSE2_MATH__ && !defined __clang__
|
||||
# define math_opt_barrier(x) \
|
||||
({ __typeof(x) __x; \
|
||||
if (sizeof (x) <= sizeof (double) \
|
||||
@@ -0,0 +1,321 @@
|
||||
diff -ruN a/Makeconfig b/Makeconfig
|
||||
--- a/Makeconfig 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/Makeconfig 2026-03-15 17:40:53.944414759 -0500
|
||||
@@ -709,38 +709,110 @@
|
||||
# makefiles to use additional libraries for linking executables and
|
||||
# shared libraries built by glibc.
|
||||
ifndef gnulib
|
||||
-ifneq ($(have-cc-with-libunwind),yes)
|
||||
- libunwind =
|
||||
-else
|
||||
- libunwind = -lunwind
|
||||
-endif
|
||||
-libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
|
||||
+libunwind =
|
||||
+# Preserve the configured target selection when asking the compiler for
|
||||
+# support libraries and CRT objects. For Clang, prefer
|
||||
+# compiler-rt builtins if available because libgcc lookups may resolve to a
|
||||
+# host archive.
|
||||
+cc-runtime-flags := $(filter-out -I%,$(CFLAGS)) $(sysdep-LDFLAGS) $(LDFLAGS)
|
||||
+cc-runtime-target := $(shell $(CC) $(cc-runtime-flags) -print-target-triple 2>/dev/null)
|
||||
+cc-clang-resource-dir := $(shell $(CC) $(cc-runtime-flags) --print-resource-dir 2>/dev/null)
|
||||
+cc-clang-rtlib-flags := $(shell \
|
||||
+ if test "$(have-test-clang)" = yes; then \
|
||||
+ for candidate in i686-linux-gnu i686-unknown-linux-gnu i386-unknown-linux-gnu "$(cc-runtime-target)"; do \
|
||||
+ if test -n "$$candidate"; then \
|
||||
+ rtlib=$$($(CC) $(cc-runtime-flags) --target=$$candidate \
|
||||
+ --rtlib=compiler-rt --print-libgcc-file-name 2>/dev/null); \
|
||||
+ if test "x$$rtlib" != x && test "x$$rtlib" != xlibgcc.a && test -r "$$rtlib"; then \
|
||||
+ printf '%s' "--target=$$candidate --rtlib=compiler-rt"; \
|
||||
+ exit 0; \
|
||||
+ fi; \
|
||||
+ fi; \
|
||||
+ done; \
|
||||
+ fi)
|
||||
+cc-clang-crtbegin := $(shell \
|
||||
+ if test "$(have-test-clang)" = yes; then \
|
||||
+ for path in \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-linux-gnu/clang_rt.crtbegin-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-unknown-linux-gnu/clang_rt.crtbegin-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i386-unknown-linux-gnu/clang_rt.crtbegin-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/$(cc-runtime-target)/clang_rt.crtbegin-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/linux/clang_rt.crtbegin-i386.o"; do \
|
||||
+ if test -r "$$path"; then \
|
||||
+ printf '%s' "$$path"; \
|
||||
+ exit 0; \
|
||||
+ fi; \
|
||||
+ done; \
|
||||
+ fi)
|
||||
+cc-clang-crtend := $(shell \
|
||||
+ if test "$(have-test-clang)" = yes; then \
|
||||
+ for path in \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-linux-gnu/clang_rt.crtend-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-unknown-linux-gnu/clang_rt.crtend-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i386-unknown-linux-gnu/clang_rt.crtend-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/$(cc-runtime-target)/clang_rt.crtend-i386.o" \
|
||||
+ "$(cc-clang-resource-dir)/lib/linux/clang_rt.crtend-i386.o"; do \
|
||||
+ if test -r "$$path"; then \
|
||||
+ printf '%s' "$$path"; \
|
||||
+ exit 0; \
|
||||
+ fi; \
|
||||
+ done; \
|
||||
+ fi)
|
||||
+libgcc := $(shell \
|
||||
+ lib=$$($(CC) $(cc-runtime-flags) --print-libgcc-file-name 2>/dev/null); \
|
||||
+ if test "$(have-test-clang)" = yes; then \
|
||||
+ rtlib=$$($(CC) $(cc-runtime-flags) $(cc-clang-rtlib-flags) \
|
||||
+ --print-libgcc-file-name 2>/dev/null); \
|
||||
+ if test "x$$rtlib" != x && test "x$$rtlib" != xlibgcc.a && test -r "$$rtlib"; then \
|
||||
+ lib=$$rtlib; \
|
||||
+ else \
|
||||
+ for path in \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-linux-gnu/libclang_rt.builtins.a" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i686-unknown-linux-gnu/libclang_rt.builtins.a" \
|
||||
+ "$(cc-clang-resource-dir)/lib/i386-unknown-linux-gnu/libclang_rt.builtins.a" \
|
||||
+ "$(cc-clang-resource-dir)/lib/$(cc-runtime-target)/libclang_rt.builtins.a" \
|
||||
+ "$(cc-clang-resource-dir)/lib/linux/libclang_rt.builtins-i386.a"; do \
|
||||
+ if test -r "$$path"; then \
|
||||
+ lib=$$path; \
|
||||
+ break; \
|
||||
+ fi; \
|
||||
+ done; \
|
||||
+ fi; \
|
||||
+ fi; \
|
||||
+ printf '%s' "$$lib")
|
||||
+# Do not mix Clang's compiler-rt builtins with GCC crtbegin/crtend
|
||||
+# objects. If compiler-rt CRT objects are unavailable, leave these
|
||||
+# empty and let the link proceed without the GCC startup fragments.
|
||||
+cc-clang-use-rt := $(and $(filter yes,$(have-test-clang)),$(cc-clang-rtlib-flags))
|
||||
+libgcc_eh_archive := $(shell $(CC) $(cc-runtime-flags) --print-file-name=libgcc_eh.a)
|
||||
+libgcc_s := $(shell $(CC) $(cc-runtime-flags) --print-file-name=libgcc_s.so$(libgcc_s.so-version))
|
||||
+libgcc_eh := -Wl,--as-needed $(libgcc_s) $(libunwind) -Wl,--no-as-needed
|
||||
gnulib-arch =
|
||||
-gnulib = -lgcc $(gnulib-arch)
|
||||
-gnulib-tests := -lgcc $(libgcc_eh)
|
||||
-gnulib-extralibdir = $(dir $(shell $(CC) -print-file-name=libgcc_s.so$(libgcc_s.so-version)))
|
||||
+gnulib = $(libgcc) $(gnulib-arch)
|
||||
+gnulib-tests := $(libgcc) $(libgcc_eh)
|
||||
+gnulib-extralibdir = $(patsubst ./,,$(dir $(libgcc_s)))
|
||||
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 = $(libgcc) $(static-gnulib-arch)
|
||||
else
|
||||
-static-gnulib = -lgcc -lgcc_eh $(static-gnulib-arch)
|
||||
+static-gnulib = $(libgcc) $(libgcc_eh_archive) $(static-gnulib-arch)
|
||||
endif
|
||||
-static-gnulib-tests := -lgcc -lgcc_eh $(libunwind)
|
||||
-libc.so-gnulib := -lgcc
|
||||
+static-gnulib-tests := $(libgcc) $(libgcc_eh_archive) $(libunwind)
|
||||
+libc.so-gnulib := $(libgcc)
|
||||
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 = $(if $(cc-clang-use-rt),$(cc-clang-crtbegin),`$(CC) $(cc-runtime-flags) --print-file-name=crtbegin.o`)
|
||||
++postctor = $(if $(cc-clang-use-rt),$(cc-clang-crtend),`$(CC) $(cc-runtime-flags) --print-file-name=crtend.o`)
|
||||
# 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 = $(if $(cc-clang-use-rt),$(cc-clang-crtbegin),`$(CC) $(cc-runtime-flags) --print-file-name=crtbeginS.o`)
|
||||
++postctorS = $(if $(cc-clang-use-rt),$(cc-clang-crtend),`$(CC) $(cc-runtime-flags) --print-file-name=crtendS.o`)
|
||||
# Variants of the two previous definitions for statically linking programs.
|
||||
-static-prector = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtbeginT.o`
|
||||
-static-postctor = `$(CC) $(sysdep-LDFLAGS) --print-file-name=crtend.o`
|
||||
+static-prector = $(if $(cc-clang-use-rt),$(cc-clang-crtbegin),`$(CC) $(cc-runtime-flags) --print-file-name=crtbeginT.o`)
|
||||
+static-postctor = $(if $(cc-clang-use-rt),$(cc-clang-crtend),`$(CC) $(cc-runtime-flags) --print-file-name=crtend.o`)
|
||||
ifeq (yes,$(enable-static-pie))
|
||||
# Static PIE must use PIE variants.
|
||||
+prectorT = $(if $($(@F)-no-pie),$(static-prector),$(+prectorS))
|
||||
diff -ruN a/Makerules b/Makerules
|
||||
--- a/Makerules 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/Makerules 2026-03-15 17:40:29.652012402 -0500
|
||||
@@ -543,7 +543,7 @@
|
||||
$(call after-link,$@)
|
||||
|
||||
define build-shlib-helper
|
||||
-$(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \
|
||||
+$(LINK.o) -shared $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-rtlib-flags)),-nostartfiles $(cc-clang-rtlib-flags),-static-libgcc) -Wl,-O1 $(sysdep-LDFLAGS) \
|
||||
$(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(rtld-LDFLAGS) \
|
||||
$(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \
|
||||
$(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
|
||||
@@ -555,11 +555,13 @@
|
||||
|
||||
define build-shlib
|
||||
$(build-shlib-helper) -o $@ \
|
||||
- $(csu-objpfx)abi-note.o $(build-shlib-objlist)
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtbegin)),$(if $(filter c.so,$(@F)),,$(+preinit)) $(+prectorS)) \
|
||||
+ $(csu-objpfx)abi-note.o $(build-shlib-objlist) \
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtend)),$(+postctorS) $(if $(filter c.so,$(@F)),,$(+postinit)))
|
||||
endef
|
||||
|
||||
define build-module-helper
|
||||
-$(LINK.o) -shared -static-libgcc $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
|
||||
+$(LINK.o) -shared $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-rtlib-flags)),-nostartfiles $(cc-clang-rtlib-flags),-static-libgcc) $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
|
||||
$(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) \
|
||||
$(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \
|
||||
-B$(csu-objpfx) $(load-map-file) \
|
||||
@@ -574,14 +576,18 @@
|
||||
# not for shared objects
|
||||
define build-module
|
||||
$(build-module-helper) -o $@ \
|
||||
- $(csu-objpfx)abi-note.o $(build-module-objlist) $(link-libc-args)
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtbegin)),$(+preinit) $(+prectorS)) \
|
||||
+ $(csu-objpfx)abi-note.o $(build-module-objlist) $(link-libc-args) \
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtend)),$(+postctorS) $(+postinit))
|
||||
$(call after-link,$@)
|
||||
endef
|
||||
define build-module-asneeded
|
||||
$(build-module-helper) -o $@ \
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtbegin)),$(+preinit) $(+prectorS)) \
|
||||
$(csu-objpfx)abi-note.o \
|
||||
-Wl,--as-needed $(build-module-objlist) -Wl,--no-as-needed \
|
||||
- $(link-libc-args)
|
||||
+ $(link-libc-args) \
|
||||
+ $(if $(and $(filter yes,$(have-test-clang)),$(cc-clang-crtend)),$(+postctorS) $(+postinit))
|
||||
$(call after-link,$@)
|
||||
endef
|
||||
|
||||
diff -ruN a/configure b/configure
|
||||
--- a/configure 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/configure 2026-03-15 17:40:29.652602103 -0500
|
||||
@@ -9328,18 +9328,28 @@
|
||||
config_vars="$config_vars
|
||||
enable-static-pie = $libc_cv_static_pie"
|
||||
|
||||
-# Check if we can link support functionality against libgcc_s.
|
||||
+# Check if the compiler reports usable support functionality from libgcc_s.
|
||||
# Must not be used for linking installed binaries, to produce the
|
||||
# same binaries for bootstrapped and bootstrapping builds (the latter
|
||||
# with a GCC that does not build libgcc_s).
|
||||
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC can link against -lgcc_s" >&5
|
||||
-printf %s "checking whether $CC can link against -lgcc_s... " >&6; }
|
||||
+#
|
||||
+# The compiler-reported runtime may be an absolute path rather than a bare
|
||||
+# library name, for example when using llvm-libgcc. Include the configured
|
||||
+# target-selection flags so multilib and compiler-rt builds query the
|
||||
+# matching runtime.
|
||||
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC reports a usable libgcc_s" >&5
|
||||
+printf %s "checking whether $CC reports a usable libgcc_s... " >&6; }
|
||||
if test ${libc_cv_have_libgcc_s+y}
|
||||
then :
|
||||
printf %s "(cached) " >&6
|
||||
else case e in #(
|
||||
e) old_LIBS="$LIBS"
|
||||
- LIBS="$LIBS -lgcc_s"
|
||||
+ libc_cv_libgcc_s=`$CC $CFLAGS $LDFLAGS -print-file-name=libgcc_s.so 2>/dev/null`
|
||||
+ if test "x$libc_cv_libgcc_s" = "xlibgcc_s.so"
|
||||
+ then :
|
||||
+ libc_cv_have_libgcc_s=no
|
||||
+ else case e in #(
|
||||
+ e) LIBS="$LIBS $libc_cv_libgcc_s"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
@@ -9360,6 +9370,9 @@
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
+ ;;
|
||||
+esac
|
||||
+ fi
|
||||
LIBS="$old_LIBS" ;;
|
||||
esac
|
||||
fi
|
||||
@@ -11002,5 +11015,3 @@
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
|
||||
printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
||||
fi
|
||||
-
|
||||
-
|
||||
diff -ruN a/configure.ac b/configure.ac
|
||||
--- a/configure.ac 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/configure.ac 2026-03-15 17:40:29.653053992 -0500
|
||||
@@ -2122,15 +2122,24 @@
|
||||
fi
|
||||
LIBC_CONFIG_VAR([enable-static-pie], [$libc_cv_static_pie])
|
||||
|
||||
-# Check if we can link support functionality against libgcc_s.
|
||||
+# Check if the compiler reports usable support functionality from libgcc_s.
|
||||
# Must not be used for linking installed binaries, to produce the
|
||||
# same binaries for bootstrapped and bootstrapping builds (the latter
|
||||
# with a GCC that does not build libgcc_s).
|
||||
-AC_CACHE_CHECK([whether $CC can link against -lgcc_s], libc_cv_have_libgcc_s, [dnl
|
||||
+# The compiler-reported runtime may be an absolute path rather than a bare
|
||||
+# library name, for example when using llvm-libgcc. Include the configured
|
||||
+# target-selection flags so multilib and compiler-rt builds query the
|
||||
+# matching runtime.
|
||||
+AC_CACHE_CHECK([whether $CC reports a usable libgcc_s], libc_cv_have_libgcc_s, [dnl
|
||||
old_LIBS="$LIBS"
|
||||
- LIBS="$LIBS -lgcc_s"
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
- [libc_cv_have_libgcc_s=yes], [libc_cv_have_libgcc_s=no])
|
||||
+ libc_cv_libgcc_s=`$CC $CFLAGS $LDFLAGS -print-file-name=libgcc_s.so 2>/dev/null`
|
||||
+ if test "x$libc_cv_libgcc_s" = "xlibgcc_s.so"; then
|
||||
+ libc_cv_have_libgcc_s=no
|
||||
+ else
|
||||
+ LIBS="$LIBS $libc_cv_libgcc_s"
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
|
||||
+ [libc_cv_have_libgcc_s=yes], [libc_cv_have_libgcc_s=no])
|
||||
+ fi
|
||||
LIBS="$old_LIBS"])
|
||||
LIBC_CONFIG_VAR([have-libgcc_s], [$libc_cv_have_libgcc_s])
|
||||
|
||||
diff -ruN a/dlfcn/Makefile b/dlfcn/Makefile
|
||||
--- a/dlfcn/Makefile 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/dlfcn/Makefile 2026-03-15 17:40:29.653172707 -0500
|
||||
@@ -187,7 +187,7 @@
|
||||
$(objpfx)bug-atexit2.out: $(objpfx)bug-atexit2-lib.so
|
||||
|
||||
ifneq (,$(CXX))
|
||||
-LDLIBS-bug-atexit3-lib.so = -lstdc++ -lgcc_eh
|
||||
+LDLIBS-bug-atexit3-lib.so = -lstdc++ $(libgcc_eh_archive)
|
||||
$(objpfx)bug-atexit3-lib.so: $(libsupport)
|
||||
$(objpfx)bug-atexit3.out: $(objpfx)bug-atexit3-lib.so
|
||||
endif
|
||||
diff -ruN a/elf/Makefile b/elf/Makefile
|
||||
--- a/elf/Makefile 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/elf/Makefile 2026-03-15 17:40:29.653314888 -0500
|
||||
@@ -1514,7 +1514,7 @@
|
||||
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,-(' $^ $(libgcc) '-Wl,-)' -Wl,-Map,$@T
|
||||
rm -f %@T.o $@.o
|
||||
mv -f $@T $@
|
||||
|
||||
@@ -1544,7 +1544,7 @@
|
||||
$(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,-(' $^ $(libgcc) '-Wl,-)' \
|
||||
-Wl,-Map,$@.map
|
||||
|
||||
generated += librtld.map librtld.mk rtld-libc.a librtld.os.map
|
||||
diff -ruN a/support/Makefile b/support/Makefile
|
||||
--- a/support/Makefile 2026-01-23 14:54:00.000000000 -0600
|
||||
+++ b/support/Makefile 2026-03-15 17:40:29.653481645 -0500
|
||||
@@ -284,14 +284,14 @@
|
||||
|
||||
ifeq (,$(CXX))
|
||||
LINKS_DSO_PROGRAM = links-dso-program-c
|
||||
-LDLIBS-links-dso-program-c = -lgcc
|
||||
+LDLIBS-links-dso-program-c = $(libgcc)
|
||||
ifeq ($(have-libgcc_s),yes)
|
||||
CFLAGS-links-dso-program-c.c += -fexceptions
|
||||
-LDLIBS-links-dso-program-c += -lgcc_s $(libunwind)
|
||||
+LDLIBS-links-dso-program-c += $(libgcc_s) $(libunwind)
|
||||
endif
|
||||
else
|
||||
LINKS_DSO_PROGRAM = links-dso-program
|
||||
-LDLIBS-links-dso-program = -lstdc++ -lgcc -lgcc_s $(libunwind)
|
||||
+LDLIBS-links-dso-program = -lstdc++ $(libgcc) $(libgcc_s) $(libunwind)
|
||||
endif
|
||||
|
||||
ifeq (yes,$(have-selinux))
|
||||
@@ -0,0 +1,72 @@
|
||||
Submitted By: Armin K. <krejzi at email dot com>
|
||||
Date: 2013-02-11
|
||||
Initial Package Version: 2.17
|
||||
Upstream Status: Not Applicable
|
||||
Origin: Self
|
||||
Description: This patch removes references to /var/db directory which is not part
|
||||
of FHS and replaces them with more suitable directories in /var
|
||||
hierarchy - /var/cache/nscd for nscd and /var/lib/nss_db for nss_db.
|
||||
|
||||
--- a/Makeconfig 2012-12-25 04:02:13.000000000 +0100
|
||||
+++ b/Makeconfig 2013-02-11 01:32:32.500667439 +0100
|
||||
@@ -250,7 +250,7 @@
|
||||
|
||||
# Directory for the database files and Makefile for nss_db.
|
||||
ifndef vardbdir
|
||||
-vardbdir = $(localstatedir)/db
|
||||
+vardbdir = $(localstatedir)/lib/nss_db
|
||||
endif
|
||||
inst_vardbdir = $(install_root)$(vardbdir)
|
||||
|
||||
--- a/nscd/nscd.h 2012-12-25 04:02:13.000000000 +0100
|
||||
+++ b/nscd/nscd.h 2013-02-11 01:32:32.500667439 +0100
|
||||
@@ -112,11 +112,11 @@
|
||||
|
||||
|
||||
/* Paths of the file for the persistent storage. */
|
||||
-#define _PATH_NSCD_PASSWD_DB "/var/db/nscd/passwd"
|
||||
-#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group"
|
||||
-#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts"
|
||||
-#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services"
|
||||
-#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup"
|
||||
+#define _PATH_NSCD_PASSWD_DB "/var/cache/nscd/passwd"
|
||||
+#define _PATH_NSCD_GROUP_DB "/var/cache/nscd/group"
|
||||
+#define _PATH_NSCD_HOSTS_DB "/var/cache/nscd/hosts"
|
||||
+#define _PATH_NSCD_SERVICES_DB "/var/cache/nscd/services"
|
||||
+#define _PATH_NSCD_NETGROUP_DB "/var/cache/nscd/netgroup"
|
||||
|
||||
/* Path used when not using persistent storage. */
|
||||
#define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX"
|
||||
--- a/nss/db-Makefile 2012-12-25 04:02:13.000000000 +0100
|
||||
+++ b/nss/db-Makefile 2013-02-11 01:32:32.500667439 +0100
|
||||
@@ -22,7 +22,7 @@
|
||||
/etc/rpc /etc/services /etc/shadow /etc/gshadow \
|
||||
/etc/netgroup)
|
||||
|
||||
-VAR_DB = /var/db
|
||||
+VAR_DB = /var/lib/nss_db
|
||||
|
||||
AWK = awk
|
||||
MAKEDB = makedb --quiet
|
||||
--- a/sysdeps/generic/paths.h 2012-12-25 04:02:13.000000000 +0100
|
||||
+++ b/sysdeps/generic/paths.h 2013-02-11 01:32:32.500667439 +0100
|
||||
@@ -68,7 +68,7 @@
|
||||
/* Provide trailing slash, since mostly used for building pathnames. */
|
||||
#define _PATH_DEV "/dev/"
|
||||
#define _PATH_TMP "/tmp/"
|
||||
-#define _PATH_VARDB "/var/db/"
|
||||
+#define _PATH_VARDB "/var/lib/nss_db/"
|
||||
#define _PATH_VARRUN "/var/run/"
|
||||
#define _PATH_VARTMP "/var/tmp/"
|
||||
|
||||
--- a/sysdeps/unix/sysv/linux/paths.h 2012-12-25 04:02:13.000000000 +0100
|
||||
+++ b/sysdeps/unix/sysv/linux/paths.h 2013-02-11 01:32:32.504000831 +0100
|
||||
@@ -68,7 +68,7 @@
|
||||
/* Provide trailing slash, since mostly used for building pathnames. */
|
||||
#define _PATH_DEV "/dev/"
|
||||
#define _PATH_TMP "/tmp/"
|
||||
-#define _PATH_VARDB "/var/db/"
|
||||
+#define _PATH_VARDB "/var/lib/nss_db/"
|
||||
#define _PATH_VARRUN "/var/run/"
|
||||
#define _PATH_VARTMP "/var/tmp/"
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
--- a/sysdeps/unix/sysv/linux/x86/longjmp.c
|
||||
+++ b/sysdeps/unix/sysv/linux/x86/longjmp.c
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
/* Assert that the priv field in struct pthread_unwind_buf has space
|
||||
to store shadow stack pointer. */
|
||||
+#if defined SHADOW_STACK_POINTER_OFFSET && SHADOW_STACK_POINTER_OFFSET > 0
|
||||
_Static_assert ((offsetof (struct pthread_unwind_buf, priv)
|
||||
<= SHADOW_STACK_POINTER_OFFSET)
|
||||
&& ((offsetof (struct pthread_unwind_buf, priv)
|
||||
@@ -37,3 +38,4 @@
|
||||
+ SHADOW_STACK_POINTER_SIZE)),
|
||||
"Shadow stack pointer is not within private storage "
|
||||
"of pthread_unwind_buf.");
|
||||
+#endif
|
||||
@@ -0,0 +1,154 @@
|
||||
--- a/sysdeps/x86/fpu/sfp-machine.h
|
||||
+++ b/sysdeps/x86/fpu/sfp-machine.h
|
||||
@@ -2,6 +2,7 @@
|
||||
libgcc, with soft-float and other irrelevant parts removed. */
|
||||
|
||||
#include <math-inline-asm.h>
|
||||
+#include <fenv.h>
|
||||
|
||||
#if HAVE_X86_LIBGCC_CMP_RETURN_ATTR
|
||||
/* The type of the result of a floating point comparison. This must
|
||||
@@ -65,76 +66,82 @@
|
||||
# define _FP_WS_TYPE signed long int
|
||||
# define _FP_I_TYPE long int
|
||||
|
||||
+# ifdef __clang__
|
||||
+# define __SFP_REG(x) (x)
|
||||
+# else
|
||||
+# define __SFP_REG(x) ((USItype) (x))
|
||||
+# endif
|
||||
+
|
||||
# define __FP_FRAC_ADD_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
|
||||
__asm__ ("add{l} {%11,%3|%3,%11}\n\t" \
|
||||
"adc{l} {%9,%2|%2,%9}\n\t" \
|
||||
"adc{l} {%7,%1|%1,%7}\n\t" \
|
||||
"adc{l} {%5,%0|%0,%5}" \
|
||||
- : "=r" ((USItype) (r3)), \
|
||||
- "=&r" ((USItype) (r2)), \
|
||||
- "=&r" ((USItype) (r1)), \
|
||||
- "=&r" ((USItype) (r0)) \
|
||||
- : "%0" ((USItype) (x3)), \
|
||||
- "g" ((USItype) (y3)), \
|
||||
- "%1" ((USItype) (x2)), \
|
||||
- "g" ((USItype) (y2)), \
|
||||
- "%2" ((USItype) (x1)), \
|
||||
- "g" ((USItype) (y1)), \
|
||||
- "%3" ((USItype) (x0)), \
|
||||
- "g" ((USItype) (y0)))
|
||||
+ : "=r" (__SFP_REG (r3)), \
|
||||
+ "=&r" (__SFP_REG (r2)), \
|
||||
+ "=&r" (__SFP_REG (r1)), \
|
||||
+ "=&r" (__SFP_REG (r0)) \
|
||||
+ : "%0" (__SFP_REG (x3)), \
|
||||
+ "g" (__SFP_REG (y3)), \
|
||||
+ "%1" (__SFP_REG (x2)), \
|
||||
+ "g" (__SFP_REG (y2)), \
|
||||
+ "%2" (__SFP_REG (x1)), \
|
||||
+ "g" (__SFP_REG (y1)), \
|
||||
+ "%3" (__SFP_REG (x0)), \
|
||||
+ "g" (__SFP_REG (y0)))
|
||||
# define __FP_FRAC_ADD_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
|
||||
__asm__ ("add{l} {%8,%2|%2,%8}\n\t" \
|
||||
"adc{l} {%6,%1|%1,%6}\n\t" \
|
||||
"adc{l} {%4,%0|%0,%4}" \
|
||||
- : "=r" ((USItype) (r2)), \
|
||||
- "=&r" ((USItype) (r1)), \
|
||||
- "=&r" ((USItype) (r0)) \
|
||||
- : "%0" ((USItype) (x2)), \
|
||||
- "g" ((USItype) (y2)), \
|
||||
- "%1" ((USItype) (x1)), \
|
||||
- "g" ((USItype) (y1)), \
|
||||
- "%2" ((USItype) (x0)), \
|
||||
- "g" ((USItype) (y0)))
|
||||
+ : "=r" (__SFP_REG (r2)), \
|
||||
+ "=&r" (__SFP_REG (r1)), \
|
||||
+ "=&r" (__SFP_REG (r0)) \
|
||||
+ : "%0" (__SFP_REG (x2)), \
|
||||
+ "g" (__SFP_REG (y2)), \
|
||||
+ "%1" (__SFP_REG (x1)), \
|
||||
+ "g" (__SFP_REG (y1)), \
|
||||
+ "%2" (__SFP_REG (x0)), \
|
||||
+ "g" (__SFP_REG (y0)))
|
||||
# define __FP_FRAC_SUB_4(r3,r2,r1,r0,x3,x2,x1,x0,y3,y2,y1,y0) \
|
||||
__asm__ ("sub{l} {%11,%3|%3,%11}\n\t" \
|
||||
"sbb{l} {%9,%2|%2,%9}\n\t" \
|
||||
"sbb{l} {%7,%1|%1,%7}\n\t" \
|
||||
"sbb{l} {%5,%0|%0,%5}" \
|
||||
- : "=r" ((USItype) (r3)), \
|
||||
- "=&r" ((USItype) (r2)), \
|
||||
- "=&r" ((USItype) (r1)), \
|
||||
- "=&r" ((USItype) (r0)) \
|
||||
- : "0" ((USItype) (x3)), \
|
||||
- "g" ((USItype) (y3)), \
|
||||
- "1" ((USItype) (x2)), \
|
||||
- "g" ((USItype) (y2)), \
|
||||
- "2" ((USItype) (x1)), \
|
||||
- "g" ((USItype) (y1)), \
|
||||
- "3" ((USItype) (x0)), \
|
||||
- "g" ((USItype) (y0)))
|
||||
+ : "=r" (__SFP_REG (r3)), \
|
||||
+ "=&r" (__SFP_REG (r2)), \
|
||||
+ "=&r" (__SFP_REG (r1)), \
|
||||
+ "=&r" (__SFP_REG (r0)) \
|
||||
+ : "0" (__SFP_REG (x3)), \
|
||||
+ "g" (__SFP_REG (y3)), \
|
||||
+ "1" (__SFP_REG (x2)), \
|
||||
+ "g" (__SFP_REG (y2)), \
|
||||
+ "2" (__SFP_REG (x1)), \
|
||||
+ "g" (__SFP_REG (y1)), \
|
||||
+ "3" (__SFP_REG (x0)), \
|
||||
+ "g" (__SFP_REG (y0)))
|
||||
# define __FP_FRAC_SUB_3(r2,r1,r0,x2,x1,x0,y2,y1,y0) \
|
||||
__asm__ ("sub{l} {%8,%2|%2,%8}\n\t" \
|
||||
"sbb{l} {%6,%1|%1,%6}\n\t" \
|
||||
"sbb{l} {%4,%0|%0,%4}" \
|
||||
- : "=r" ((USItype) (r2)), \
|
||||
- "=&r" ((USItype) (r1)), \
|
||||
- "=&r" ((USItype) (r0)) \
|
||||
- : "0" ((USItype) (x2)), \
|
||||
- "g" ((USItype) (y2)), \
|
||||
- "1" ((USItype) (x1)), \
|
||||
- "g" ((USItype) (y1)), \
|
||||
- "2" ((USItype) (x0)), \
|
||||
- "g" ((USItype) (y0)))
|
||||
+ : "=r" (__SFP_REG (r2)), \
|
||||
+ "=&r" (__SFP_REG (r1)), \
|
||||
+ "=&r" (__SFP_REG (r0)) \
|
||||
+ : "0" (__SFP_REG (x2)), \
|
||||
+ "g" (__SFP_REG (y2)), \
|
||||
+ "1" (__SFP_REG (x1)), \
|
||||
+ "g" (__SFP_REG (y1)), \
|
||||
+ "2" (__SFP_REG (x0)), \
|
||||
+ "g" (__SFP_REG (y0)))
|
||||
# define __FP_FRAC_ADDI_4(x3,x2,x1,x0,i) \
|
||||
__asm__ ("add{l} {%4,%3|%3,%4}\n\t" \
|
||||
"adc{l} {$0,%2|%2,0}\n\t" \
|
||||
"adc{l} {$0,%1|%1,0}\n\t" \
|
||||
"adc{l} {$0,%0|%0,0}" \
|
||||
- : "+r" ((USItype) (x3)), \
|
||||
- "+&r" ((USItype) (x2)), \
|
||||
- "+&r" ((USItype) (x1)), \
|
||||
- "+&r" ((USItype) (x0)) \
|
||||
- : "g" ((USItype) (i)))
|
||||
+ : "+r" (__SFP_REG (x3)), \
|
||||
+ "+&r" (__SFP_REG (x2)), \
|
||||
+ "+&r" (__SFP_REG (x1)), \
|
||||
+ "+&r" (__SFP_REG (x0)) \
|
||||
+ : "g" (__SFP_REG (i)))
|
||||
|
||||
|
||||
# define _FP_MUL_MEAT_S(R,X,Y) \
|
||||
@@ -210,12 +217,10 @@
|
||||
(FP_EX_INVALID | FP_EX_DENORM | FP_EX_DIVZERO | FP_EX_OVERFLOW \
|
||||
| FP_EX_UNDERFLOW | FP_EX_INEXACT)
|
||||
|
||||
-void __sfp_handle_exceptions (int);
|
||||
-
|
||||
#define FP_HANDLE_EXCEPTIONS \
|
||||
do { \
|
||||
if (__builtin_expect (_fex, 0)) \
|
||||
- __sfp_handle_exceptions (_fex); \
|
||||
+ __feraiseexcept (_fex & FE_ALL_EXCEPT); \
|
||||
} while (0);
|
||||
|
||||
#define FP_TRAPPING_EXCEPTIONS ((~_fcw >> FP_EX_SHIFT) & FP_EX_ALL)
|
||||
@@ -0,0 +1,127 @@
|
||||
[package]
|
||||
name = "glibc"
|
||||
version = "2.43"
|
||||
revision = 4
|
||||
description = "GNU C Library"
|
||||
homepage = "https://sourceware.org/glibc"
|
||||
license = "LGPL-2.1-or-later"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "nsswitch.conf"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "ld.so.conf"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "locale-gen"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "locale.gen.txt"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "glibc-longjmp-ssp-fix.patch"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "glibc-sfp-handle-exceptions-fix.patch"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "glibc-2.43-use-compiler-reported-libgcc.patch"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "ldd"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "lib32-postinstall.sh"
|
||||
sha256 = "skip"
|
||||
|
||||
[[manual_sources]]
|
||||
file = "glibc-2.43-clang-math-barriers.patch"
|
||||
sha256 = "skip"
|
||||
|
||||
[[source]]
|
||||
url = "https://mirrors.kernel.org/gnu/glibc/glibc-$version.tar.xz"
|
||||
sha256 = "d9c86c6b5dbddb43a3e08270c5844fc5177d19442cf5b8df4be7c07cd5fa3831"
|
||||
extract_dir = "$name-$version"
|
||||
patches = ["glibc-fhs-1.patch","glibc-longjmp-ssp-fix.patch","glibc-sfp-handle-exceptions-fix.patch","glibc-2.43-use-compiler-reported-libgcc.patch", "glibc-2.43-clang-math-barriers.patch" ]
|
||||
post_extract = ["mkdir -p build", "echo 'rootsbindir=/usr/sbin' > build/configparms"]
|
||||
|
||||
[build]
|
||||
type = "autotools"
|
||||
|
||||
[build.flags]
|
||||
build_dir = "build"
|
||||
|
||||
prefix = "/usr"
|
||||
|
||||
configure = [
|
||||
"--disable-werror",
|
||||
"--disable-nscd",
|
||||
"libc_cv_slibdir=/usr/lib",
|
||||
"--enable-stack-protector=strong",
|
||||
"--enable-kernel=5.4",
|
||||
]
|
||||
|
||||
post_compile = [
|
||||
"sed '/test-installation/s@$(PERL)@echo not running@' -i Makefile",
|
||||
"touch ./locale/programs/charmap-kw.h",
|
||||
"touch ./locale/programs/locfile-kw.h"
|
||||
]
|
||||
|
||||
post_install = [
|
||||
"mkdir -p $DESTDIR/etc",
|
||||
"cp -rv $DEPOT_SPECDIR/ld.so.conf $DEPOT_SPECDIR/nsswitch.conf $DESTDIR/etc",
|
||||
"rm -f ${DESTDIR}/etc/ld.so.cache",
|
||||
|
||||
"install -dm755 \"${DESTDIR}\"/usr/share/i18n",
|
||||
"install -dm755 \"${DESTDIR}\"/usr/lib/locale",
|
||||
|
||||
"install -m644 posix/gai.conf \"${DESTDIR}\"/etc/gai.conf",
|
||||
"install -m755 \"${DEPOT_SPECDIR}\"/locale-gen \"${DESTDIR}\"/usr/bin",
|
||||
"install -m644 \"${DEPOT_SPECDIR}\"/locale.gen.txt \"${DESTDIR}\"/etc/locale.gen",
|
||||
|
||||
"sed -e '1,3d' -e 's|/| |g' -e 's|\\\\| |g' -e 's|^|#|g' localedata/SUPPORTED >> \"${DESTDIR}\"/etc/locale.gen",
|
||||
"sed -e '1,3d' -e 's|/| |g' -e 's| \\\\||g' localedata/SUPPORTED > \"${DESTDIR}\"/usr/share/i18n/SUPPORTED",
|
||||
|
||||
"sed -i '/#C\\.UTF-8 /d' \"${DESTDIR}\"/etc/locale.gen",
|
||||
"rm $DESTDIR/usr/bin/ldd",
|
||||
"install -m 0755 $DEPOT_SPECDIR/ldd $DESTDIR/usr/bin/ldd"
|
||||
]
|
||||
|
||||
use_lto = false
|
||||
|
||||
keep = [ "etc/locale.gen", "etc/ld.so.conf", "etc/nsswitch.conf", "etc/gai.conf" ]
|
||||
|
||||
# you can do the tests if you want, not me though...
|
||||
skip_tests = true
|
||||
|
||||
no_delete_static = true
|
||||
|
||||
build_32 = true
|
||||
|
||||
configure_lib32 = [
|
||||
"--disable-werror",
|
||||
"--disable-nscd",
|
||||
"libc_cv_slibdir=/usr/lib32",
|
||||
"libc_cv_cc_with_libunwind=no",
|
||||
"--enable-stack-protector=strong",
|
||||
"--enable-kernel=5.4",
|
||||
]
|
||||
|
||||
post_install_lib32 = [ "mkdir -p $DESTDIR/usr/include/gnu/", "install -vm644 destdir/usr/include/gnu/stubs-32.h destdir/usr/include/gnu/lib-names-32.h $DESTDIR/usr/include/gnu/" ]
|
||||
ldflags-lib32 += [ "-L/usr/lib32 -Wl,-rpath-link,/usr/lib32" ]
|
||||
|
||||
[dependencies]
|
||||
runtime = ["filesystem", "tzdata", "linux-headers"]
|
||||
build = [ "python" ]
|
||||
|
||||
[dependencies.lib32]
|
||||
runtime = ["filesystem", "tzdata", "linux-headers"]
|
||||
build = [ "python" ]
|
||||
@@ -0,0 +1,3 @@
|
||||
/usr/local/lib
|
||||
/opt/lib
|
||||
include /etc/ld.so.conf.d/*.conf
|
||||
+176
@@ -0,0 +1,176 @@
|
||||
#!/bin/sh
|
||||
# Copyright (C) 1996-2026 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
|
||||
# The GNU C Library is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
# The GNU C Library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with the GNU C Library; if not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
# This is the `ldd' command, which lists what shared libraries are
|
||||
# used by given dynamically-linked executables. It works by invoking the
|
||||
# run-time dynamic linker as a command and setting the environment
|
||||
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
|
||||
|
||||
RTLDLIST="/lib64/ld-linux-x86-64.so.2 /lib/ld-linux.so.2 /libx32/ld-linux-x32.so.2"
|
||||
warn=
|
||||
bind_now=
|
||||
verbose=
|
||||
unused=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--vers | --versi | --versio | --version)
|
||||
echo 'ldd (GNU libc) 2.43'
|
||||
printf "Copyright (C) %s Free Software Foundation, Inc.\n\
|
||||
This is free software; see the source for copying conditions. There is NO\n\
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" "2024"
|
||||
printf "Written by %s and %s.\n" "Roland McGrath" "Ulrich Drepper"
|
||||
exit 0
|
||||
;;
|
||||
--h | --he | --hel | --help)
|
||||
echo "Usage: ldd [OPTION]... FILE...
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-d, --data-relocs process data relocations
|
||||
-r, --function-relocs process data and function relocations
|
||||
-u, --unused print unused direct dependencies
|
||||
-v, --verbose print all information
|
||||
"
|
||||
printf "For bug reporting instructions, please see:\\n%s.\\n" \
|
||||
"<https://www.gnu.org/software/libc/bugs.html>"
|
||||
exit 0
|
||||
;;
|
||||
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
|
||||
--data-rel | --data-relo | --data-reloc | --data-relocs)
|
||||
warn=yes
|
||||
shift
|
||||
;;
|
||||
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
|
||||
--function | --function- | --function-r | --function-re | --function-rel | \
|
||||
--function-relo | --function-reloc | --function-relocs)
|
||||
warn=yes
|
||||
bind_now=yes
|
||||
shift
|
||||
;;
|
||||
-v | --verb | --verbo | --verbos | --verbose)
|
||||
verbose=yes
|
||||
shift
|
||||
;;
|
||||
-u | --u | --un | --unu | --unus | --unuse | --unused)
|
||||
unused=yes
|
||||
shift
|
||||
;;
|
||||
--v | --ve | --ver)
|
||||
echo >&2 "ldd: option \`$1' is ambiguous"
|
||||
exit 1
|
||||
;;
|
||||
--) # Stop option processing.
|
||||
shift; break
|
||||
;;
|
||||
-*)
|
||||
echo >&2 'ldd:' "unrecognized option" "\`$1'"
|
||||
echo >&2 "Try \`ldd --help' for more information."
|
||||
exit 1
|
||||
;;
|
||||
*)
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
nonelf ()
|
||||
{
|
||||
# Maybe extra code for non-ELF binaries.
|
||||
return 1;
|
||||
}
|
||||
|
||||
add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
|
||||
add_env="$add_env LD_VERBOSE=$verbose"
|
||||
if test "$unused" = yes; then
|
||||
add_env="$add_env LD_DEBUG=\"$LD_DEBUG${LD_DEBUG:+,}unused\""
|
||||
fi
|
||||
|
||||
try_trace() (
|
||||
output=$(eval $add_env '"$@"' 2>&1; rc=$?; printf 'x'; exit $rc)
|
||||
rc=$?
|
||||
printf '%s' "${output%x}"
|
||||
return $rc
|
||||
)
|
||||
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 'ldd:' "missing file arguments"
|
||||
echo >&2 "Try \`ldd --help' for more information."
|
||||
exit 1
|
||||
;;
|
||||
1)
|
||||
single_file=t
|
||||
;;
|
||||
*)
|
||||
single_file=f
|
||||
;;
|
||||
esac
|
||||
|
||||
result=0
|
||||
for file do
|
||||
test $single_file = t || echo "${file}:"
|
||||
case $file in
|
||||
*/*) : ;;
|
||||
*) file=./$file ;;
|
||||
esac
|
||||
if test ! -e "$file"; then
|
||||
echo "ldd: ${file}:" "No such file or directory" >&2
|
||||
result=1
|
||||
elif test ! -f "$file"; then
|
||||
echo "ldd: ${file}:" "not regular file" >&2
|
||||
result=1
|
||||
elif test -r "$file"; then
|
||||
test -x "$file" || echo 'ldd:' "\
|
||||
warning: you do not have execution permission for" "\`$file'" >&2
|
||||
RTLD=
|
||||
ret=1
|
||||
for rtld in ${RTLDLIST}; do
|
||||
if test -x $rtld; then
|
||||
verify_out=`${rtld} --verify "$file"`
|
||||
ret=$?
|
||||
case $ret in
|
||||
[02]) RTLD=${rtld}; break;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
case $ret in
|
||||
1)
|
||||
nonelf "$file" || {
|
||||
echo " not a dynamic executable" >&2
|
||||
result=1
|
||||
}
|
||||
;;
|
||||
0|2)
|
||||
try_trace "$RTLD" "$file" || result=1
|
||||
;;
|
||||
*)
|
||||
echo 'ldd:' ${RTLD} "exited with unknown exit code" "($ret)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo 'ldd:' "error: you do not have read permission for" "\`$file'" >&2
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $result
|
||||
# Local Variables:
|
||||
# mode:sh
|
||||
# End:
|
||||
@@ -0,0 +1 @@
|
||||
echo "/usr/lib32" >> etc/ld.so.conf
|
||||
@@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
LOCALEGEN=/etc/locale.gen
|
||||
LOCALES=/usr/share/i18n/locales
|
||||
LOCALES_OVERRIDES=/usr/local/share/i18n/locales
|
||||
|
||||
if [ -n "$POSIXLY_CORRECT" ]; then
|
||||
unset POSIXLY_CORRECT
|
||||
fi
|
||||
|
||||
|
||||
[ -f $LOCALEGEN -a -s $LOCALEGEN ] || exit 0;
|
||||
|
||||
# Remove all old locale dir and locale-archive before generating new
|
||||
# locale data.
|
||||
rm -rf /usr/lib/locale/locale-archive || true
|
||||
|
||||
umask 022
|
||||
|
||||
is_entry_ok() {
|
||||
if [ -z "$locale" ] || [ -z "$charset" ]; then
|
||||
echo "error: Bad entry '$locale $charset'"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
echo "Generating locales..."
|
||||
while read -r locale charset; do
|
||||
if [ -z "$locale" ] || [ "${locale#\#}" != "$locale" ]; then continue; fi
|
||||
is_entry_ok || continue
|
||||
|
||||
# strip charmap and at-suffix for locale base
|
||||
locale_base="${locale%%.*}"
|
||||
locale_base="${locale_base%%@*}"
|
||||
|
||||
# optional at-suffix
|
||||
locale_at="${locale#*@}"
|
||||
[ "$locale_at" = "$locale" ] && locale_at= || locale_at="@$locale_at"
|
||||
|
||||
printf " %s.%s%s..." "$locale_base" "$charset" "$locale_at"
|
||||
|
||||
# fully matching override locale
|
||||
if [ -e "$LOCALES_OVERRIDES/$locale" ]; then
|
||||
input="$LOCALES_OVERRIDES/$locale"
|
||||
# fully matching vendor locale
|
||||
elif [ -e "$LOCALES/$locale" ]; then
|
||||
input="$locale"
|
||||
# fallback to partial matches
|
||||
else
|
||||
# locale base with optional at-suffix
|
||||
input="$locale_base$locale_at"
|
||||
# override partial locale
|
||||
if [ -e "$LOCALES_OVERRIDES/$input" ]; then
|
||||
input="$LOCALES_OVERRIDES/$input"
|
||||
fi
|
||||
fi
|
||||
|
||||
localedef -i "$input" -c -f "$charset" -A /usr/share/locale/locale.alias "$locale" || :
|
||||
echo ' done'
|
||||
done < $LOCALEGEN
|
||||
echo "Generation complete."
|
||||
@@ -0,0 +1,17 @@
|
||||
# Configuration file for locale-gen
|
||||
#
|
||||
# lists of locales that are to be generated by the locale-gen command.
|
||||
#
|
||||
# Each line is of the form:
|
||||
#
|
||||
# <locale> <charset>
|
||||
#
|
||||
# where <locale> is one of the locales given in /usr/share/i18n/locales
|
||||
# and <charset> is one of the character sets listed in /usr/share/i18n/charmaps
|
||||
#
|
||||
# The locale-gen command will generate all the locales,
|
||||
# placing them in /usr/lib/locale.
|
||||
#
|
||||
# A list of supported locales is given in /usr/share/i18n/SUPPORTED
|
||||
# and is included in this file. Uncomment the needed locales below.
|
||||
#
|
||||
@@ -0,0 +1,11 @@
|
||||
passwd: files
|
||||
group: files
|
||||
shadow: files
|
||||
|
||||
hosts: files dns
|
||||
networks: files
|
||||
|
||||
protocols: files
|
||||
services: files
|
||||
ethers: files
|
||||
rpc: files
|
||||
Reference in New Issue
Block a user