1756 lines
66 KiB
RPMSpec
1756 lines
66 KiB
RPMSpec
%define anolis_release 3
|
|
|
|
%bcond_without testsuite
|
|
# Default: Always build the benchtests.
|
|
%bcond_without benchtests
|
|
# Default: Not bootstrapping.
|
|
%bcond_with bootstrap
|
|
# Default: Enable using -Werror
|
|
%bcond_without werror
|
|
# Default: Always build documentation.
|
|
%bcond_without docs
|
|
|
|
# Default: Always run valgrind tests if there is architecture support.
|
|
%ifarch x86_64 aarch64
|
|
%bcond_without valgrind
|
|
%else
|
|
%bcond_with valgrind
|
|
%endif
|
|
|
|
%if %{with bootstrap}
|
|
# Disable benchtests, -Werror, docs, and valgrind if we're bootstrapping
|
|
%undefine with_benchtests
|
|
%undefine with_werror
|
|
%undefine with_docs
|
|
%undefine with_valgrind
|
|
%endif
|
|
|
|
# We do our own build flags management. In particular, see
|
|
# rpm_inherit_flags below.
|
|
%undefine _auto_set_build_flags
|
|
|
|
##############################################################################
|
|
# Utility functions for pre/post scripts. Stick them at the beginning of
|
|
# any lua %pre, %post, %postun, etc. sections to have them expand into
|
|
# those scripts. It only works in lua sections and not anywhere else.
|
|
%define glibc_post_funcs() \
|
|
-- We use lua posix.exec because there may be no shell that we can \
|
|
-- run during glibc upgrade. We used to implement much of %%post as a \
|
|
-- C program, but from an overall maintenance perspective the lua in \
|
|
-- the spec file was simpler and safer given the operations required. \
|
|
-- All lua code will be ignored by rpm-ostree; see: \
|
|
-- https://github.com/projectatomic/rpm-ostree/pull/1869 \
|
|
-- If we add new lua actions to the %%post code we should coordinate \
|
|
-- with rpm-ostree and ensure that their glibc install is functional. \
|
|
function post_exec (program, ...) \
|
|
local pid = posix.fork () \
|
|
if pid == 0 then \
|
|
posix.exec (program, ...) \
|
|
assert (nil) \
|
|
elseif pid > 0 then \
|
|
posix.wait (pid) \
|
|
end \
|
|
end \
|
|
\
|
|
function update_gconv_modules_cache () \
|
|
local iconv_dir = "%{_libdir}/gconv" \
|
|
local iconv_cache = iconv_dir .. "/gconv-modules.cache" \
|
|
local iconv_modules = iconv_dir .. "/gconv-modules" \
|
|
if (posix.utime (iconv_modules) == 0) then \
|
|
if (posix.utime (iconv_cache) == 0) then \
|
|
post_exec ("%{_prefix}/sbin/iconvconfig", \
|
|
"-o", iconv_cache, \
|
|
"--nostdlib", \
|
|
iconv_dir) \
|
|
else \
|
|
io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n") \
|
|
end \
|
|
end \
|
|
end \
|
|
%{nil}
|
|
|
|
##############################################################################
|
|
# %%package glibc - The GNU C Library (glibc) core package.
|
|
##############################################################################
|
|
Summary: The GNU libc libraries
|
|
Name: glibc
|
|
Version: 2.36
|
|
Release: %{anolis_release}%{?dist}
|
|
|
|
# In general, GPLv2+ is used by programs, LGPLv2+ is used for
|
|
# libraries.
|
|
#
|
|
# LGPLv2+ with exceptions is used for things that are linked directly
|
|
# into dynamically linked programs and shared libraries (e.g. crt
|
|
# files, lib*_nonshared.a). Historically, this exception also applies
|
|
# to parts of libio.
|
|
#
|
|
# GPLv2+ with exceptions is used for parts of the Arm unwinder.
|
|
#
|
|
# GFDL is used for the documentation.
|
|
#
|
|
# Some other licenses are used in various places (BSD, Inner-Net,
|
|
# ISC, Public Domain).
|
|
#
|
|
# HSRL and FSFAP are only used in test cases, which currently do not
|
|
# ship in binary RPMs, so they are not listed here. MIT is used for
|
|
# scripts/install-sh, which does not ship, either.
|
|
#
|
|
# GPLv3+ is used by manual/texinfo.tex, which we do not use.
|
|
#
|
|
# LGPLv3+ is used by some Hurd code, which we do not build.
|
|
#
|
|
# LGPLv2 is used in one place (time/timespec_get.c, by mistake), but
|
|
# it is not actually compiled, so it does not matter for libraries.
|
|
License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+ and GPLv2+ with exceptions and BSD and Inner-Net and ISC and Public Domain and GFDL
|
|
|
|
URL: http://www.gnu.org/software/glibc/
|
|
Source0: https://ftp.gnu.org/gnu/glibc/%{name}-%{version}.tar.xz
|
|
Source1: bench.mk
|
|
Source2: glibc-bench-compare
|
|
Source10: wrap-find-debuginfo.sh
|
|
Source20: langpacklist
|
|
|
|
######################################################################
|
|
# Activate the wrapper script for debuginfo generation, by rewriting
|
|
# the definition of __debug_install_post.
|
|
%{lua:
|
|
local wrapper = rpm.expand("%{SOURCE10}")
|
|
local sysroot = rpm.expand("%{glibc_sysroot}")
|
|
local original = rpm.expand("%{macrobody:__debug_install_post}")
|
|
-- Strip leading newline. It confuses the macro redefinition.
|
|
-- Avoid embedded newlines that confuse the macro definition.
|
|
original = original:match("^%s*(.-)%s*$"):gsub("\\\n", "")
|
|
rpm.define("__debug_install_post bash " .. wrapper
|
|
.. " " .. sysroot .. " " .. original)
|
|
}
|
|
|
|
# The wrapper script relies on the fact that debugedit does not change
|
|
# build IDs.
|
|
%define _no_recompute_build_ids 1
|
|
%undefine _unique_build_ids
|
|
|
|
##############################################################################
|
|
# Patches:
|
|
# - See each individual patch file for origin and upstream status.
|
|
# - For new patches follow template.patch format.
|
|
##############################################################################
|
|
Patch1: glibc-no-archive-for-localedef.patch
|
|
Patch2: glibc-place-info-into-Libraries-category.patch
|
|
Patch3: glibc-nscd-add-syslog-target-dependency.patch
|
|
Patch4: glibc-fix-newlocale-error-return.patch
|
|
Patch5: glibc-cs-path.patch
|
|
Patch6: glibc-python3.patch
|
|
Patch7: glibc-deprecated-selinux-makedb.patch
|
|
|
|
# patches sync from 2.36 release branch
|
|
Patch0101: 0001-stdlib-Suppress-gcc-diagnostic-that-char8_t-is-a-key.patch
|
|
Patch0102: 0002-wcsmbs-Add-missing-test-c8rtomb-test-mbrtoc8-depende.patch
|
|
Patch0103: 0003-dlfcn-Pass-caller-pointer-to-static-dlopen-implement.patch
|
|
Patch0104: 0004-Update-syscall-lists-for-Linux-5.19.patch
|
|
Patch0105: 0005-elf-Replace-strcpy-call-with-memcpy-BZ-29454.patch
|
|
Patch0106: 0006-Linux-Terminate-subprocess-on-late-failure-in-tst-pi.patch
|
|
Patch0107: 0007-alpha-Fix-generic-brk-system-call-emulation-in-__brk.patch
|
|
Patch0108: 0008-socket-Check-lengths-before-advancing-pointer-in-CMS.patch
|
|
Patch0109: 0009-NEWS-Add-entry-for-bug-28846.patch
|
|
Patch0110: 0010-glibcextract.py-Add-compile_c_snippet.patch
|
|
Patch0111: 0011-linux-Use-compile_c_snippet-to-check-linux-pidfd.h-a.patch
|
|
Patch0112: 0012-linux-Mimic-kernel-defition-for-BLOCK_SIZE.patch
|
|
Patch0113: 0013-linux-Use-compile_c_snippet-to-check-linux-mount.h-a.patch
|
|
Patch0114: 0014-linux-Fix-sys-mount.h-usage-with-kernel-headers.patch
|
|
Patch0115: 0015-Linux-Fix-enum-fsconfig_command-detection-in-sys-mou.patch
|
|
Patch0116: 0016-syslog-Fix-large-messages-BZ-29536.patch
|
|
Patch0117: 0017-elf-Call-__libc_early_init-for-reused-namespaces-bug.patch
|
|
Patch0118: 0018-Apply-asm-redirections-in-wchar.h-before-first-use.patch
|
|
Patch0119: 0019-elf-Restore-how-vDSO-dependency-is-printed-with-LD_T.patch
|
|
Patch0120: 0020-syslog-Remove-extra-whitespace-between-timestamp-and.patch
|
|
Patch0121: 0021-Add-NEWS-entry-for-CVE-2022-39046.patch
|
|
Patch0122: 0022-nscd-Fix-netlink-cache-invalidation-if-epoll-is-used.patch
|
|
Patch0123: 0023-resolv-Add-tst-resolv-byaddr-for-testing-reverse-loo.patch
|
|
Patch0124: 0024-resolv-Add-tst-resolv-aliases.patch
|
|
Patch0125: 0025-resolv-Add-internal-__res_binary_hnok-function.patch
|
|
Patch0126: 0026-resolv-Add-the-__ns_samebinaryname-function.patch
|
|
Patch0127: 0027-resolv-Add-internal-__ns_name_length_uncompressed-fu.patch
|
|
Patch0128: 0028-resolv-Add-DNS-packet-parsing-helpers-geared-towards.patch
|
|
Patch0129: 0029-nss_dns-Split-getanswer_ptr-from-getanswer_r.patch
|
|
Patch0130: 0030-nss_dns-Rewrite-_nss_dns_gethostbyaddr2_r-and-getans.patch
|
|
Patch0131: 0031-nss_dns-Remove-remnants-of-IPv6-address-mapping.patch
|
|
Patch0132: 0032-nss_dns-Rewrite-getanswer_r-to-match-getanswer_ptr-b.patch
|
|
Patch0133: 0033-nss_dns-In-gaih_getanswer_slice-skip-strange-aliases.patch
|
|
Patch0134: 0034-resolv-Add-new-tst-resolv-invalid-cname.patch
|
|
Patch0135: 0035-nss_dns-Rewrite-_nss_dns_gethostbyname4_r-using-curr.patch
|
|
Patch0136: 0036-resolv-Fix-building-tst-resolv-invalid-cname-for-ear.patch
|
|
Patch0137: 0037-NEWS-Note-bug-12154-and-bug-29305-as-fixed.patch
|
|
Patch0138: 0038-elf-Run-tst-audit-tlsdesc-tst-audit-tlsdesc-dlopen-e.patch
|
|
Patch0139: 0039-elf-Fix-hwcaps-string-size-overestimation.patch
|
|
Patch0140: 0040-scripts-dso-ordering-test.py-Generate-program-run-ti.patch
|
|
Patch0141: 0041-elf-Rename-_dl_sort_maps-parameter-from-skip-to-forc.patch
|
|
Patch0142: 0042-elf-Implement-force_first-handling-in-_dl_sort_maps_.patch
|
|
Patch0143: 0043-gconv-Use-64-bit-interfaces-in-gconv_parseconfdir-bu.patch
|
|
Patch0144: 0044-m68k-Enforce-4-byte-alignment-on-internal-locks-BZ-2.patch
|
|
Patch0145: 0045-get_nscd_addresses-Fix-subscript-typos-BZ-29605.patch
|
|
Patch0146: 0046-stdlib-Fix-__getrandom_nocancel-type-and-arc4random-.patch
|
|
Patch0147: 0047-hppa-Fix-initialization-of-dp-register-BZ-29635.patch
|
|
Patch0148: 0048-hppa-undef-__ASSUME_SET_ROBUST_LIST.patch
|
|
Patch0149: 0049-x86-include-BMI1-and-BMI2-in-x86-64-v3-level.patch
|
|
Patch0150: 0050-x86-64-Require-BMI2-for-AVX2-str-n-casecmp-implement.patch
|
|
Patch0151: 0051-x86-64-Require-BMI2-for-AVX2-strcmp-implementation.patch
|
|
Patch0152: 0052-x86-64-Require-BMI2-for-AVX2-strncmp-implementation.patch
|
|
Patch0153: 0053-x86-64-Require-BMI2-for-AVX2-wcs-n-cmp-implementatio.patch
|
|
Patch0154: 0054-x86-64-Require-BMI2-for-AVX2-raw-w-memchr-implementa.patch
|
|
Patch0155: 0055-x86-64-Require-BMI2-and-LZCNT-for-AVX2-memrchr-imple.patch
|
|
Patch0156: 0056-x86-64-Require-BMI1-BMI2-for-AVX2-strrchr-and-wcsrch.patch
|
|
Patch0157: 0057-nscd-Drop-local-address-tuple-variable-BZ-29607.patch
|
|
Patch0158: 0058-Ensure-calculations-happen-with-desired-rounding-mod.patch
|
|
Patch0159: 0059-nss-Implement-no-addrconfig-option-for-getent.patch
|
|
Patch0160: 0060-nss-Fix-tst-nss-files-hosts-long-on-single-stack-hos.patch
|
|
Patch0161: 0061-nss-Use-shared-prefix-in-IPv4-address-in-tst-reload1.patch
|
|
Patch0162: 0062-elf-Do-not-completely-clear-reused-namespace-in-dlmo.patch
|
|
Patch0163: 0063-Fix-BZ-29463-in-the-ibm128-implementation-of-y1l-too.patch
|
|
Patch0164: 0064-Avoid-undefined-behaviour-in-ibm128-implementation-o.patch
|
|
Patch0165: 0065-linux-Fix-generic-struct_stat-for-64-bit-time-BZ-296.patch
|
|
Patch0166: 0066-elf-Reinstate-on-DL_DEBUG_BINDINGS-_dl_lookup_symbol.patch
|
|
Patch0167: 0067-longlong.h-update-from-GCC-for-LoongArch-clz-ctz-sup.patch
|
|
Patch0168: 0068-linux-Fix-fstatat-on-MIPSn64-BZ-29730.patch
|
|
Patch0169: 0069-LoongArch-Fix-ABI-related-macros-in-elf.h-to-keep-co.patch
|
|
Patch0170: 0070-Makerules-fix-MAKEFLAGS-assignment-for-upcoming-make.patch
|
|
Patch0171: 0071-mktime-improve-heuristic-for-ca-1986-Indiana-DST.patch
|
|
Patch0172: 0072-Linux-Support-__IPC_64-in-sysvctl-ctl-command-argume.patch
|
|
Patch0173: 0073-elf-Fix-rtld-audit-trampoline-for-aarch64.patch
|
|
Patch0174: 0074-x86-Fix-wcsnlen-avx2-page-cross-length-comparison-BZ.patch
|
|
Patch0175: 0075-Apply-asm-redirections-in-syslog.h-before-first-use-.patch
|
|
Patch0176: 0076-nis-Build-libnsl-with-64-bit-time_t.patch
|
|
Patch0177: 0077-nscd-Use-64-bit-time_t-on-libc-nscd-routines-BZ-2940.patch
|
|
Patch0178: 0078-time-Use-64-bit-time-on-tzfile.patch
|
|
Patch0179: 0079-locale-prevent-maybe-uninitialized-errors-with-Os-BZ.patch
|
|
Patch0180: 0080-sunrpc-Suppress-GCC-Os-warning-on-user2netname.patch
|
|
Patch0181: 0081-x86-Fix-Os-build-BZ-29576.patch
|
|
|
|
##############################################################################
|
|
# Continued list of core "glibc" package information:
|
|
##############################################################################
|
|
Obsoletes: glibc-profile < 2.4
|
|
Obsoletes: nscd < 2.35
|
|
Provides: ldconfig
|
|
|
|
# The dynamic linker supports DT_GNU_HASH
|
|
Provides: rtld(GNU_HASH)
|
|
|
|
# Various components (regex, glob) have been imported from gnulib.
|
|
Provides: bundled(gnulib)
|
|
|
|
# We need libgcc for cancellation support in POSIX threads.
|
|
Requires: libgcc
|
|
Requires: glibc-common = %{version}-%{release}
|
|
Requires(pre): basesystem
|
|
Requires: basesystem
|
|
|
|
# This is for building auxiliary programs like memusage
|
|
# For initial glibc bootstraps it can be commented out
|
|
%if %{without bootstrap}
|
|
BuildRequires: gd-devel libpng-devel zlib-devel
|
|
%endif
|
|
%if %{without bootstrap}
|
|
BuildRequires: libselinux-devel >= 1.33.4-3
|
|
%endif
|
|
BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext
|
|
# We need procps-ng (/bin/ps), util-linux (/bin/kill), and gawk (/bin/awk),
|
|
# but it is more flexible to require the actual programs and let rpm infer
|
|
# the packages. However, until bug 1259054 is widely fixed we avoid the
|
|
# following:
|
|
# BuildRequires: /bin/ps, /bin/kill, /bin/awk
|
|
# And use instead (which should be reverted some time in the future):
|
|
BuildRequires: procps-ng, util-linux, gawk
|
|
BuildRequires: systemtap-sdt-devel
|
|
|
|
%if %{with valgrind}
|
|
# Require valgrind for smoke testing the dynamic loader to make sure we
|
|
# have not broken valgrind.
|
|
BuildRequires: valgrind
|
|
%endif
|
|
|
|
# We use python for the microbenchmarks and locale data regeneration
|
|
# from unicode sources (carried out manually). We choose python3
|
|
# explicitly because it supports both use cases. On some
|
|
# distributions, python3 does not actually install /usr/bin/python3,
|
|
# so we also depend on python3-devel.
|
|
BuildRequires: python3 python3-devel
|
|
|
|
# This GCC version is needed for -fstack-clash-protection support.
|
|
BuildRequires: gcc >= 7.2.1-6
|
|
%define enablekernel 3.2
|
|
Conflicts: kernel < %{enablekernel}
|
|
%define target %{_target_cpu}-anolis-linux
|
|
|
|
# GNU make 4.0 introduced the -O option.
|
|
BuildRequires: make >= 4.0
|
|
|
|
# The intl subsystem generates a parser using bison.
|
|
BuildRequires: bison >= 2.7
|
|
|
|
# binutils 2.30-17 is needed for --generate-missing-build-notes.
|
|
BuildRequires: binutils >= 2.30-17
|
|
|
|
# Earlier releases have broken support for IRELATIVE relocations
|
|
Conflicts: prelink < 0.4.2
|
|
|
|
%if %{without bootstrap}
|
|
%if %{with testsuite}
|
|
# The testsuite builds static C++ binaries that require a C++ compiler,
|
|
# static C++ runtime from libstdc++-static, and lastly static glibc.
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: libstdc++-static
|
|
# A configure check tests for the ability to create static C++ binaries
|
|
# before glibc is built and therefore we need a glibc-static for that
|
|
# check to pass even if we aren't going to use any of those objects to
|
|
# build the tests.
|
|
BuildRequires: glibc-static
|
|
|
|
# libidn2 (but not libidn2-devel) is needed for testing AI_IDN/NI_IDN.
|
|
BuildRequires: libidn2
|
|
|
|
# The testsuite runs mtrace, which is a perl script
|
|
BuildRequires: perl-interpreter
|
|
%endif
|
|
%endif
|
|
|
|
# Filter out all GLIBC_PRIVATE symbols since they are internal to
|
|
# the package and should not be examined by any other tool.
|
|
%global __filter_GLIBC_PRIVATE 1
|
|
%global __provides_exclude ^libc_malloc_debug\\.so.*$
|
|
|
|
# For language packs we have glibc require a virtual dependency
|
|
# "glibc-langpack" wich gives us at least one installed langpack.
|
|
# If no langpack providing 'glibc-langpack' was installed you'd
|
|
# get language-neutral support e.g. C, POSIX, and C.UTF-8 locales.
|
|
# In the past we used to install the glibc-all-langpacks by default
|
|
# but we no longer do this to minimize container and VM sizes.
|
|
# Today you must actively use the language packs infrastructure to
|
|
# install language support.
|
|
Requires: glibc-langpack = %{version}-%{release}
|
|
Suggests: glibc-minimal-langpack = %{version}-%{release}
|
|
|
|
# Suggest extra gconv modules so that they are installed by default but can be
|
|
# removed if needed to build a minimal OS image.
|
|
Recommends: glibc-gconv-extra = %{version}-%{release}
|
|
# Use system-rpm-config as a marker for a buildroot configuration, and
|
|
# unconditionally pull in glibc-gconv-extra in that case.
|
|
Requires: (glibc-gconv-extra = %{version}-%{release} if system-rpm-config)
|
|
|
|
%description
|
|
The glibc package contains standard libraries which are used by
|
|
multiple programs on the system. In order to save disk space and
|
|
memory, as well as to make upgrading easier, common system code is
|
|
kept in one place and shared between programs. This particular package
|
|
contains the most important sets of shared libraries: the standard C
|
|
library and the standard math library. Without these two libraries, a
|
|
Linux system will not function.
|
|
|
|
######################################################################
|
|
# libnsl subpackage
|
|
######################################################################
|
|
|
|
%package -n libnsl
|
|
Summary: Legacy support library for NIS
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description -n libnsl
|
|
This package provides the legacy version of libnsl library, for
|
|
accessing NIS services.
|
|
|
|
This library is provided for backwards compatibility only;
|
|
applications should use libnsl2 instead to gain IPv6 support.
|
|
|
|
##############################################################################
|
|
# glibc "devel" sub-package
|
|
##############################################################################
|
|
%package devel
|
|
Summary: Object files for development using standard C libraries.
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: libxcrypt-devel >= 4.0.0
|
|
Requires: kernel-headers >= 3.2
|
|
BuildRequires: kernel-headers >= 3.2
|
|
Provides: glibc-headers = %{version}-%{release}
|
|
Provides: glibc-headers(%{_target_cpu})
|
|
Obsoletes: glibc-headers < %{version}-%{release}
|
|
|
|
%description devel
|
|
The glibc-devel package contains the object files necessary
|
|
for developing programs which use the standard C libraries (which are
|
|
used by nearly all programs). If you are developing programs which
|
|
will use the standard C libraries, your system needs to have these
|
|
standard object files available in order to create the
|
|
executables.
|
|
|
|
Install glibc-devel if you are going to develop programs which will
|
|
use the standard C libraries.
|
|
|
|
##############################################################################
|
|
# glibc "doc" sub-package
|
|
##############################################################################
|
|
%if %{with docs}
|
|
%package doc
|
|
Summary: Documentation for GNU libc
|
|
BuildArch: noarch
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
# Removing texinfo will cause check-safety.sh test to fail because it seems to
|
|
# trigger documentation generation based on dependencies. We need to fix this
|
|
# upstream in some way that doesn't depend on generating docs to validate the
|
|
# texinfo. I expect it's simply the wrong dependency for that target.
|
|
BuildRequires: texinfo >= 5.0
|
|
|
|
%description doc
|
|
The glibc-doc package contains The GNU C Library Reference Manual in info
|
|
format. Additional package documentation is also provided.
|
|
%endif
|
|
|
|
##############################################################################
|
|
# glibc "static" sub-package
|
|
##############################################################################
|
|
%package static
|
|
Summary: C library static libraries for -static linking.
|
|
Requires: %{name}-devel = %{version}-%{release}
|
|
Requires: libxcrypt-static >= 4.0.0
|
|
|
|
%description static
|
|
The glibc-static package contains the C library static libraries
|
|
for -static linking. You don't need these, unless you link statically,
|
|
which is highly discouraged.
|
|
|
|
##############################################################################
|
|
# glibc "common" sub-package
|
|
##############################################################################
|
|
%package common
|
|
Summary: Common binaries and locale data for glibc
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: tzdata >= 2003a
|
|
|
|
%description common
|
|
The glibc-common package includes common binaries for the GNU libc
|
|
libraries, as well as national language (locale) support.
|
|
|
|
######################################################################
|
|
# File triggers to do ldconfig calls automatically (see rhbz#1380878)
|
|
######################################################################
|
|
|
|
# File triggers for when libraries are added or removed in standard
|
|
# paths.
|
|
%transfiletriggerin common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
|
|
/sbin/ldconfig
|
|
%end
|
|
|
|
%transfiletriggerpostun common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
|
|
/sbin/ldconfig
|
|
%end
|
|
|
|
# We need to run ldconfig manually because __brp_ldconfig assumes that
|
|
# glibc itself is always installed in $RPM_BUILD_ROOT, but with sysroots
|
|
# we may be installed into a subdirectory of that path. Therefore we
|
|
# unset __brp_ldconfig and run ldconfig by hand with the sysroots path
|
|
# passed to -r.
|
|
%undefine __brp_ldconfig
|
|
|
|
######################################################################
|
|
|
|
%package locale-source
|
|
Summary: The sources for the locales
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
|
|
%description locale-source
|
|
The sources for all locales provided in the language packs.
|
|
If you are building custom locales you will most likely use
|
|
these sources as the basis for your new locale.
|
|
|
|
%global locale_rx eo syr *_*
|
|
|
|
%package all-langpacks
|
|
Summary: All language packs for %{name}.
|
|
Provides: glibc-langpack = %{version}-%{release}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
%{lua:
|
|
-- List the langpacks provided by all-langpacks
|
|
lang_provides = {}
|
|
for line in io.lines(rpm.expand("%{SOURCE20}")) do
|
|
print(rpm.expand([[
|
|
Provides: %{name}-langpack-]]..line..[[ = %{version}-%{release}
|
|
Obsoletes: %{name}-langpack-]]..line..[[ <= %{version}-%{release}
|
|
]]))
|
|
end
|
|
}
|
|
|
|
%description all-langpacks
|
|
This package includes all the basic infomation required to support all language.
|
|
Exclude en and zh langpack.
|
|
|
|
%package langpack-en
|
|
Summary: Locale data for English
|
|
Provides: glibc-langpack = %{version}-%{release}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
|
|
%description langpack-en
|
|
The glibc-langpack-en package includes the basic information required
|
|
to support the English language in your applications.
|
|
|
|
%package langpack-zh
|
|
Summary: Locale data for Mandarin Chinese
|
|
Provides: glibc-langpack = %{version}-%{release}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
|
|
%description langpack-zh
|
|
The glibc-langpack-zh package includes the basic information required
|
|
to support the Mandarin Chinese language in your applications.
|
|
|
|
|
|
# No %files, this is an empty package. The C/POSIX and
|
|
# C.UTF-8 files are already installed by glibc. We create
|
|
# minimal-langpack because the virtual provide of
|
|
# glibc-langpack needs at least one package installed
|
|
# to satisfy it. Given that no-locales installed is a valid
|
|
# use case we support it here with this package.
|
|
%package minimal-langpack
|
|
Summary: Minimal language packs for %{name}.
|
|
Provides: glibc-langpack = %{version}-%{release}
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
%description minimal-langpack
|
|
This is a Meta package that is used to install minimal language packs.
|
|
This package ensures you can use C, POSIX, or C.UTF-8 locales, but
|
|
nothing else. It is designed for assembling a minimal system.
|
|
%files minimal-langpack
|
|
|
|
# Infrequently used iconv converter modules.
|
|
%package gconv-extra
|
|
Summary: All iconv converter modules for %{name}.
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: %{name}-common = %{version}-%{release}
|
|
|
|
%description gconv-extra
|
|
This package contains all iconv converter modules built in %{name}.
|
|
|
|
##############################################################################
|
|
# Subpackages for NSS modules except nss_files, nss_compat, nss_dns
|
|
##############################################################################
|
|
|
|
# This should remain it's own subpackage or "Provides: nss_db" to allow easy
|
|
# migration from old systems that previously had the old nss_db package
|
|
# installed. Note that this doesn't make the migration that smooth, the
|
|
# databases still need rebuilding because the formats were different.
|
|
# The nss_db package was deprecated in F16 and onwards:
|
|
# https://lists.fedoraproject.org/pipermail/devel/2011-July/153665.html
|
|
# The different database format does cause some issues for users:
|
|
# https://lists.fedoraproject.org/pipermail/devel/2011-December/160497.html
|
|
%package -n nss_db
|
|
Summary: Name Service Switch (NSS) module using hash-indexed files
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description -n nss_db
|
|
The nss_db Name Service Switch module uses hash-indexed files in /var/db
|
|
to speed up user, group, service, host name, and other NSS-based lookups.
|
|
|
|
%package -n nss_hesiod
|
|
Summary: Name Service Switch (NSS) module using Hesiod
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description -n nss_hesiod
|
|
The nss_hesiod Name Service Switch module uses the Domain Name System
|
|
(DNS) as a source for user, group, and service information, following
|
|
the Hesiod convention of Project Athena.
|
|
|
|
%package nss-devel
|
|
Summary: Development files for directly linking NSS service modules
|
|
Requires: %{name} = %{version}-%{release}
|
|
Requires: nss_db = %{version}-%{release}
|
|
Requires: nss_hesiod = %{version}-%{release}
|
|
|
|
%description nss-devel
|
|
The glibc-nss-devel package contains the object files necessary to
|
|
compile applications and libraries which directly link against NSS
|
|
modules supplied by glibc.
|
|
|
|
This is a rare and special use case; regular development has to use
|
|
the glibc-devel package instead.
|
|
|
|
##############################################################################
|
|
# glibc "utils" sub-package
|
|
##############################################################################
|
|
%package utils
|
|
Summary: Development utilities from GNU C library
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
%description utils
|
|
The glibc-utils package contains memusage, a memory usage profiler,
|
|
mtrace, a memory leak tracer and xtrace, a function call tracer
|
|
which can be helpful during program debugging.
|
|
|
|
If unsure if you need this, don't install this package.
|
|
|
|
%if %{with benchtests}
|
|
%package benchtests
|
|
Summary: Benchmarking binaries and scripts for %{name}
|
|
%description benchtests
|
|
This package provides built benchmark binaries and scripts to run
|
|
microbenchmark tests on the system.
|
|
%endif
|
|
|
|
##############################################################################
|
|
# compat-libpthread-nonshared
|
|
# See: https://sourceware.org/bugzilla/show_bug.cgi?id=23500
|
|
##############################################################################
|
|
%package -n compat-libpthread-nonshared
|
|
Summary: Compatibility support for linking against libpthread_nonshared.a.
|
|
|
|
%description -n compat-libpthread-nonshared
|
|
This package provides compatibility support for applications that expect
|
|
libpthread_nonshared.a to exist. The support provided is in the form of
|
|
an empty libpthread_nonshared.a that allows dynamic links to succeed.
|
|
Such applications should be adjusted to avoid linking against
|
|
libpthread_nonshared.a which is no longer used. The static library
|
|
libpthread_nonshared.a is an internal implementation detail of the C
|
|
runtime and should not be expected to exist.
|
|
|
|
##############################################################################
|
|
# Prepare for the build.
|
|
##############################################################################
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
##############################################################################
|
|
# %%prep - Additional prep required...
|
|
##############################################################################
|
|
# Make benchmark scripts executable
|
|
chmod +x benchtests/scripts/*.py scripts/pylint
|
|
|
|
# Remove all files generated from patching.
|
|
find . -type f -size 0 -o -name "*.orig" -exec rm -f {} \;
|
|
|
|
# Ensure timestamps on configure files are current to prevent
|
|
# regenerating them.
|
|
touch `find . -name configure`
|
|
|
|
# Ensure *-kw.h files are current to prevent regenerating them.
|
|
touch locale/programs/*-kw.h
|
|
|
|
##############################################################################
|
|
# Build glibc...
|
|
##############################################################################
|
|
%build
|
|
# Log osystem information
|
|
uname -a
|
|
LD_SHOW_AUXV=1 /bin/true
|
|
cat /proc/cpuinfo
|
|
cat /proc/sysinfo 2>/dev/null || true
|
|
cat /proc/meminfo
|
|
df
|
|
|
|
# We build using the native system compilers.
|
|
GCC=gcc
|
|
GXX=g++
|
|
|
|
# Part of rpm_inherit_flags. Is overridden below.
|
|
rpm_append_flag ()
|
|
{
|
|
BuildFlags="$BuildFlags $*"
|
|
}
|
|
|
|
# Propagates the listed flags to rpm_append_flag if supplied by
|
|
# system-rpm-config.
|
|
BuildFlags="-O2 -g"
|
|
rpm_inherit_flags ()
|
|
{
|
|
local reference=" $* "
|
|
local flag
|
|
for flag in $RPM_OPT_FLAGS $RPM_LD_FLAGS ; do
|
|
if echo "$reference" | grep -q -F " $flag " ; then
|
|
rpm_append_flag "$flag"
|
|
fi
|
|
done
|
|
}
|
|
|
|
# Propgate select compiler flags from system-rpm-config. These flags
|
|
# are target-dependent, so we use only those which are specified in
|
|
# system-rpm-config. We keep the -m32/-m32/-m64 flags to support
|
|
# multilib builds.
|
|
#
|
|
# Note: For building alternative run-times, care is required to avoid
|
|
# overriding the architecture flags which go into CC/CXX. The flags
|
|
# below are passed in CFLAGS.
|
|
|
|
rpm_inherit_flags \
|
|
"-Wp,-D_GLIBCXX_ASSERTIONS" \
|
|
"-fasynchronous-unwind-tables" \
|
|
"-fstack-clash-protection" \
|
|
"-funwind-tables" \
|
|
"-m31" \
|
|
"-m32" \
|
|
"-m64" \
|
|
"-march=armv8-a+lse" \
|
|
"-march=armv8.1-a" \
|
|
"-march=armv9-a" \
|
|
"-march=haswell" \
|
|
"-march=i686" \
|
|
"-march=x86-64" \
|
|
"-march=x86-64-v2" \
|
|
"-march=x86-64-v3" \
|
|
"-march=x86-64-v4" \
|
|
"-march=z13" \
|
|
"-march=z14" \
|
|
"-march=z15" \
|
|
"-march=zEC12" \
|
|
"-mbranch-protection=standard" \
|
|
"-mcpu=power10" \
|
|
"-mcpu=power8" \
|
|
"-mcpu=power9" \
|
|
"-mfpmath=sse" \
|
|
"-msse2" \
|
|
"-mstackrealign" \
|
|
"-mtune=generic" \
|
|
"-mtune=power10" \
|
|
"-mtune=power8" \
|
|
"-mtune=power9" \
|
|
"-mtune=z13" \
|
|
"-mtune=z14" \
|
|
"-mtune=z15" \
|
|
"-mtune=zEC12" \
|
|
"-specs=/usr/lib/rpm/anolis/anolis-annobin-cc1" \
|
|
|
|
%if 0%{?_annotated_build} > 0
|
|
# libc_nonshared.a cannot be built with the default hardening flags
|
|
# because the glibc build system is incompatible with
|
|
# -D_FORTIFY_SOURCE. The object files need to be marked as to be
|
|
# skipped in annobin annotations. (The -specs= variant of activating
|
|
# annobin does not work here because of flag ordering issues.)
|
|
# See <https://bugzilla.redhat.com/show_bug.cgi?id=1668822>.
|
|
BuildFlagsNonshared="-fplugin=annobin -fplugin-arg-annobin-disable -Wa,--generate-missing-build-notes=yes"
|
|
%endif
|
|
|
|
# Special flag to enable annobin annotations for statically linked
|
|
# assembler code. Needs to be passed to make; not preserved by
|
|
# configure.
|
|
%define glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes"
|
|
%define glibc_make_flags %{glibc_make_flags_as}
|
|
|
|
##############################################################################
|
|
# %%build - Generic options.
|
|
##############################################################################
|
|
EnableKernel="--enable-kernel=%{enablekernel}"
|
|
# Save the used compiler and options into the file "Gcc" for use later
|
|
# by %%install.
|
|
echo "$GCC" > Gcc
|
|
|
|
##############################################################################
|
|
# build()
|
|
# Build glibc in `build-%{target}$1', passing the rest of the arguments
|
|
# as CFLAGS to the build (not the same as configure CFLAGS). Several
|
|
# global values are used to determine build flags, kernel version,
|
|
# system tap support, etc.
|
|
##############################################################################
|
|
build()
|
|
{
|
|
local builddir=build-%{target}${1:+-$1}
|
|
${1+shift}
|
|
rm -rf $builddir
|
|
mkdir $builddir
|
|
pushd $builddir
|
|
../configure CC="$GCC" CXX="$GXX" CFLAGS="$BuildFlags $*" \
|
|
--prefix=%{_prefix} \
|
|
--with-headers=%{_prefix}/include $EnableKernel \
|
|
--with-nonshared-cflags="$BuildFlagsNonshared" \
|
|
--enable-bind-now \
|
|
--build=%{target} \
|
|
--enable-stack-protector=strong \
|
|
--enable-tunables \
|
|
--enable-systemtap \
|
|
${core_with_options} \
|
|
%ifarch x86_64
|
|
--enable-cet \
|
|
%endif
|
|
%if %{without werror}
|
|
--disable-werror \
|
|
%endif
|
|
--disable-profile \
|
|
%if %{with bootstrap}
|
|
--without-selinux \
|
|
%endif
|
|
%ifarch aarch64
|
|
--enable-memory-tagging \
|
|
%endif
|
|
--disable-crypt \
|
|
--disable-build-nscd \
|
|
--disable-nscd ||
|
|
{ cat config.log; false; }
|
|
|
|
%make_build -r %{glibc_make_flags}
|
|
popd
|
|
}
|
|
|
|
# Default set of compiler options.
|
|
build
|
|
|
|
##############################################################################
|
|
# Install glibc...
|
|
##############################################################################
|
|
%install
|
|
|
|
# The built glibc is installed into a subdirectory of $RPM_BUILD_ROOT.
|
|
# For a system glibc that subdirectory is "/" (the root of the filesystem).
|
|
# This is called a sysroot (system root) and can be changed if we have a
|
|
# distribution that supports multiple installed glibc versions.
|
|
%define glibc_sysroot $RPM_BUILD_ROOT
|
|
|
|
# Remove existing file lists.
|
|
find . -type f -name '*.filelist' -exec rm -rf {} \;
|
|
|
|
# Reload compiler and build options that were used during %%build.
|
|
GCC=`cat Gcc`
|
|
|
|
%ifarch riscv64
|
|
# RISC-V ABI wants to install everything in /lib64/lp64d or /usr/lib64/lp64d.
|
|
# Make these be symlinks to /lib64 or /usr/lib64 respectively. See:
|
|
# https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/DRHT5YTPK4WWVGL3GIN5BF2IKX2ODHZ3/
|
|
for d in %{glibc_sysroot}%{_libdir} %{glibc_sysroot}/%{_lib}; do
|
|
mkdir -p $d
|
|
(cd $d && ln -sf . lp64d)
|
|
done
|
|
%endif
|
|
|
|
# Build and install:
|
|
pushd build-%{target}
|
|
%make_build install_root=%{glibc_sysroot} install
|
|
%make_build install_root=%{glibc_sysroot} \
|
|
install-locales -C ../localedata objdir=`pwd`
|
|
popd
|
|
# Locale creation may produce different groups of hardlinks in an
|
|
# unpredictable manner. Re-grouping makes those differences go away.
|
|
hardlink %{glibc_sysroot}/usr/lib/locale
|
|
|
|
# install_different:
|
|
# Install all core libraries into DESTDIR/SUBDIR. Either the file is
|
|
# installed as a copy or a symlink to the default install (if it is the
|
|
# same). The path SUBDIR_UP is the prefix used to go from
|
|
# DESTDIR/SUBDIR to the default installed libraries e.g.
|
|
# ln -s SUBDIR_UP/foo.so DESTDIR/SUBDIR/foo.so.
|
|
# When you call this function it is expected that you are in the root
|
|
# of the build directory, and that the default build directory is:
|
|
# "../build-%{target}" (relatively).
|
|
# The primary use of this function is to install alternate runtimes
|
|
# into the build directory and avoid duplicating this code for each
|
|
# runtime.
|
|
install_different()
|
|
{
|
|
local lib libbase libbaseso dlib
|
|
local destdir="$1"
|
|
local subdir="$2"
|
|
local subdir_up="$3"
|
|
local libdestdir="$destdir/$subdir"
|
|
# All three arguments must be non-zero paths.
|
|
if ! [ "$destdir" \
|
|
-a "$subdir" \
|
|
-a "$subdir_up" ]; then
|
|
echo "One of the arguments to install_different was emtpy."
|
|
exit 1
|
|
fi
|
|
# Create the destination directory and the multilib directory.
|
|
mkdir -p "$destdir"
|
|
mkdir -p "$libdestdir"
|
|
# Walk all of the libraries we installed...
|
|
for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
|
|
do
|
|
libbase=${lib#*/}
|
|
# Take care that `libbaseso' has a * that needs expanding so
|
|
# take care with quoting.
|
|
libbaseso=$(basename %{glibc_sysroot}/%{_lib}/${libbase}-*.so)
|
|
# Only install if different from default build library.
|
|
if cmp -s ${lib}.so ../build-%{target}/${lib}.so; then
|
|
ln -sf "$subdir_up"/$libbaseso $libdestdir/$libbaseso
|
|
else
|
|
cp -a ${lib}.so $libdestdir/$libbaseso
|
|
fi
|
|
dlib=$libdestdir/$(basename %{glibc_sysroot}/%{_lib}/${libbase}.so.*)
|
|
ln -sf $libbaseso $dlib
|
|
done
|
|
}
|
|
|
|
##############################################################################
|
|
# Remove the files we don't want to distribute
|
|
##############################################################################
|
|
|
|
# Remove the libNoVersion files.
|
|
# XXX: This looks like a bug in glibc that accidentally installed these
|
|
# wrong files. We probably don't need this today.
|
|
rm -f %{glibc_sysroot}/%{_libdir}/libNoVersion*
|
|
rm -f %{glibc_sysroot}/%{_lib}/libNoVersion*
|
|
|
|
# Remove the old nss modules.
|
|
rm -f %{glibc_sysroot}/%{_lib}/libnss1-*
|
|
rm -f %{glibc_sysroot}/%{_lib}/libnss-*.so.1
|
|
|
|
# This statically linked binary is no longer necessary in a world where
|
|
# the default Fedora install uses an initramfs, and further we have rpm-ostree
|
|
# which captures the whole userspace FS tree.
|
|
# Further, see https://github.com/projectatomic/rpm-ostree/pull/1173#issuecomment-355014583
|
|
rm -f %{glibc_sysroot}/{usr/,}sbin/sln
|
|
|
|
######################################################################
|
|
# Run ldconfig to create all the symbolic links we need
|
|
######################################################################
|
|
|
|
# Note: This has to happen before creating /etc/ld.so.conf.
|
|
|
|
mkdir -p %{glibc_sysroot}/var/cache/ldconfig
|
|
truncate -s 0 %{glibc_sysroot}/var/cache/ldconfig/aux-cache
|
|
|
|
# ldconfig is statically linked, so we can use the new version.
|
|
%{glibc_sysroot}/sbin/ldconfig -N -r %{glibc_sysroot}
|
|
|
|
##############################################################################
|
|
# Install info files
|
|
##############################################################################
|
|
|
|
%if %{with docs}
|
|
# Move the info files if glibc installed them into the wrong location.
|
|
if [ -d %{glibc_sysroot}%{_prefix}/info -a "%{_infodir}" != "%{_prefix}/info" ]; then
|
|
mkdir -p %{glibc_sysroot}%{_infodir}
|
|
mv -f %{glibc_sysroot}%{_prefix}/info/* %{glibc_sysroot}%{_infodir}
|
|
rm -rf %{glibc_sysroot}%{_prefix}/info
|
|
fi
|
|
|
|
# Compress all of the info files.
|
|
gzip -9nvf %{glibc_sysroot}%{_infodir}/libc*
|
|
|
|
# Copy the debugger interface documentation over to the right location
|
|
mkdir -p %{glibc_sysroot}%{_docdir}/glibc
|
|
cp elf/rtld-debugger-interface.txt %{glibc_sysroot}%{_docdir}/glibc
|
|
%else
|
|
rm -f %{glibc_sysroot}%{_infodir}/dir
|
|
rm -f %{glibc_sysroot}%{_infodir}/libc.info*
|
|
%endif
|
|
|
|
##############################################################################
|
|
# Create locale sub-package file lists
|
|
##############################################################################
|
|
|
|
olddir=`pwd`
|
|
pushd %{glibc_sysroot}%{_prefix}/lib/locale
|
|
rm -f locale-archive
|
|
$olddir/build-%{target}/elf/ld.so \
|
|
--library-path $olddir/build-%{target}/ \
|
|
$olddir/build-%{target}/locale/localedef \
|
|
--alias-file=$olddir/intl/locale.alias \
|
|
--prefix %{glibc_sysroot} --add-to-archive \
|
|
%locale_rx
|
|
# Historically, glibc-all-langpacks deleted the file on updates (sic),
|
|
# so we need to restore it in the posttrans scriptlet (like the old
|
|
# glibc-all-langpacks versions)
|
|
ln locale-archive locale-archive.real
|
|
|
|
# Create the file lists for the language specific sub-packages:
|
|
for i in %locale_rx
|
|
do
|
|
lang=${i%%_*}
|
|
if [ ! -e langpack-${lang}.filelist ]; then
|
|
echo "%dir %{_prefix}/lib/locale" >> langpack-${lang}.filelist
|
|
fi
|
|
echo "%dir %{_prefix}/lib/locale/$i" >> langpack-${lang}.filelist
|
|
echo "%{_prefix}/lib/locale/$i/*" >> langpack-${lang}.filelist
|
|
done
|
|
popd
|
|
pushd %{glibc_sysroot}%{_prefix}/share/locale
|
|
for i in */LC_MESSAGES/libc.mo
|
|
do
|
|
locale=${i%%%%/*}
|
|
lang=${locale%%%%_*}
|
|
echo "%lang($lang) %{_prefix}/share/locale/${i}" \
|
|
>> %{glibc_sysroot}%{_prefix}/lib/locale/langpack-${lang}.filelist
|
|
done
|
|
popd
|
|
mv %{glibc_sysroot}%{_prefix}/lib/locale/*.filelist .
|
|
|
|
##############################################################################
|
|
# Install configuration files for services
|
|
##############################################################################
|
|
|
|
# Include ld.so.conf
|
|
echo 'include ld.so.conf.d/*.conf' > %{glibc_sysroot}/etc/ld.so.conf
|
|
truncate -s 0 %{glibc_sysroot}/etc/ld.so.cache
|
|
chmod 644 %{glibc_sysroot}/etc/ld.so.conf
|
|
mkdir -p %{glibc_sysroot}/etc/ld.so.conf.d
|
|
truncate -s 0 %{glibc_sysroot}/etc/gai.conf
|
|
|
|
# Include %{_libdir}/gconv/gconv-modules.cache
|
|
truncate -s 0 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache
|
|
chmod 644 %{glibc_sysroot}%{_libdir}/gconv/gconv-modules.cache
|
|
|
|
# Remove any zoneinfo files; they are maintained by tzdata.
|
|
rm -rf %{glibc_sysroot}%{_prefix}/share/zoneinfo
|
|
|
|
# Make sure %config files have the same timestamp across multilib packages.
|
|
#
|
|
# XXX: Ideally ld.so.conf should have the timestamp of the spec file, but there
|
|
# doesn't seem to be any macro to give us that. So we do the next best thing,
|
|
# which is to at least keep the timestamp consistent. The choice of using
|
|
# SOURCE0 is arbitrary.
|
|
touch -r %{SOURCE0} %{glibc_sysroot}/etc/ld.so.conf
|
|
touch -r inet/etc.rpc %{glibc_sysroot}/etc/rpc
|
|
|
|
%if %{with benchtests}
|
|
# Build benchmark binaries. Ignore the output of the benchmark runs.
|
|
pushd build-%{target}
|
|
make BENCH_DURATION=1 bench-build
|
|
popd
|
|
|
|
# Copy over benchmark binaries.
|
|
mkdir -p %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests
|
|
cp $(find build-%{target}/benchtests -type f -executable) %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
# ... and the makefile.
|
|
for b in %{SOURCE1} %{SOURCE2}; do
|
|
cp $b %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
done
|
|
# .. and finally, the comparison scripts.
|
|
cp benchtests/scripts/benchout.schema.json %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
cp benchtests/scripts/compare_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
cp benchtests/scripts/import_bench.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
cp benchtests/scripts/validate_benchout.py %{glibc_sysroot}%{_prefix}/libexec/glibc-benchtests/
|
|
%endif
|
|
|
|
# The #line directives gperf generates do not give the proper
|
|
# file name relative to the build directory.
|
|
pushd locale
|
|
ln -s programs/*.gperf .
|
|
popd
|
|
pushd iconv
|
|
ln -s ../locale/programs/charmap-kw.gperf .
|
|
popd
|
|
|
|
%if %{with docs}
|
|
# Remove the `dir' info-heirarchy file which will be maintained
|
|
# by the system as it adds info files to the install.
|
|
rm -f %{glibc_sysroot}%{_infodir}/dir
|
|
%endif
|
|
|
|
# Move libpcprofile.so and libmemusage.so into the proper library directory.
|
|
# They can be moved without any real consequences because users would not use
|
|
# them directly.
|
|
mkdir -p %{glibc_sysroot}%{_libdir}
|
|
mv -f %{glibc_sysroot}/%{_lib}/lib{pcprofile,memusage}.so \
|
|
%{glibc_sysroot}%{_libdir}
|
|
|
|
# Disallow linking against libc_malloc_debug.
|
|
rm %{glibc_sysroot}%{_libdir}/libc_malloc_debug.so
|
|
|
|
# Strip all of the installed object files.
|
|
strip -g %{glibc_sysroot}%{_libdir}/*.o
|
|
|
|
# The xtrace and memusage scripts have hard-coded paths that need to be
|
|
# translated to a correct set of paths using the $LIB token which is
|
|
# dynamically translated by ld.so as the default lib directory.
|
|
for i in %{glibc_sysroot}%{_prefix}/bin/{xtrace,memusage}; do
|
|
%if %{with bootstrap}
|
|
test -w $i || continue
|
|
%endif
|
|
sed -e 's~=/%{_lib}/libpcprofile.so~=%{_libdir}/libpcprofile.so~' \
|
|
-e 's~=/%{_lib}/libmemusage.so~=%{_libdir}/libmemusage.so~' \
|
|
-e 's~='\''/\\\$LIB/libpcprofile.so~='\''%{_prefix}/\\$LIB/libpcprofile.so~' \
|
|
-e 's~='\''/\\\$LIB/libmemusage.so~='\''%{_prefix}/\\$LIB/libmemusage.so~' \
|
|
-i $i
|
|
done
|
|
|
|
##############################################################################
|
|
# Build an empty libpthread_nonshared.a for compatiliby with applications
|
|
# that have old linker scripts that reference this file. We ship this only
|
|
# in compat-libpthread-nonshared sub-package.
|
|
##############################################################################
|
|
ar cr %{glibc_sysroot}%{_prefix}/%{_lib}/libpthread_nonshared.a
|
|
|
|
##############################################################################
|
|
# Beyond this point in the install process we no longer modify the set of
|
|
# installed files.
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
# Build the file lists used for describing the package and subpackages.
|
|
##############################################################################
|
|
# There are several main file lists (and many more for
|
|
# the langpack sub-packages (langpack-${lang}.filelist)):
|
|
# * master.filelist
|
|
# - Master file list from which all other lists are built.
|
|
# * glibc.filelist
|
|
# - Files for the glibc packages.
|
|
# * common.filelist
|
|
# - Flies for the common subpackage.
|
|
# * utils.filelist
|
|
# - Files for the utils subpackage.
|
|
# * devel.filelist
|
|
# - Files for the devel subpackage.
|
|
# * doc.filelist
|
|
# - Files for the documentation subpackage.
|
|
# * static.filelist
|
|
# - Files for the static subpackage.
|
|
# * libnsl.filelist
|
|
# - Files for the libnsl subpackage
|
|
# * nss_db.filelist
|
|
# * nss_hesiod.filelist
|
|
# - File lists for nss_* NSS module subpackages.
|
|
# * nss-devel.filelist
|
|
# - File list with the .so symbolic links for NSS packages.
|
|
# * compat-libpthread-nonshared.filelist.
|
|
# - File list for compat-libpthread-nonshared subpackage.
|
|
|
|
# Create the main file lists. This way we can append to any one of them later
|
|
# wihtout having to create it. Note these are removed at the start of the
|
|
# install phase.
|
|
touch master.filelist
|
|
touch glibc.filelist
|
|
touch common.filelist
|
|
touch utils.filelist
|
|
touch gconv.filelist
|
|
touch devel.filelist
|
|
touch doc.filelist
|
|
touch static.filelist
|
|
touch libnsl.filelist
|
|
touch nss_db.filelist
|
|
touch nss_hesiod.filelist
|
|
touch nss-devel.filelist
|
|
touch compat-libpthread-nonshared.filelist
|
|
|
|
###############################################################################
|
|
# Master file list, excluding a few things.
|
|
###############################################################################
|
|
{
|
|
# List all files or links that we have created during install.
|
|
# Files with 'etc' are configuration files, likewise 'gconv-modules'
|
|
# and 'gconv-modules.cache' are caches, and we exclude them.
|
|
find %{glibc_sysroot} \( -type f -o -type l \) \
|
|
\( \
|
|
-name etc -printf "%%%%config " -o \
|
|
-name gconv-modules.cache \
|
|
-printf "%%%%verify(not md5 size mtime) " -o \
|
|
-name gconv-modules* \
|
|
-printf "%%%%verify(not md5 size mtime) %%%%config(noreplace) " \
|
|
, \
|
|
! -path "*/lib/debug/*" -printf "/%%P\n" \)
|
|
# List all directories with a %%dir prefix. We omit the info directory and
|
|
# all directories in (and including) /usr/share/locale.
|
|
find %{glibc_sysroot} -type d \
|
|
\( -path '*%{_prefix}/share/locale' -prune -o \
|
|
\( -path '*%{_prefix}/share/*' \
|
|
%if %{with docs}
|
|
! -path '*%{_infodir}' -o \
|
|
%endif
|
|
-path "*%{_prefix}/include/*" \
|
|
\) -printf "%%%%dir /%%P\n" \)
|
|
} | {
|
|
# Also remove the *.mo entries. We will add them to the
|
|
# language specific sub-packages.
|
|
# libnss_ files go into subpackages related to NSS modules.
|
|
# and .*/share/i18n/charmaps/.*), they go into the sub-package
|
|
# "locale-source":
|
|
sed -e '\,.*/share/locale/\([^/_]\+\).*/LC_MESSAGES/.*\.mo,d' \
|
|
-e '\,.*/share/i18n/locales/.*,d' \
|
|
-e '\,.*/share/i18n/charmaps/.*,d' \
|
|
-e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
|
|
-e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \
|
|
-e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
|
|
} | sort > master.filelist
|
|
|
|
# The master file list is now used by each subpackage to list their own
|
|
# files. We go through each package and subpackage now and create their lists.
|
|
# Each subpackage picks the files from the master list that they need.
|
|
# The order of the subpackage list generation does not matter.
|
|
|
|
# Make the master file list read-only after this point to avoid accidental
|
|
# modification.
|
|
chmod 0444 master.filelist
|
|
|
|
###############################################################################
|
|
# glibc
|
|
###############################################################################
|
|
|
|
# Add all files with the following exceptions:
|
|
# - The info files '%{_infodir}/dir'
|
|
# - The partial (lib*_p.a) static libraries, include files.
|
|
# - The static files, objects, and unversioned DSOs.
|
|
# - The bin, locale, some sbin, and share.
|
|
# - We want iconvconfig in the main package and we do this by using
|
|
# a double negation of -v and [^i] so it removes all files in
|
|
# sbin *but* iconvconfig.
|
|
# - All the libnss files (we add back the ones we want later).
|
|
# - All bench test binaries.
|
|
# - The aux-cache, since it's handled specially in the files section.
|
|
# - Extra gconv modules. We add the required modules later.
|
|
cat master.filelist \
|
|
| grep -v \
|
|
-e '%{_infodir}' \
|
|
-e '%{_libdir}/lib.*_p.a' \
|
|
-e '%{_prefix}/include' \
|
|
-e '%{_libdir}/lib.*\.a' \
|
|
-e '%{_libdir}/.*\.o' \
|
|
-e '%{_libdir}/lib.*\.so' \
|
|
-e '%{_libdir}/gconv/.*\.so$' \
|
|
-e '%{_libdir}/gconv/gconv-modules.d/gconv-modules-extra\.conf$' \
|
|
-e '%{_prefix}/bin' \
|
|
-e '%{_prefix}/lib/locale' \
|
|
-e '%{_prefix}/sbin/[^i]' \
|
|
-e '%{_prefix}/share' \
|
|
-e '/var/db/Makefile' \
|
|
-e '/libnss_.*\.so[0-9.]*$' \
|
|
-e '/libnsl' \
|
|
-e 'glibc-benchtests' \
|
|
-e 'aux-cache' \
|
|
> glibc.filelist
|
|
|
|
# Add specific files:
|
|
# - The nss_files, nss_compat, and nss_db files.
|
|
# - The libmemusage.so and libpcprofile.so used by utils.
|
|
for module in compat files dns; do
|
|
cat master.filelist \
|
|
| grep -E \
|
|
-e "/libnss_$module(\.so\.[0-9.]+|-[0-9.]+\.so)$" \
|
|
>> glibc.filelist
|
|
done
|
|
grep -e "libmemusage.so" -e "libpcprofile.so" master.filelist >> glibc.filelist
|
|
|
|
###############################################################################
|
|
# glibc-gconv-extra
|
|
###############################################################################
|
|
|
|
grep -e "gconv-modules-extra.conf" master.filelist > gconv.filelist
|
|
|
|
# Put the essential gconv modules into the main package.
|
|
GconvBaseModules="ANSI_X3.110 ISO8859-15 ISO8859-1 CP1252"
|
|
GconvBaseModules="$GconvBaseModules UNICODE UTF-16 UTF-32 UTF-7"
|
|
GconvAllModules=$(cat master.filelist |
|
|
sed -n 's|%{_libdir}/gconv/\(.*\)\.so|\1|p')
|
|
|
|
# Put the base modules into glibc and the rest into glibc-gconv-extra
|
|
for conv in $GconvAllModules; do
|
|
if echo $GconvBaseModules | grep -q $conv; then
|
|
grep -E -e "%{_libdir}/gconv/$conv.so$" \
|
|
master.filelist >> glibc.filelist
|
|
else
|
|
grep -E -e "%{_libdir}/gconv/$conv.so$" \
|
|
master.filelist >> gconv.filelist
|
|
fi
|
|
done
|
|
|
|
###############################################################################
|
|
# glibc-devel
|
|
###############################################################################
|
|
|
|
# Static libraries that land in glibc-devel, not glibc-static.
|
|
devel_static_library_pattern='/lib\(\(c\|nldbl\|mvec\)_nonshared\|g\|ieee\|mcheck\|pthread\|dl\|rt\|util\|anl\)\.a$'
|
|
# Static libraries neither in glibc-devel nor in glibc-static.
|
|
other_static_library_pattern='/libpthread_nonshared\.a'
|
|
|
|
grep '%{_libdir}/lib.*\.a' master.filelist \
|
|
| grep "$devel_static_library_pattern" \
|
|
| grep -v "$other_static_library_pattern" \
|
|
> devel.filelist
|
|
|
|
# Put all of the object files and *.so (not the versioned ones) into the
|
|
# devel package.
|
|
grep '%{_libdir}/.*\.o' < master.filelist >> devel.filelist
|
|
grep '%{_libdir}/lib.*\.so' < master.filelist >> devel.filelist
|
|
# The exceptions are:
|
|
# - libmemusage.so and libpcprofile.so in glibc used by utils.
|
|
# - libnss_*.so which are in nss-devel.
|
|
sed -i -e '\,libmemusage.so,d' \
|
|
-e '\,libpcprofile.so,d' \
|
|
-e '\,/libnss_[a-z]*\.so$,d' \
|
|
devel.filelist
|
|
|
|
grep '%{_prefix}/include' < master.filelist >> devel.filelist
|
|
|
|
###############################################################################
|
|
# glibc-doc
|
|
###############################################################################
|
|
|
|
%if %{with docs}
|
|
# Put the info files into the doc file list, but exclude the generated dir.
|
|
grep '%{_infodir}' master.filelist | grep -v '%{_infodir}/dir' > doc.filelist
|
|
grep '%{_docdir}' master.filelist >> doc.filelist
|
|
sed -i -e 's/\.gz/\.*/' doc.filelist
|
|
%endif
|
|
|
|
###############################################################################
|
|
# glibc-static
|
|
###############################################################################
|
|
|
|
# Put the rest of the static files into the static package.
|
|
grep '%{_libdir}/lib.*\.a' < master.filelist \
|
|
| grep -v "$devel_static_library_pattern" \
|
|
| grep -v "$other_static_library_pattern" \
|
|
> static.filelist
|
|
|
|
###############################################################################
|
|
# glibc-common
|
|
###############################################################################
|
|
|
|
# All of the bin and certain sbin files go into the common package except
|
|
# iconvconfig which needs to go in glibc. The iconvconfig binary is kept in
|
|
# the main glibc package because we use it in the post-install scriptlet to
|
|
# rebuild the gconv-modules.cache. The makedb binary is in nss_db.
|
|
grep '%{_prefix}/bin' master.filelist \
|
|
| grep -v '%{_prefix}/bin/makedb' \
|
|
>> common.filelist
|
|
grep '%{_prefix}/sbin' master.filelist \
|
|
| grep -v '%{_prefix}/sbin/iconvconfig' >> common.filelist
|
|
# All of the files under share go into the common package since they should be
|
|
# multilib-independent.
|
|
# Exceptions:
|
|
# - The actual share directory, not owned by us.
|
|
# - The info files which go into doc, and the info directory.
|
|
# - All documentation files, which go into doc.
|
|
grep '%{_prefix}/share' master.filelist \
|
|
| grep -v \
|
|
-e '%{_prefix}/share/info/libc.info.*' \
|
|
-e '%%dir %{prefix}/share/info' \
|
|
-e '%%dir %{prefix}/share' \
|
|
-e '%{_docdir}' \
|
|
>> common.filelist
|
|
|
|
###############################################################################
|
|
# glibc-utils
|
|
###############################################################################
|
|
|
|
# Add the utils scripts and programs to the utils subpackage.
|
|
cat > utils.filelist <<EOF
|
|
%if %{without bootstrap}
|
|
%{_prefix}/bin/memusage
|
|
%{_prefix}/bin/memusagestat
|
|
%endif
|
|
%{_prefix}/bin/mtrace
|
|
%{_prefix}/bin/pcprofiledump
|
|
%{_prefix}/bin/xtrace
|
|
EOF
|
|
|
|
###############################################################################
|
|
# nss_db, nss_hesiod
|
|
###############################################################################
|
|
|
|
# Move the NSS-related files to the NSS subpackages. Be careful not
|
|
# to pick up .debug files, and the -devel symbolic links.
|
|
for module in db hesiod; do
|
|
grep -E "/libnss_$module\\.so\\.[0-9.]+\$" \
|
|
master.filelist > nss_$module.filelist
|
|
done
|
|
grep -E "%{_prefix}/bin/makedb$" master.filelist >> nss_db.filelist
|
|
|
|
###############################################################################
|
|
# nss-devel
|
|
###############################################################################
|
|
|
|
# Symlinks go into the nss-devel package (instead of the main devel
|
|
# package).
|
|
grep '/libnss_[a-z]*\.so$' master.filelist > nss-devel.filelist
|
|
|
|
###############################################################################
|
|
# libnsl
|
|
###############################################################################
|
|
|
|
# Prepare the libnsl-related file lists.
|
|
grep -E '/libnsl\.so\.[0-9]+$' master.filelist > libnsl.filelist
|
|
test $(wc -l < libnsl.filelist) -eq 1
|
|
|
|
%if %{with benchtests}
|
|
###############################################################################
|
|
# glibc-benchtests
|
|
###############################################################################
|
|
|
|
# List of benchmarks.
|
|
find build-%{target}/benchtests -type f -executable | while read b; do
|
|
echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)"
|
|
done >> benchtests.filelist
|
|
# ... and the makefile.
|
|
for b in %{SOURCE1} %{SOURCE2}; do
|
|
echo "%{_prefix}/libexec/glibc-benchtests/$(basename $b)" >> benchtests.filelist
|
|
done
|
|
# ... and finally, the comparison scripts.
|
|
echo "%{_prefix}/libexec/glibc-benchtests/benchout.schema.json" >> benchtests.filelist
|
|
echo "%{_prefix}/libexec/glibc-benchtests/compare_bench.py*" >> benchtests.filelist
|
|
echo "%{_prefix}/libexec/glibc-benchtests/import_bench.py*" >> benchtests.filelist
|
|
echo "%{_prefix}/libexec/glibc-benchtests/validate_benchout.py*" >> benchtests.filelist
|
|
%endif
|
|
|
|
###############################################################################
|
|
# compat-libpthread-nonshared
|
|
###############################################################################
|
|
echo "%{_libdir}/libpthread_nonshared.a" >> compat-libpthread-nonshared.filelist
|
|
|
|
##############################################################################
|
|
# Run the glibc testsuite
|
|
##############################################################################
|
|
%check
|
|
%if %{with testsuite}
|
|
|
|
# Run the glibc tests. If any tests fail to build we exit %check with
|
|
# an error, otherwise we print the test failure list and the failed
|
|
# test output and continue. Write to standard error to avoid
|
|
# synchronization issues with make and shell tracing output if
|
|
# standard output and standard error are different pipes.
|
|
run_tests () {
|
|
# This hides a test suite build failure, which should be fatal. We
|
|
# check "Summary of test results:" below to verify that all tests
|
|
# were built and run.
|
|
%make_build check |& tee rpmbuild.check.log >&2
|
|
test -n tests.sum
|
|
if ! grep -q '^Summary of test results:$' rpmbuild.check.log ; then
|
|
echo "FAIL: test suite build of target: $(basename "$(pwd)")" >& 2
|
|
exit 1
|
|
fi
|
|
set +x
|
|
grep -v ^PASS: tests.sum > rpmbuild.tests.sum.not-passing || true
|
|
if test -n rpmbuild.tests.sum.not-passing ; then
|
|
echo ===================FAILED TESTS===================== >&2
|
|
echo "Target: $(basename "$(pwd)")" >& 2
|
|
cat rpmbuild.tests.sum.not-passing >&2
|
|
while read failed_code failed_test ; do
|
|
for suffix in out test-result ; do
|
|
if test -e "$failed_test.$suffix"; then
|
|
echo >&2
|
|
echo "=====$failed_code $failed_test.$suffix=====" >&2
|
|
cat -- "$failed_test.$suffix" >&2
|
|
echo >&2
|
|
fi
|
|
done
|
|
done <rpmbuild.tests.sum.not-passing
|
|
fi
|
|
|
|
# Unconditonally dump differences in the system call list.
|
|
echo "* System call consistency checks:" >&2
|
|
cat misc/tst-syscall-list.out >&2
|
|
set -x
|
|
}
|
|
|
|
# Increase timeouts
|
|
export TIMEOUTFACTOR=16
|
|
parent=$$
|
|
echo ====================TESTING=========================
|
|
|
|
# Default libraries.
|
|
pushd build-%{target}
|
|
run_tests
|
|
popd
|
|
|
|
echo ====================TESTING END=====================
|
|
PLTCMD='/^Relocation section .*\(\.rela\?\.plt\|\.rela\.IA_64\.pltoff\)/,/^$/p'
|
|
echo ====================PLT RELOCS LD.SO================
|
|
readelf -Wr %{glibc_sysroot}/%{_lib}/ld-*.so | sed -n -e "$PLTCMD"
|
|
echo ====================PLT RELOCS LIBC.SO==============
|
|
readelf -Wr %{glibc_sysroot}/%{_lib}/libc-*.so | sed -n -e "$PLTCMD"
|
|
echo ====================PLT RELOCS END==================
|
|
|
|
# Obtain a way to run the dynamic loader. Avoid matching the symbolic
|
|
# link and then pick the first loader (although there should be only
|
|
# one). See wrap-find-debuginfo.sh.
|
|
ldso_path="$(find %{glibc_sysroot}/ -regextype posix-extended \
|
|
-regex '.*/ld(-.*|64|)\.so\.[0-9]+$' -type f | LC_ALL=C sort | head -n1)"
|
|
run_ldso="$ldso_path --library-path %{glibc_sysroot}/%{_lib}"
|
|
|
|
# Show the auxiliary vector as seen by the new library
|
|
# (even if we do not perform the valgrind test).
|
|
LD_SHOW_AUXV=1 $run_ldso /bin/true
|
|
|
|
%if 0%{?_enable_debug_packages}
|
|
# Finally, check if valgrind runs with the new glibc.
|
|
# We want to fail building if valgrind is not able to run with this glibc so
|
|
# that we can then coordinate with valgrind to get it fixed before we update
|
|
# glibc.
|
|
%if %{with valgrind}
|
|
$run_ldso /usr/bin/valgrind --error-exitcode=1 \
|
|
$run_ldso /usr/bin/true
|
|
# true --help performs some memory allocations.
|
|
$run_ldso /usr/bin/valgrind --error-exitcode=1 \
|
|
$run_ldso /usr/bin/true --help >/dev/null
|
|
%endif
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
|
%pre -p <lua>
|
|
-- Check that the running kernel is new enough
|
|
required = '%{enablekernel}'
|
|
rel = posix.uname("%r")
|
|
if rpm.vercmp(rel, required) < 0 then
|
|
error("FATAL: kernel too old", 0)
|
|
end
|
|
|
|
%post -p <lua>
|
|
%glibc_post_funcs
|
|
-- (1) Remove multilib libraries from previous installs.
|
|
-- In order to support in-place upgrades, we must immediately remove
|
|
-- obsolete platform directories after installing a new glibc
|
|
-- version. RPM only deletes files removed by updates near the end
|
|
-- of the transaction. If we did not remove the obsolete platform
|
|
-- directories here, they may be preferred by the dynamic linker
|
|
-- during the execution of subsequent RPM scriptlets, likely
|
|
-- resulting in process startup failures.
|
|
|
|
-- Full set of libraries glibc may install.
|
|
install_libs = { "anl", "BrokenLocale", "c", "dl", "m", "mvec",
|
|
"nss_compat", "nss_db", "nss_dns", "nss_files",
|
|
"nss_hesiod", "pthread", "resolv", "rt", "SegFault",
|
|
"thread_db", "util" }
|
|
|
|
-- We are going to remove these libraries. Generally speaking we remove
|
|
-- all core libraries in the multilib directory.
|
|
-- For the versioned install names, the version are [2.0,9.9*], so we
|
|
-- match "libc-2.0.so" and so on up to "libc-9.9*".
|
|
-- For the unversioned install names, we match the library plus ".so."
|
|
-- followed by digests.
|
|
remove_regexps = {}
|
|
for i = 1, #install_libs do
|
|
-- Versioned install name.
|
|
remove_regexps[#remove_regexps + 1] = ("lib" .. install_libs[i]
|
|
.. "%%-[2-9]%%.[0-9]+%%.so$")
|
|
-- Unversioned install name.
|
|
remove_regexps[#remove_regexps + 1] = ("lib" .. install_libs[i]
|
|
.. "%%.so%%.[0-9]+$")
|
|
end
|
|
|
|
-- Two exceptions:
|
|
remove_regexps[#install_libs + 1] = "libthread_db%%-1%%.0%%.so"
|
|
remove_regexps[#install_libs + 2] = "libSegFault%%.so"
|
|
|
|
-- We are going to search these directories.
|
|
local remove_dirs = { "%{_libdir}/i686",
|
|
"%{_libdir}/i686/nosegneg",
|
|
"%{_libdir}/power6",
|
|
"%{_libdir}/power7",
|
|
"%{_libdir}/power8",
|
|
"%{_libdir}/power9",
|
|
}
|
|
|
|
-- Add all the subdirectories of the glibc-hwcaps subdirectory.
|
|
repeat
|
|
local iter = posix.files("%{_libdir}/glibc-hwcaps")
|
|
if iter ~= nil then
|
|
for entry in iter do
|
|
if entry ~= "." and entry ~= ".." then
|
|
local path = "%{_libdir}/glibc-hwcaps/" .. entry
|
|
if posix.access(path .. "/.", "x") then
|
|
remove_dirs[#remove_dirs + 1] = path
|
|
end
|
|
end
|
|
end
|
|
end
|
|
until true
|
|
|
|
-- Walk all the directories with files we need to remove...
|
|
for _, rdir in ipairs (remove_dirs) do
|
|
if posix.access (rdir) then
|
|
-- If the directory exists we look at all the files...
|
|
local remove_files = posix.files (rdir)
|
|
for rfile in remove_files do
|
|
for _, rregexp in ipairs (remove_regexps) do
|
|
-- Does it match the regexp?
|
|
local dso = string.match (rfile, rregexp)
|
|
if (dso ~= nil) then
|
|
-- Removing file...
|
|
os.remove (rdir .. '/' .. rfile)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
-- (2) Update /etc/ld.so.conf
|
|
-- Next we update /etc/ld.so.conf to ensure that it starts with
|
|
-- a literal "include ld.so.conf.d/*.conf".
|
|
|
|
local ldsoconf = "/etc/ld.so.conf"
|
|
local ldsoconf_tmp = "/etc/glibc_post_upgrade.ld.so.conf"
|
|
|
|
if posix.access (ldsoconf) then
|
|
|
|
-- We must have a "include ld.so.conf.d/*.conf" line.
|
|
local have_include = false
|
|
for line in io.lines (ldsoconf) do
|
|
-- This must match, and we don't ignore whitespace.
|
|
if string.match (line, "^include ld.so.conf.d/%%*%%.conf$") ~= nil then
|
|
have_include = true
|
|
end
|
|
end
|
|
|
|
if not have_include then
|
|
-- Insert "include ld.so.conf.d/*.conf" line at the start of the
|
|
-- file. We only support one of these post upgrades running at
|
|
-- a time (temporary file name is fixed).
|
|
local tmp_fd = io.open (ldsoconf_tmp, "w")
|
|
if tmp_fd ~= nil then
|
|
tmp_fd:write ("include ld.so.conf.d/*.conf\n")
|
|
for line in io.lines (ldsoconf) do
|
|
tmp_fd:write (line .. "\n")
|
|
end
|
|
tmp_fd:close ()
|
|
local res = os.rename (ldsoconf_tmp, ldsoconf)
|
|
if res == nil then
|
|
io.stdout:write ("Error: Unable to update configuration file (rename).\n")
|
|
end
|
|
else
|
|
io.stdout:write ("Error: Unable to update configuration file (open).\n")
|
|
end
|
|
end
|
|
end
|
|
|
|
-- (3) Rebuild ld.so.cache early.
|
|
-- If the format of the cache changes then we need to rebuild
|
|
-- the cache early to avoid any problems running binaries with
|
|
-- the new glibc.
|
|
|
|
-- Note: We use _prefix because Fedora's UsrMove says so.
|
|
post_exec ("%{_prefix}/sbin/ldconfig")
|
|
|
|
-- (4) Update gconv modules cache.
|
|
-- If the /usr/lib/gconv/gconv-modules.cache exists, then update it
|
|
-- with the latest set of modules that were just installed.
|
|
-- We assume that the cache is in _libdir/gconv and called
|
|
-- "gconv-modules.cache".
|
|
|
|
update_gconv_modules_cache()
|
|
|
|
-- (5) On upgrades, restart systemd if installed. "systemctl -q" does
|
|
-- not suppress the error message (which is common in chroots), so
|
|
-- open-code post_exec with standard error suppressed.
|
|
if tonumber(arg[2]) >= 2
|
|
and posix.access("%{_prefix}/bin/systemctl", "x")
|
|
then
|
|
local pid = posix.fork()
|
|
if pid == 0 then
|
|
posix.redirect2null(2)
|
|
assert(posix.exec("%{_prefix}/bin/systemctl", "daemon-reexec"))
|
|
elseif pid > 0 then
|
|
posix.wait(pid)
|
|
end
|
|
end
|
|
|
|
%posttrans all-langpacks -e -p <lua>
|
|
-- The old glibc-all-langpacks postun scriptlet deleted the locale-archive
|
|
-- file, so we may have to resurrect it on upgrades.
|
|
local archive_path = "%{_prefix}/lib/locale/locale-archive"
|
|
local real_path = "%{_prefix}/lib/locale/locale-archive.real"
|
|
local stat_archive = posix.stat(archive_path)
|
|
local stat_real = posix.stat(real_path)
|
|
-- If the hard link was removed, restore it.
|
|
if stat_archive ~= nil and stat_real ~= nil
|
|
and (stat_archive.ino ~= stat_real.ino
|
|
or stat_archive.dev ~= stat_real.dev) then
|
|
posix.unlink(archive_path)
|
|
stat_archive = nil
|
|
end
|
|
-- If the file is gone, restore it.
|
|
if stat_archive == nil then
|
|
posix.link(real_path, archive_path)
|
|
end
|
|
-- Remove .rpmsave file potentially created due to config file change.
|
|
local save_path = archive_path .. ".rpmsave"
|
|
if posix.access(save_path) then
|
|
posix.unlink(save_path)
|
|
end
|
|
|
|
%post gconv-extra -p <lua>
|
|
%glibc_post_funcs
|
|
update_gconv_modules_cache ()
|
|
|
|
%postun gconv-extra -p <lua>
|
|
%glibc_post_funcs
|
|
update_gconv_modules_cache ()
|
|
|
|
%files -f glibc.filelist
|
|
%dir %{_prefix}/%{_lib}/audit
|
|
%verify(not md5 size mtime) %config(noreplace) /etc/ld.so.conf
|
|
%verify(not md5 size mtime) %config(noreplace) /etc/rpc
|
|
%dir /etc/ld.so.conf.d
|
|
%dir %{_prefix}/libexec/getconf
|
|
%dir %{_libdir}/gconv
|
|
%dir %{_libdir}/gconv/gconv-modules.d
|
|
%dir %attr(0700,root,root) /var/cache/ldconfig
|
|
%attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/cache/ldconfig/aux-cache
|
|
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/ld.so.cache
|
|
%attr(0644,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /etc/gai.conf
|
|
# If rpm doesn't support %license, then use %doc instead.
|
|
%{!?_licensedir:%global license %%doc}
|
|
%license COPYING COPYING.LIB LICENSES
|
|
|
|
%files -f common.filelist common
|
|
%dir %{_prefix}/lib/locale
|
|
%dir %{_prefix}/lib/locale/C.utf8
|
|
%{_prefix}/lib/locale/C.utf8/*
|
|
|
|
%files all-langpacks
|
|
%{_prefix}/lib/locale
|
|
%{_prefix}/lib/locale/locale-archive
|
|
%{_prefix}/lib/locale/locale-archive.real
|
|
%{_prefix}/share/locale/*/LC_MESSAGES/libc.mo
|
|
%exclude %{_prefix}/lib/locale/C.utf8
|
|
%exclude %{_prefix}/lib/locale/zh*
|
|
%exclude %{_prefix}/lib/locale/en*
|
|
%exclude %{_prefix}/share/locale/zh*
|
|
%exclude %{_prefix}/share/locale/en*
|
|
|
|
%files langpack-en
|
|
%dir %{_prefix}/lib/locale
|
|
%{_prefix}/lib/locale/en*
|
|
%{_prefix}/share/locale/en_*/LC_MESSAGES/libc.mo
|
|
|
|
%files langpack-zh
|
|
%dir %{_prefix}/lib/locale
|
|
%{_prefix}/lib/locale/zh*
|
|
%{_prefix}/share/locale/zh_*/LC_MESSAGES/libc.mo
|
|
|
|
%files locale-source
|
|
%dir %{_prefix}/share/i18n/locales
|
|
%{_prefix}/share/i18n/locales/*
|
|
%dir %{_prefix}/share/i18n/charmaps
|
|
%{_prefix}/share/i18n/charmaps/*
|
|
|
|
%files -f devel.filelist devel
|
|
|
|
%if %{with docs}
|
|
%files -f doc.filelist doc
|
|
%endif
|
|
|
|
%files -f static.filelist static
|
|
|
|
%files -f utils.filelist utils
|
|
|
|
%files -f gconv.filelist gconv-extra
|
|
|
|
%files -f nss_db.filelist -n nss_db
|
|
/var/db/Makefile
|
|
%files -f nss_hesiod.filelist -n nss_hesiod
|
|
%doc hesiod/README.hesiod
|
|
%files -f nss-devel.filelist nss-devel
|
|
|
|
%files -f libnsl.filelist -n libnsl
|
|
|
|
%if %{with benchtests}
|
|
%files benchtests -f benchtests.filelist
|
|
%endif
|
|
|
|
%files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared
|
|
|
|
%changelog
|
|
* Thu Jan 5 2023 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.36-3
|
|
- sync patches from 2.36 release branch, upstream commit 4f4d7a13edfd2fdc57c9d76e1fd6d017fb47550c
|
|
- move glibc-langpack-xxx subpackage to glibc-all-langpacks except glibc-langpack-en/zh
|
|
|
|
* Thu Sep 1 2022 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.36-2
|
|
- sync patches from 2.36 release branch
|
|
- upstream commit: b3736d1a3c60a3ec9959bf3b38794958546bf6a2
|
|
|
|
* Thu Aug 04 2022 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.36-1
|
|
- rebase to 2.36
|
|
|
|
* Mon Jul 11 2022 Weisson <wenshu.hx@alibaba-inc.com> - 2.35-2
|
|
- Add support for riscv64
|
|
- RISC-V ABI wants to install everything in /lib64/lp64d or /usr/lib64/lp64d. Make these be symlinks to /lib64 or /usr/lib64 respectively.
|
|
- See: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/DRHT5YTPK4WWVGL3GIN5BF2IKX2ODHZ3/
|
|
|
|
* Tue Feb 22 2022 Chunmei Xu <xuchunmei@linux.alibaba.com> - 2.35-1
|
|
- upstream 2.35 release tarball and add patches from release/2.35/master
|