| |
@@ -1,5 +1,5 @@
|
| |
- %define glibcsrcdir glibc-2.35.9000-44-g3d9f171bfb
|
| |
- %define glibcversion 2.35.9000
|
| |
+ %global glibcsrcdir glibc-2.35.9000-44-g3d9f171bfb
|
| |
+ %global glibcversion 2.35.9000
|
| |
# Pre-release tarballs are pulled in from git using a command that is
|
| |
# effectively:
|
| |
#
|
| |
@@ -84,25 +84,25 @@
|
| |
##############################################################################
|
| |
# Any architecture/kernel combination that supports running 32-bit and 64-bit
|
| |
# code in userspace is considered a biarch arch.
|
| |
- %define biarcharches %{ix86} x86_64 s390 s390x
|
| |
+ %global biarcharches %{ix86} x86_64 s390 s390x
|
| |
|
| |
# Avoid generating a glibc-headers package on architectures which are
|
| |
# not biarch.
|
| |
%ifarch %{biarcharches}
|
| |
- %define need_headers_package 1
|
| |
+ %global need_headers_package 1
|
| |
%if 0%{?rhel} > 0
|
| |
- %define headers_package_name glibc-headers
|
| |
+ %global headers_package_name glibc-headers
|
| |
%else
|
| |
%ifarch %{ix86} x86_64
|
| |
- %define headers_package_name glibc-headers-x86
|
| |
+ %global headers_package_name glibc-headers-x86
|
| |
%endif
|
| |
%ifarch s390 s390x
|
| |
- %define headers_package_name glibc-headers-s390
|
| |
+ %global headers_package_name glibc-headers-s390
|
| |
%endif
|
| |
%dnl !rhel
|
| |
%endif
|
| |
%else
|
| |
- %define need_headers_package 0
|
| |
+ %global need_headers_package 0
|
| |
%dnl !biarcharches
|
| |
%endif
|
| |
|
| |
@@ -110,41 +110,41 @@
|
| |
# 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}
|
| |
+ %global glibc_post_funcs %{expand:
|
| |
+ -- We use lua 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.
|
| |
+ --
|
| |
+ -- Note: We use _prefix because Fedora's UsrMove says so.
|
| |
+ function call_ldconfig ()
|
| |
+ if not rpm.execute("%{_prefix}/sbin/ldconfig") then
|
| |
+ io.stdout:write ("Error: call to %{_prefix}/sbin/ldconfig failed.\n")
|
| |
+ 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
|
| |
+ if not rpm.execute("%{_prefix}/sbin/iconvconfig",
|
| |
+ "-o", iconv_cache,
|
| |
+ "--nostdlib",
|
| |
+ iconv_dir)
|
| |
+ then
|
| |
+ io.stdout:write ("Error: call to %{_prefix}/sbin/iconvconfig failed.\n")
|
| |
+ end
|
| |
+ else
|
| |
+ io.stdout:write ("Error: Missing " .. iconv_cache .. " file.\n")
|
| |
+ end
|
| |
+ end
|
| |
+ end}
|
| |
|
| |
##############################################################################
|
| |
# %%package glibc - The GNU C Library (glibc) core package.
|
| |
@@ -208,7 +208,7 @@
|
| |
|
| |
# The wrapper script relies on the fact that debugedit does not change
|
| |
# build IDs.
|
| |
- %define _no_recompute_build_ids 1
|
| |
+ %global _no_recompute_build_ids 1
|
| |
%undefine _unique_build_ids
|
| |
|
| |
##############################################################################
|
| |
@@ -293,14 +293,14 @@
|
| |
|
| |
# This GCC version is needed for -fstack-clash-protection support.
|
| |
BuildRequires: gcc >= 7.2.1-6
|
| |
- %define enablekernel 3.2
|
| |
+ %global enablekernel 3.2
|
| |
Conflicts: kernel < %{enablekernel}
|
| |
- %define target %{_target_cpu}-redhat-linux
|
| |
+ %global target %{_target_cpu}-redhat-linux
|
| |
%ifarch %{arm}
|
| |
- %define target %{_target_cpu}-redhat-linuxeabi
|
| |
+ %global target %{_target_cpu}-redhat-linuxeabi
|
| |
%endif
|
| |
%ifarch ppc64le
|
| |
- %define target ppc64le-redhat-linux
|
| |
+ %global target ppc64le-redhat-linux
|
| |
%endif
|
| |
|
| |
# GNU make 4.0 introduced the -O option.
|
| |
@@ -489,12 +489,14 @@
|
| |
|
| |
# File triggers for when libraries are added or removed in standard
|
| |
# paths.
|
| |
- %transfiletriggerin common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
|
| |
- /sbin/ldconfig
|
| |
+ %transfiletriggerin common -P 2000000 -p <lua> -- /lib /usr/lib /lib64 /usr/lib64
|
| |
+ %glibc_post_funcs
|
| |
+ call_ldconfig()
|
| |
%end
|
| |
|
| |
- %transfiletriggerpostun common -P 2000000 -- /lib /usr/lib /lib64 /usr/lib64
|
| |
- /sbin/ldconfig
|
| |
+ %transfiletriggerpostun common -P 2000000 -p <lua> -- /lib /usr/lib /lib64 /usr/lib64
|
| |
+ %glibc_post_funcs
|
| |
+ call_ldconfig()
|
| |
%end
|
| |
|
| |
# We need to run ldconfig manually because __brp_ldconfig assumes that
|
| |
@@ -1123,8 +1125,8 @@
|
| |
# 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}
|
| |
+ %global glibc_make_flags_as ASFLAGS="-g -Wa,--generate-missing-build-notes=yes"
|
| |
+ %global glibc_make_flags %{glibc_make_flags_as}
|
| |
|
| |
##############################################################################
|
| |
# %%build - Generic options.
|
| |
@@ -1195,7 +1197,7 @@
|
| |
# 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
|
| |
+ %global glibc_sysroot $RPM_BUILD_ROOT
|
| |
|
| |
# Remove existing file lists.
|
| |
find . -type f -name '*.filelist' -exec rm -rf {} \;
|
| |
@@ -2048,8 +2050,7 @@
|
| |
-- 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")
|
| |
+ call_ldconfig()
|
| |
|
| |
-- (4) Update gconv modules cache.
|
| |
-- If the /usr/lib/gconv/gconv-modules.cache exists, then update it
|
| |
@@ -2061,7 +2062,7 @@
|
| |
|
| |
-- (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.
|
| |
+ -- open-code rpm.execute with standard error suppressed.
|
| |
if tonumber(arg[2]) >= 2
|
| |
and posix.access("%{_prefix}/bin/systemctl", "x")
|
| |
then
|
| |
The scriptlet in glibc adds a dependency on bash to glibc-common,
which is required by glibc, so effectively the whole world depends on
bash. By rewriting the script in lua we drop this dependency.
Quoting https://bugzilla.redhat.com/show_bug.cgi?id=2018913#c34:
If we look into SCC #1, bash obviously requires glibc because it links
to it. The loop is created by glibc → glibc-common → bash, because
glibc-common has %transfiletriggerin and %transfiletriggerpostun using
bash to call /sbin/ldconfig.
https://github.com/coreos/rpm-ostree/pull/3453 provides a workaround so
that rpm-ostree doesn't choke on this.
Note that this is untested: I'm building glibc in mock right now, but since that takes a while,
I thought I'd post the patch here for comments. I'll report the results of the local test
here later.