The package rpms/glibc.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/glibc.git/commit/?id=cc5db6cdfde3....
Change:
+%ifarch %{pie_arches}
Thanks.
Full change:
============
commit fac98a7443549ba70c22ce04773d9f075706a731
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 16:56:41 2018 +0100
Auto-sync with upstream branch master
Upstream commit: 4612268a0ad8e3409d8ce2314dd2dd8ee0af5269
- Correct the list of static PIE architectures
- glibc_post_upgrade: Remove process restart logic
- glibc_post_upgrade: Integrate into the build process
- glibc_post_upgrade: Do not clean up tls subdirectories
- glibc_post_upgrade: Drop ia64 support
- Remove architecture-specific symbolic link for iconvconfig
- powerpc: Fix syscalls during early process initialization (swbz#22685)
diff --git a/glibc.spec b/glibc.spec
index 9b34848..f98656b 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,6 @@
-%define glibcsrcdir glibc-2.26.9000-1139-g64f63cb458
+%define glibcsrcdir glibc-2.26.9000-1140-g4612268a0a
%define glibcversion 2.26.9000
-%define glibcrelease 43%{?dist}
+%define glibcrelease 44%{?dist}
# Pre-release tarballs are pulled in from git using a command that is
# effectively:
#
@@ -2035,6 +2035,17 @@ fi
%endif
%changelog
+* Fri Jan 19 2018 Florian Weimer <fweimer(a)redhat.com> - 2.26.9000-44
+- Correct the list of static PIE architectures
+- glibc_post_upgrade: Remove process restart logic
+- glibc_post_upgrade: Integrate into the build process
+- glibc_post_upgrade: Do not clean up tls subdirectories
+- glibc_post_upgrade: Drop ia64 support
+- Remove architecture-specific symbolic link for iconvconfig
+- Auto-sync with upstream branch master,
+ commit 4612268a0ad8e3409d8ce2314dd2dd8ee0af5269:
+- powerpc: Fix syscalls during early process initialization (swbz#22685)
+
* Fri Jan 19 2018 Florian Weimer <fweimer(a)redhat.com> - 2.26.9000-43
- Enable static PIE support
- Remove add-on support (already gone upstream)
diff --git a/sources b/sources
index 79e4030..7c1c2df 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (glibc-2.26.9000-1125-g860b0240a5.tar.gz) =
9508cbf8a7ce5f54f2fd847213de093b8b788a15d0092d1857742dd8109ba54d7b52d7cdc65ba5500c80de493e92b0e059f7daaec2870cb1fbc6ea9de3cf5808
+SHA512 (glibc-2.26.9000-1140-g4612268a0a.tar.gz) =
b35f937e3f20b4b934e7106bad92a7ec80ce8daeb7e9a037d46e0443d64f8bfe0525126b47e4904533a179a2a20d495602e0c6085c83fac85537c4033086a41a
commit a071c6801cce4ea0c2d16b4b139f33171c57ca0f
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 16:49:19 2018 +0100
glibc_post_upgrade: Remove process restart logic
The sshd restart looks potentially useful, but it has not run for a
long time because the file /etc/rc.d/init.d/sshd does not exit
anymore, so it appears unnecessary after all.
diff --git a/glibc-post_upgrade.patch b/glibc-post_upgrade.patch
index 075660c..60baa49 100644
--- a/glibc-post_upgrade.patch
+++ b/glibc-post_upgrade.patch
@@ -32,10 +32,10 @@ index 2a432d8beebcd207..368dcae477fff2ae 100644
-D'SLIBDIR="$(slibdir)"'
diff --git a/elf/glibc_post_upgrade.c b/elf/glibc_post_upgrade.c
new file mode 100644
-index 0000000000000000..3c9839ae523d2cc7
+index 0000000000000000..19b59f70e2308032
--- /dev/null
+++ b/elf/glibc_post_upgrade.c
-@@ -0,0 +1,322 @@
+@@ -0,0 +1,229 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdio.h>
@@ -46,8 +46,6 @@ index 0000000000000000..3c9839ae523d2cc7
+#include <stddef.h>
+#include <fcntl.h>
+#include <string.h>
-+#include <sys/stat.h>
-+#include <elf.h>
+
+#define LD_SO_CONF "/etc/ld.so.conf"
+#define ICONVCONFIG "/usr/sbin/iconvconfig"
@@ -63,12 +61,10 @@ index 0000000000000000..3c9839ae523d2cc7
+__attribute__((noinline)) static void says (const char *str);
+__attribute__((noinline)) static void sayn (long num);
+__attribute__((noinline)) static void message (char *const path[]);
-+__attribute__((noinline)) static int check_elf (const char *name);
+
+int
+main (void)
+{
-+ struct stat statbuf;
+ char initpath[256];
+
+ char buffer[4096];
@@ -180,50 +176,6 @@ index 0000000000000000..3c9839ae523d2cc7
+ (char *) iconv_dir);
+ }
+
-+ /* Check if telinit is available and either SysVInit fifo,
-+ or upstart telinit. */
-+ if (access ("/sbin/telinit", X_OK)
-+ || ((!!access ("/dev/initctl", F_OK))
-+ ^ !access ("/sbin/initctl", X_OK)))
-+ _exit (0);
-+
-+ /* Check if we are not inside of some chroot, because we'd just
-+ timeout and leave /etc/initrunlvl.
-+
-+ On more modern systems this test is not sufficient to detect
-+ if we're in a chroot. */
-+ if (readlink ("/proc/1/exe", initpath, 256) <= 0 ||
-+ readlink ("/proc/1/root", initpath, 256) <= 0)
-+ _exit (0);
-+
-+ /* Here's another well known way to detect chroot, at least on an
-+ ext and xfs filesystems and assuming nothing mounted on the chroot's
-+ root. */
-+ if (stat ("/", &statbuf) != 0
-+ || (statbuf.st_ino != 2
-+ && statbuf.st_ino != 128))
-+ _exit (0);
-+
-+ if (check_elf ("/proc/1/exe"))
-+ verbose_exec (116,
-+ (char *) "/sbin/telinit",
-+ (char *) "/sbin/telinit",
-+ (char *) "u");
-+
-+ /* Check if we can safely condrestart sshd. */
-+ if (access ("/sbin/service", X_OK) == 0
-+ && access ("/usr/sbin/sshd", X_OK) == 0
-+ && access ("/etc/rc.d/init.d/sshd", X_OK) == 0
-+ && access ("/bin/bash", X_OK) == 0)
-+ {
-+ if (check_elf ("/usr/sbin/sshd"))
-+ verbose_exec (-121,
-+ (char *) "/sbin/service",
-+ (char *) "/sbin/service",
-+ (char *) "sshd",
-+ (char *) "condrestart");
-+ }
-+
+ _exit(0);
+}
+
@@ -313,48 +265,3 @@ index 0000000000000000..3c9839ae523d2cc7
+ says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
+ says (path[0]);
+}
-+
-+static int
-+check_elf (const char *name)
-+{
-+ /* Play safe, if we can't open or read, assume it might be
-+ ELF for the current arch. */
-+ int ret = 1;
-+ int fd = open (name, O_RDONLY);
-+ if (fd >= 0)
-+ {
-+ Elf32_Ehdr ehdr;
-+ if (read (fd, &ehdr, offsetof (Elf32_Ehdr, e_version))
-+ == offsetof (Elf32_Ehdr, e_version))
-+ {
-+ ret = 0;
-+ if (ehdr.e_ident[EI_CLASS]
-+ == (sizeof (long) == 8 ? ELFCLASS64 : ELFCLASS32))
-+ {
-+#if defined __i386__
-+ ret = ehdr.e_machine == EM_386;
-+#elif defined __x86_64__
-+ ret = ehdr.e_machine == EM_X86_64;
-+#elif defined __powerpc64__
-+ ret = ehdr.e_machine == EM_PPC64;
-+#elif defined __powerpc__
-+ ret = ehdr.e_machine == EM_PPC;
-+#elif defined __s390__ || defined __s390x__
-+ ret = ehdr.e_machine == EM_S390;
-+#elif defined __x86_64__
-+ ret = ehdr.e_machine == EM_X86_64;
-+#elif defined __sparc__
-+ if (sizeof (long) == 8)
-+ ret = ehdr.e_machine == EM_SPARCV9;
-+ else
-+ ret = (ehdr.e_machine == EM_SPARC
-+ || ehdr.e_machine == EM_SPARC32PLUS);
-+#else
-+ ret = 1;
-+#endif
-+ }
-+ }
-+ close (fd);
-+ }
-+ return ret;
-+}
commit cc5db6cdfde3f93137f88e598de1333865c8ad08
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 16:32:44 2018 +0100
Correct the list of static PIE architectures
x86_64 was missing before.
diff --git a/glibc.spec b/glibc.spec
index 2610242..9b34848 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -92,6 +92,9 @@
%define buildpower8 0
%endif
+# Only some architectures have static PIE support.
+%define pie_arches aarch64 %{ix86} x86_64
+
##############################################################################
# Any architecture/kernel combination that supports running 32-bit and 64-bit
# code in userspace is considered a biarch arch.
@@ -930,7 +933,7 @@ build()
--enable-bind-now \
--build=%{target} \
--enable-stack-protector=strong \
-%ifarch %{ix86} aarch64
+%ifarch %{pie_arches}
--enable-static-pie \
%endif
--enable-tunables \
commit 737f7e8513f66db4247e2f5f301b2503633a809e
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 16:32:18 2018 +0100
glibc_post_upgrade: Integrate into the build process
This gives us access to the relevant definitions and also enables
us to perform a static PIE build without replicate the entire
compiler invocation.
Due to the move into the glibc build process, the program had to
be cleaned up to compile without warnings.
diff --git a/glibc-post_upgrade.patch b/glibc-post_upgrade.patch
new file mode 100644
index 0000000..075660c
--- /dev/null
+++ b/glibc-post_upgrade.patch
@@ -0,0 +1,360 @@
+A helper program is needed to clean up the system configuration
+early during RPM package installation, so that other scriptlets
+can run successfully.
+
+diff --git a/elf/Makefile b/elf/Makefile
+index 2a432d8beebcd207..368dcae477fff2ae 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -117,6 +117,14 @@ others-extras = $(ldconfig-modules)
+ endif
+ endif
+
++# This needs to be statically linked because it is executed at a time
++# when there might be incompatible shared objects on disk, and the
++# purpose of this program is to remove them (among other things).
++others-static += glibc_post_upgrade
++others += glibc_post_upgrade
++glibc_post_upgrade-modules := static-stubs
++CFLAGS-glibc_post_upgrade.c += -DGCONV_MODULES_DIR='"$(gconvdir)"'
++
+ # To find xmalloc.c and xstrdup.c
+ vpath %.c ../locale/programs
+
+@@ -559,6 +567,8 @@ $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
+
+ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+
++$(objpfx)glibc_post_upgrade: $(glibc_post_upgrade-modules:%=$(objpfx)%.o)
++
+ SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+ CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
+ -D'SLIBDIR="$(slibdir)"'
+diff --git a/elf/glibc_post_upgrade.c b/elf/glibc_post_upgrade.c
+new file mode 100644
+index 0000000000000000..3c9839ae523d2cc7
+--- /dev/null
++++ b/elf/glibc_post_upgrade.c
+@@ -0,0 +1,322 @@
++#include <sys/types.h>
++#include <sys/wait.h>
++#include <stdio.h>
++#include <errno.h>
++#include <unistd.h>
++#include <sys/time.h>
++#include <dirent.h>
++#include <stddef.h>
++#include <fcntl.h>
++#include <string.h>
++#include <sys/stat.h>
++#include <elf.h>
++
++#define LD_SO_CONF "/etc/ld.so.conf"
++#define ICONVCONFIG "/usr/sbin/iconvconfig"
++
++#define verbose_exec(failcode, path...) \
++ do \
++ { \
++ char *const arr[] = { path, NULL }; \
++ vexec (failcode, arr); \
++ } while (0)
++
++__attribute__((noinline)) static void vexec (int failcode, char *const path[]);
++__attribute__((noinline)) static void says (const char *str);
++__attribute__((noinline)) static void sayn (long num);
++__attribute__((noinline)) static void message (char *const path[]);
++__attribute__((noinline)) static int check_elf (const char *name);
++
++int
++main (void)
++{
++ struct stat statbuf;
++ char initpath[256];
++
++ char buffer[4096];
++ struct pref {
++ const char *p;
++ int len;
++ } prefix[] = { { "libc-", 5 }, { "libm-", 5 },
++ { "librt-", 6 }, { "libpthread-", 11 },
++ { "librtkaio-", 10 }, { "libthread_db-", 13 } };
++ int i, j, fd;
++ off_t base;
++ ssize_t ret;
++
++ /* 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 would be preferred by the dynamic linker
++ during the execution of subsequent RPM scriptlets, likely
++ resulting in process startup failures. */
++ const char *remove_dirs[] =
++ {
++#if defined (__i386__)
++ "/lib/i686",
++ "/lib/i686/nosegneg",
++#elif defined (__powerpc64__) && _CALL_ELF != 2
++ "/lib64/power6",
++#endif
++ };
++ for (j = 0; j < sizeof (remove_dirs) / sizeof (remove_dirs[0]); ++j)
++ {
++ size_t rmlen = strlen (remove_dirs[j]);
++ fd = open (remove_dirs[j], O_RDONLY);
++ if (fd >= 0
++ && (ret = getdirentries (fd, buffer, sizeof (buffer), &base))
++ >= (ssize_t) offsetof (struct dirent, d_name))
++ {
++ for (base = 0; base + offsetof (struct dirent, d_name) < ret; )
++ {
++ struct dirent *d = (struct dirent *) (buffer + base);
++
++ for (i = 0; i < sizeof (prefix) / sizeof (prefix[0]); i++)
++ if (! strncmp (d->d_name, prefix[i].p, prefix[i].len))
++ {
++ char *p = d->d_name + prefix[i].len;
++
++ while (*p == '.' || (*p >= '0' && *p
<= '9')) p++;
++ if (p[0] == 's' && p[1] == 'o' &&
p[2] == '\0'
++ && p + 3 - d->d_name
++ < sizeof (initpath) - rmlen - 1)
++ {
++ memcpy (initpath, remove_dirs[j], rmlen);
++ initpath[rmlen] = '/';
++ strcpy (initpath + rmlen + 1, d->d_name);
++ unlink (initpath);
++ break;
++ }
++ }
++ base += d->d_reclen;
++ }
++ close (fd);
++ }
++ }
++
++ int ldsocfd = open (LD_SO_CONF, O_RDONLY);
++ struct stat ldsocst;
++ if (ldsocfd >= 0 && fstat (ldsocfd, &ldsocst) >= 0)
++ {
++ char p[ldsocst.st_size + 1];
++ if (read (ldsocfd, p, ldsocst.st_size) == ldsocst.st_size)
++ {
++ p[ldsocst.st_size] = '\0';
++ if (strstr (p, "include ld.so.conf.d/*.conf") == NULL)
++ {
++ close (ldsocfd);
++ ldsocfd = open (LD_SO_CONF, O_WRONLY | O_TRUNC);
++ if (ldsocfd >= 0)
++ {
++ size_t slen = strlen ("include ld.so.conf.d/*.conf\n");
++ if (write (ldsocfd, "include ld.so.conf.d/*.conf\n", slen)
++ != slen
++ || write (ldsocfd, p, ldsocst.st_size) != ldsocst.st_size)
++ _exit (109);
++ }
++ }
++ }
++ if (ldsocfd >= 0)
++ close (ldsocfd);
++ }
++
++ /* If installing bi-arch glibc, rpm sometimes doesn't unpack all files
++ before running one of the lib's %post scriptlet. /sbin/ldconfig will
++ then be run by the other arch's %post. */
++ if (! access ("/sbin/ldconfig", X_OK))
++ verbose_exec (110,
++ (char *) "/sbin/ldconfig",
++ (char *) "/sbin/ldconfig");
++
++ if (! utimes (GCONV_MODULES_DIR "/gconv-modules.cache", NULL))
++ {
++ const char *iconv_cache = GCONV_MODULES_DIR "/gconv-modules.cache";
++ const char *iconv_dir = GCONV_MODULES_DIR;
++ verbose_exec (113,
++ (char *) ICONVCONFIG,
++ (char *) "/usr/sbin/iconvconfig",
++ (char *) "-o",
++ (char *) iconv_cache,
++ (char *) "--nostdlib",
++ (char *) iconv_dir);
++ }
++
++ /* Check if telinit is available and either SysVInit fifo,
++ or upstart telinit. */
++ if (access ("/sbin/telinit", X_OK)
++ || ((!!access ("/dev/initctl", F_OK))
++ ^ !access ("/sbin/initctl", X_OK)))
++ _exit (0);
++
++ /* Check if we are not inside of some chroot, because we'd just
++ timeout and leave /etc/initrunlvl.
++
++ On more modern systems this test is not sufficient to detect
++ if we're in a chroot. */
++ if (readlink ("/proc/1/exe", initpath, 256) <= 0 ||
++ readlink ("/proc/1/root", initpath, 256) <= 0)
++ _exit (0);
++
++ /* Here's another well known way to detect chroot, at least on an
++ ext and xfs filesystems and assuming nothing mounted on the chroot's
++ root. */
++ if (stat ("/", &statbuf) != 0
++ || (statbuf.st_ino != 2
++ && statbuf.st_ino != 128))
++ _exit (0);
++
++ if (check_elf ("/proc/1/exe"))
++ verbose_exec (116,
++ (char *) "/sbin/telinit",
++ (char *) "/sbin/telinit",
++ (char *) "u");
++
++ /* Check if we can safely condrestart sshd. */
++ if (access ("/sbin/service", X_OK) == 0
++ && access ("/usr/sbin/sshd", X_OK) == 0
++ && access ("/etc/rc.d/init.d/sshd", X_OK) == 0
++ && access ("/bin/bash", X_OK) == 0)
++ {
++ if (check_elf ("/usr/sbin/sshd"))
++ verbose_exec (-121,
++ (char *) "/sbin/service",
++ (char *) "/sbin/service",
++ (char *) "sshd",
++ (char *) "condrestart");
++ }
++
++ _exit(0);
++}
++
++void
++vexec (int failcode, char *const path[])
++{
++ pid_t pid;
++ int status, save_errno;
++ int devnull = 0;
++
++ if (failcode < 0)
++ {
++ devnull = 1;
++ failcode = -failcode;
++ }
++ pid = vfork ();
++ if (pid == 0)
++ {
++ int fd;
++ if (devnull && (fd = open ("/dev/null", O_WRONLY)) >= 0)
++ {
++ dup2 (fd, 1);
++ dup2 (fd, 2);
++ close (fd);
++ }
++ execv (path[0], path + 1);
++ save_errno = errno;
++ message (path);
++ says (" exec failed with errno ");
++ sayn (save_errno);
++ says ("\n");
++ _exit (failcode);
++ }
++ else if (pid < 0)
++ {
++ save_errno = errno;
++ message (path);
++ says (" fork failed with errno ");
++ sayn (save_errno);
++ says ("\n");
++ _exit (failcode + 1);
++ }
++ if (waitpid (0, &status, 0) != pid || !WIFEXITED (status))
++ {
++ message (path);
++ says (" child terminated abnormally\n");
++ _exit (failcode + 2);
++ }
++ if (WEXITSTATUS (status))
++ {
++ message (path);
++ says (" child exited with exit code ");
++ sayn (WEXITSTATUS (status));
++ says ("\n");
++ _exit (WEXITSTATUS (status));
++ }
++}
++
++static void
++says (const char *str)
++{
++ write (1, str, strlen (str));
++}
++
++static void
++sayn (long num)
++{
++ char string[sizeof (long) * 3 + 1];
++ char *p = string + sizeof (string) - 1;
++
++ *p = '\0';
++ if (num == 0)
++ *--p = '0';
++ else
++ while (num)
++ {
++ *--p = '0' + num % 10;
++ num = num / 10;
++ }
++
++ says (p);
++}
++
++static void
++message (char *const path[])
++{
++ says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
++ says (path[0]);
++}
++
++static int
++check_elf (const char *name)
++{
++ /* Play safe, if we can't open or read, assume it might be
++ ELF for the current arch. */
++ int ret = 1;
++ int fd = open (name, O_RDONLY);
++ if (fd >= 0)
++ {
++ Elf32_Ehdr ehdr;
++ if (read (fd, &ehdr, offsetof (Elf32_Ehdr, e_version))
++ == offsetof (Elf32_Ehdr, e_version))
++ {
++ ret = 0;
++ if (ehdr.e_ident[EI_CLASS]
++ == (sizeof (long) == 8 ? ELFCLASS64 : ELFCLASS32))
++ {
++#if defined __i386__
++ ret = ehdr.e_machine == EM_386;
++#elif defined __x86_64__
++ ret = ehdr.e_machine == EM_X86_64;
++#elif defined __powerpc64__
++ ret = ehdr.e_machine == EM_PPC64;
++#elif defined __powerpc__
++ ret = ehdr.e_machine == EM_PPC;
++#elif defined __s390__ || defined __s390x__
++ ret = ehdr.e_machine == EM_S390;
++#elif defined __x86_64__
++ ret = ehdr.e_machine == EM_X86_64;
++#elif defined __sparc__
++ if (sizeof (long) == 8)
++ ret = ehdr.e_machine == EM_SPARCV9;
++ else
++ ret = (ehdr.e_machine == EM_SPARC
++ || ehdr.e_machine == EM_SPARC32PLUS);
++#else
++ ret = 1;
++#endif
++ }
++ }
++ close (fd);
++ }
++ return ret;
++}
diff --git a/glibc.spec b/glibc.spec
index 6a75446..2610242 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -118,7 +118,6 @@ License: LGPLv2+ and LGPLv2+ with exceptions and GPLv2+
URL:
http://www.gnu.org/software/glibc/
Source0: %{?glibc_release_url}%{glibcsrcdir}.tar.gz
Source1: build-locale-archive.c
-Source2: glibc_post_upgrade.c
Source4: nscd.conf
Source7: nsswitch.conf
Source8: power6emul.c
@@ -154,7 +153,8 @@ Source11: SUPPORTED
#
##############################################################################
-Patch0001: glibc-fedora-nscd.patch
+Patch1: glibc-post_upgrade.patch
+Patch2: glibc-fedora-nscd.patch
# All these were from the glibc-fedora.patch mega-patch and need another
# round of reviewing. Ideally they'll either be submitted upstream or
@@ -734,7 +734,8 @@ microbenchmark tests on the system.
%setup -q -n %{glibcsrcdir}
# Patch order matters.
-%patch0001 -p1
+%patch1 -p1
+%patch2 -p1
%patch2007 -p1
%patch0012 -p1
%patch2013 -p1
@@ -1000,18 +1001,6 @@ build
%endif
##############################################################################
-# Build the glibc post-upgrade program:
-# We only build one of these with the default set of options. This program
-# must be able to run on all hardware for the lowest common denomintor since
-# we only build it once.
-##############################################################################
-pushd build-%{target}
-$GCC -static -L. -Os -g %{SOURCE2} \
- -o glibc_post_upgrade.%{_target_cpu} \
- '-DGCONV_MODULES_DIR="%{_libdir}/gconv"'
-popd
-
-##############################################################################
# Install glibc...
##############################################################################
%install
@@ -1245,7 +1234,7 @@ chmod 644 $RPM_BUILD_ROOT%{_libdir}/gconv/gconv-modules.cache
##############################################################################
# Install the upgrade program
-install -m 700 build-%{target}/glibc_post_upgrade.%{_target_cpu} \
+install -m 700 build-%{target}/elf/glibc_post_upgrade \
$RPM_BUILD_ROOT%{_prefix}/sbin/glibc_post_upgrade.%{_target_cpu}
# Strip all of the installed object files.
@@ -1494,7 +1483,7 @@ rm -rf $RPM_BUILD_ROOT%{_prefix}/share/zoneinfo
# 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
# glibc_post_upgrade.c is arbitrary.
-touch -r %{SOURCE2} $RPM_BUILD_ROOT/etc/ld.so.conf
+touch -r %{SOURCE0} $RPM_BUILD_ROOT/etc/ld.so.conf
touch -r sunrpc/etc.rpc $RPM_BUILD_ROOT/etc/rpc
pushd build-%{target}
commit 34f077631c047ffa6a99a7fa501ba95d4ec6ab5c
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 16:05:04 2018 +0100
Move glibc-fedora-nscd.patch comment into file
diff --git a/glibc-fedora-nscd.patch b/glibc-fedora-nscd.patch
index a26b928..c0c464d 100644
--- a/glibc-fedora-nscd.patch
+++ b/glibc-fedora-nscd.patch
@@ -1,3 +1,6 @@
+Fedora-specific configuration adjustment to introduce the nscd user.
+(Upstream does not assume this user exists.)
+
diff -Nrup a/nscd/nscd.conf b/nscd/nscd.conf
--- a/nscd/nscd.conf 2012-06-05 07:42:49.000000000 -0600
+++ b/nscd/nscd.conf 2012-06-07 12:15:21.818318670 -0600
diff --git a/glibc.spec b/glibc.spec
index e0019ca..6a75446 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -154,8 +154,6 @@ Source11: SUPPORTED
#
##############################################################################
-# Configuration twiddle, not sure there's a good case to get upstream to
-# change this.
Patch0001: glibc-fedora-nscd.patch
# All these were from the glibc-fedora.patch mega-patch and need another
commit 707a1e8f871cf22cb856a283480077c6efcae00e
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 15:30:50 2018 +0100
Remove architecture-specific symbolic link for iconvconfig
Its purpose is not entirely clear. glibc_post_upgrade invokes
iconvconfig with explicit paths, so it does not matter for which
multilib variant the binary was built.
diff --git a/glibc.spec b/glibc.spec
index 267bad7..e0019ca 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1010,8 +1010,7 @@ build
pushd build-%{target}
$GCC -static -L. -Os -g %{SOURCE2} \
-o glibc_post_upgrade.%{_target_cpu} \
- '-DGCONV_MODULES_DIR="%{_libdir}/gconv"' \
- '-DICONVCONFIG="%{_sbindir}/iconvconfig.%{_target_cpu}"'
+ '-DGCONV_MODULES_DIR="%{_libdir}/gconv"'
popd
##############################################################################
@@ -1254,9 +1253,6 @@ install -m 700 build-%{target}/glibc_post_upgrade.%{_target_cpu} \
# Strip all of the installed object files.
strip -g $RPM_BUILD_ROOT%{_libdir}/*.o
-# XXX: Ugly hack for buggy rpm. What bug? BZ? Is this fixed?
-ln -f ${RPM_BUILD_ROOT}%{_sbindir}/iconvconfig{,.%{_target_cpu}}
-
##############################################################################
# Install debug copies of unstripped static libraries
# - This step must be last in order to capture any additional static
diff --git a/glibc_post_upgrade.c b/glibc_post_upgrade.c
index a49f23d..c74d440 100644
--- a/glibc_post_upgrade.c
+++ b/glibc_post_upgrade.c
@@ -12,6 +12,7 @@
#include <elf.h>
#define LD_SO_CONF "/etc/ld.so.conf"
+#define ICONVCONFIG "/usr/sbin/iconvconfig"
#define verbose_exec(failcode, path...) \
do \
@@ -128,9 +129,6 @@ main (void)
if (! utimes (GCONV_MODULES_DIR "/gconv-modules.cache", NULL))
{
-#ifndef ICONVCONFIG
-#define ICONVCONFIG "/usr/sbin/iconvconfig"
-#endif
char *iconv_cache = GCONV_MODULES_DIR"/gconv-modules.cache";
char *iconv_dir = GCONV_MODULES_DIR;
verbose_exec (113, ICONVCONFIG, "/usr/sbin/iconvconfig",
commit e33b0e319728b8910e784de0be29ea56dea26892
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 15:11:38 2018 +0100
glibc_post_upgrade: Move LD_SO_CONF definition into source file
diff --git a/glibc.spec b/glibc.spec
index 258dbf9..267bad7 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1011,7 +1011,6 @@ pushd build-%{target}
$GCC -static -L. -Os -g %{SOURCE2} \
-o glibc_post_upgrade.%{_target_cpu} \
'-DGCONV_MODULES_DIR="%{_libdir}/gconv"' \
- '-DLD_SO_CONF="/etc/ld.so.conf"' \
'-DICONVCONFIG="%{_sbindir}/iconvconfig.%{_target_cpu}"'
popd
diff --git a/glibc_post_upgrade.c b/glibc_post_upgrade.c
index 1658507..a49f23d 100644
--- a/glibc_post_upgrade.c
+++ b/glibc_post_upgrade.c
@@ -11,6 +11,8 @@
#include <sys/stat.h>
#include <elf.h>
+#define LD_SO_CONF "/etc/ld.so.conf"
+
#define verbose_exec(failcode, path...) \
do \
{ \
commit 365663e72b5aebe2b428cddf928865c48350fd38
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 15:07:33 2018 +0100
glibc_post_upgrade: Do not clean up tls subdirectories
These were removed a long time ago.
diff --git a/glibc.spec b/glibc.spec
index af08df2..258dbf9 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1010,7 +1010,6 @@ build
pushd build-%{target}
$GCC -static -L. -Os -g %{SOURCE2} \
-o glibc_post_upgrade.%{_target_cpu} \
- '-DLIBTLS="/%{_lib}/tls/"' \
'-DGCONV_MODULES_DIR="%{_libdir}/gconv"' \
'-DLD_SO_CONF="/etc/ld.so.conf"' \
'-DICONVCONFIG="%{_sbindir}/iconvconfig.%{_target_cpu}"'
diff --git a/glibc_post_upgrade.c b/glibc_post_upgrade.c
index 134607b..1658507 100644
--- a/glibc_post_upgrade.c
+++ b/glibc_post_upgrade.c
@@ -51,18 +51,10 @@ main (void)
const char *remove_dirs[] =
{
#if defined (__i386__)
- "/lib/tls",
"/lib/i686",
- "/lib/tls/i486",
- "/lib/tls/i586",
- "/lib/tls/i686",
"/lib/i686/nosegneg",
#elif defined (__powerpc64__) && _CALL_ELF != 2
"/lib64/power6",
-#elif defined (LIBTLS)
- LIBTLS,
-#else
- "/lib/tls",
#endif
};
for (j = 0; j < sizeof (remove_dirs) / sizeof (remove_dirs[0]); ++j)
commit 91ed2dbf627116ca8edd2038ab6084f22dcefb94
Author: Florian Weimer <fweimer(a)redhat.com>
Date: Fri Jan 19 15:02:09 2018 +0100
glibc_post_upgrade: Drop ia64 support
diff --git a/glibc_post_upgrade.c b/glibc_post_upgrade.c
index ad3215c..134607b 100644
--- a/glibc_post_upgrade.c
+++ b/glibc_post_upgrade.c
@@ -24,39 +24,6 @@ __attribute__((noinline)) void sayn (long num);
__attribute__((noinline)) void message (char *const path[]);
__attribute__((noinline)) int check_elf (const char *name);
-#ifdef __i386__
-static int
-is_ia64 (void)
-{
- unsigned int fl1, fl2;
-
- /* See if we can use cpuid. */
- __asm__ ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
- "pushl %0; popfl; pushfl; popl %0; popfl"
- : "=&r" (fl1), "=&r" (fl2)
- : "i" (0x00200000));
- if (((fl1 ^ fl2) & 0x00200000) == 0)
- return 0;
-
- /* Host supports cpuid. See if cpuid gives capabilities, try
- CPUID(0). Preserve %ebx and %ecx; cpuid insn clobbers these, we
- don't need their CPUID values here, and %ebx may be the PIC
- register. */
- __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
- : "=a" (fl1) : "0" (0) : "edx", "cc");
- if (fl1 == 0)
- return 0;
-
- /* Invoke CPUID(1), return %edx; caller can examine bits to
- determine what's supported. */
- __asm__ ("pushl %%ecx; pushl %%ebx; cpuid; popl %%ebx; popl %%ecx"
- : "=d" (fl2), "=a" (fl1) : "1" (1) : "cc");
- return (fl2 & (1 << 30)) != 0;
-}
-#else
-#define is_ia64() 0
-#endif
-
int
main (void)
{
@@ -172,11 +139,6 @@ main (void)
#endif
char *iconv_cache = GCONV_MODULES_DIR"/gconv-modules.cache";
char *iconv_dir = GCONV_MODULES_DIR;
- if (is_ia64 ())
- {
- iconv_cache =
"/emul/ia32-linux"GCONV_MODULES_DIR"/gconv-modules.cache";
- iconv_dir = "/emul/ia32-linux"GCONV_MODULES_DIR;
- }
verbose_exec (113, ICONVCONFIG, "/usr/sbin/iconvconfig",
"-o", iconv_cache,
"--nostdlib", iconv_dir);
@@ -330,8 +292,6 @@ check_elf (const char *name)
ret = ehdr.e_machine == EM_386;
#elif defined __x86_64__
ret = ehdr.e_machine == EM_X86_64;
-#elif defined __ia64__
- ret = ehdr.e_machine == EM_IA_64;
#elif defined __powerpc64__
ret = ehdr.e_machine == EM_PPC64;
#elif defined __powerpc__