From cc8c150f76b3ae3efa74335875e50cfdc3630bc8742cf105bae048f2fa10835d Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Wed, 7 May 2014 15:06:20 +0000 Subject: [PATCH 1/3] Accepting request 232954 from home:Andreas_Schwab:Factory - getaddrinfo-uninit-result.patch: fix parsing of getai result for IPv6-only request (bnc#876521) OBS-URL: https://build.opensuse.org/request/show/232954 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=364 --- getaddrinfo-uninit-result.patch | 18 +++++++++++------- glibc-testsuite.changes | 6 ++++++ glibc-utils.changes | 6 ++++++ glibc.changes | 6 ++++++ 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/getaddrinfo-uninit-result.patch b/getaddrinfo-uninit-result.patch index 99a5bbc..06887a3 100644 --- a/getaddrinfo-uninit-result.patch +++ b/getaddrinfo-uninit-result.patch @@ -5,18 +5,22 @@ Index: glibc-2.19/sysdeps/posix/getaddrinfo.c =================================================================== --- glibc-2.19.orig/sysdeps/posix/getaddrinfo.c +++ glibc-2.19/sysdeps/posix/getaddrinfo.c -@@ -710,6 +710,14 @@ gaih_inet (const char *name, const struc - struct gaih_addrtuple *addrfree = addrmem; - for (int i = 0; i < air->naddrs; ++i) +@@ -712,6 +712,18 @@ gaih_inet (const char *name, const struc { + socklen_t size = (air->family[i] == AF_INET + ? INADDRSZ : IN6ADDRSZ); ++ + if (!((air->family[i] == AF_INET + && req->ai_family == AF_INET6 + && (req->ai_flags & AI_V4MAPPED) != 0) + || req->ai_family == AF_UNSPEC + || air->family[i] == req->ai_family)) -+ /* Skip over non-matching result. */ -+ continue; ++ { ++ /* Skip over non-matching result. */ ++ addrs += size; ++ continue; ++ } + - socklen_t size = (air->family[i] == AF_INET - ? INADDRSZ : IN6ADDRSZ); if (*pat == NULL) + { + *pat = addrfree++; diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 8292fd9..846e111 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 7 10:13:24 UTC 2014 - schwab@suse.de + +- getaddrinfo-uninit-result.patch: fix parsing of getai result for + IPv6-only request (bnc#876521) + ------------------------------------------------------------------- Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.changes b/glibc-utils.changes index 8292fd9..846e111 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 7 10:13:24 UTC 2014 - schwab@suse.de + +- getaddrinfo-uninit-result.patch: fix parsing of getai result for + IPv6-only request (bnc#876521) + ------------------------------------------------------------------- Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de diff --git a/glibc.changes b/glibc.changes index 8292fd9..846e111 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed May 7 10:13:24 UTC 2014 - schwab@suse.de + +- getaddrinfo-uninit-result.patch: fix parsing of getai result for + IPv6-only request (bnc#876521) + ------------------------------------------------------------------- Thu Apr 17 09:13:32 UTC 2014 - schwab@suse.de From c0c9ae0337b004dd32dc4572c8691bad8b87192ac1e70d2d4be3e8e236ec0ee3 Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Mon, 12 May 2014 14:47:07 +0000 Subject: [PATCH 2/3] Accepting request 233621 from home:Andreas_Schwab:Factory - nss-nis-stack-use.patch: fix unbound stack use in NIS NSS module (BZ #16932) OBS-URL: https://build.opensuse.org/request/show/233621 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=365 --- glibc-testsuite.changes | 6 +++ glibc-testsuite.spec | 3 ++ glibc-utils.changes | 6 +++ glibc-utils.spec | 3 ++ glibc.changes | 6 +++ glibc.spec | 3 ++ nss-nis-stack-use.patch | 111 ++++++++++++++++++++++++++++++++++++++++ 7 files changed, 138 insertions(+) create mode 100644 nss-nis-stack-use.patch diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index 846e111..d14dedd1 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 12 13:22:40 UTC 2014 - schwab@suse.de + +- nss-nis-stack-use.patch: fix unbound stack use in NIS NSS module (BZ + #16932) + ------------------------------------------------------------------- Wed May 7 10:13:24 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 1bd53a8..89a7165 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -254,6 +254,8 @@ Patch1009: ibm-long-double-math.patch Patch1010: ibm-long-double-frexpl.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch1011: aarch64-setcontext.patch +# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) +Patch1012: nss-nis-stack-use.patch ### # Patches awaiting upstream approval @@ -480,6 +482,7 @@ rm nscd/s-stamp %patch1009 -p1 %patch1010 -p1 %patch1011 -p1 +%patch1012 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/glibc-utils.changes b/glibc-utils.changes index 846e111..d14dedd1 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 12 13:22:40 UTC 2014 - schwab@suse.de + +- nss-nis-stack-use.patch: fix unbound stack use in NIS NSS module (BZ + #16932) + ------------------------------------------------------------------- Wed May 7 10:13:24 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index 03d3165..fd7a8f3 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -253,6 +253,8 @@ Patch1009: ibm-long-double-math.patch Patch1010: ibm-long-double-frexpl.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch1011: aarch64-setcontext.patch +# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) +Patch1012: nss-nis-stack-use.patch ### # Patches awaiting upstream approval @@ -480,6 +482,7 @@ rm nscd/s-stamp %patch1009 -p1 %patch1010 -p1 %patch1011 -p1 +%patch1012 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/glibc.changes b/glibc.changes index 846e111..d14dedd1 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 12 13:22:40 UTC 2014 - schwab@suse.de + +- nss-nis-stack-use.patch: fix unbound stack use in NIS NSS module (BZ + #16932) + ------------------------------------------------------------------- Wed May 7 10:13:24 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 1673831..4bc0abc 100644 --- a/glibc.spec +++ b/glibc.spec @@ -254,6 +254,8 @@ Patch1009: ibm-long-double-math.patch Patch1010: ibm-long-double-frexpl.patch # PATCH-FIX-UPSTREAM Fix aarch64 setcontext clobbering alternate signal stack (BZ #16629) Patch1011: aarch64-setcontext.patch +# PATCH-FIX-UPSTREAM Fix unbound stack use in NIS NSS module (BZ #16932) +Patch1012: nss-nis-stack-use.patch ### # Patches awaiting upstream approval @@ -480,6 +482,7 @@ rm nscd/s-stamp %patch1009 -p1 %patch1010 -p1 %patch1011 -p1 +%patch1012 -p1 %patch2000 -p1 %patch2001 -p1 diff --git a/nss-nis-stack-use.patch b/nss-nis-stack-use.patch new file mode 100644 index 0000000..6d0309f --- /dev/null +++ b/nss-nis-stack-use.patch @@ -0,0 +1,111 @@ +2014-05-12 Andreas Schwab + + [BZ #16932] + * nis/nss_nis/nis-hosts.c (internal_gethostbyname2_r) + (_nss_nis_gethostbyname4_r): Return error if item length is larger + than maximum RPC packet size. + * nis/nss_nis/nis-initgroups.c (initgroups_netid): Likewise. + * nis/nss_nis/nis-network.c (_nss_nis_getnetbyname_r): Likewise. + * nis/nss_nis/nis-service.c (_nss_nis_getservbyname_r) + (_nss_nis_getservbyport_r): Likewise. + +Index: glibc-2.19/nis/nss_nis/nis-hosts.c +=================================================================== +--- glibc-2.19.orig/nis/nss_nis/nis-hosts.c ++++ glibc-2.19/nis/nss_nis/nis-hosts.c +@@ -270,6 +270,13 @@ internal_gethostbyname2_r (const char *n + + /* Convert name to lowercase. */ + size_t namlen = strlen (name); ++ /* Limit name length to the maximum size of an RPC packet. */ ++ if (namlen > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + char name2[namlen + 1]; + size_t i; + +@@ -461,6 +468,13 @@ _nss_nis_gethostbyname4_r (const char *n + + /* Convert name to lowercase. */ + size_t namlen = strlen (name); ++ /* Limit name length to the maximum size of an RPC packet. */ ++ if (namlen > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + char name2[namlen + 1]; + size_t i; + +Index: glibc-2.19/nis/nss_nis/nis-initgroups.c +=================================================================== +--- glibc-2.19.orig/nis/nss_nis/nis-initgroups.c ++++ glibc-2.19/nis/nss_nis/nis-initgroups.c +@@ -150,6 +150,13 @@ initgroups_netid (uid_t uid, gid_t group + gid_t **groupsp, long int limit, int *errnop, + const char *domainname) + { ++ /* Limit domainname length to the maximum size of an RPC packet. */ ++ if (strlen (domainname) > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + /* Prepare the key. The form is "unix.UID@DOMAIN" with the UID and + DOMAIN field filled in appropriately. */ + char key[sizeof ("unix.@") + sizeof (uid_t) * 3 + strlen (domainname)]; +Index: glibc-2.19/nis/nss_nis/nis-network.c +=================================================================== +--- glibc-2.19.orig/nis/nss_nis/nis-network.c ++++ glibc-2.19/nis/nss_nis/nis-network.c +@@ -179,6 +179,13 @@ _nss_nis_getnetbyname_r (const char *nam + + /* Convert name to lowercase. */ + size_t namlen = strlen (name); ++ /* Limit name length to the maximum size of an RPC packet. */ ++ if (namlen > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + char name2[namlen + 1]; + size_t i; + +Index: glibc-2.19/nis/nss_nis/nis-service.c +=================================================================== +--- glibc-2.19.orig/nis/nss_nis/nis-service.c ++++ glibc-2.19/nis/nss_nis/nis-service.c +@@ -271,6 +271,13 @@ _nss_nis_getservbyname_r (const char *na + /* If the protocol is given, we could try if our NIS server knows + about services.byservicename map. If yes, we only need one query. */ + size_t keylen = strlen (name) + (protocol ? 1 + strlen (protocol) : 0); ++ /* Limit key length to the maximum size of an RPC packet. */ ++ if (keylen > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + char key[keylen + 1]; + + /* key is: "name/proto" */ +@@ -355,6 +362,13 @@ _nss_nis_getservbyport_r (int port, cons + Otherwise try first port/tcp, then port/udp and then fallback + to sequential scanning of services.byname. */ + const char *proto = protocol != NULL ? protocol : "tcp"; ++ /* Limit protocol name length to the maximum size of an RPC packet. */ ++ if (strlen (proto) > UDPMSGSIZE) ++ { ++ *errnop = ERANGE; ++ return NSS_STATUS_UNAVAIL; ++ } ++ + do + { + /* key is: "port/proto" */ From b640147c97b7a3045a838021644448b3b883bd8e46bb527425d0de061c92ad5b Mon Sep 17 00:00:00 2001 From: Andreas Schwab Date: Thu, 15 May 2014 16:27:45 +0000 Subject: [PATCH 3/3] Accepting request 234223 from home:Andreas_Schwab:Factory - add non-elision-enabled libpthread OBS-URL: https://build.opensuse.org/request/show/234223 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=366 --- glibc-testsuite.changes | 5 +++++ glibc-testsuite.spec | 47 ++++++++++++++++++++++++++--------------- glibc-utils.changes | 5 +++++ glibc-utils.spec | 47 ++++++++++++++++++++++++++--------------- glibc.changes | 5 +++++ glibc.spec | 47 ++++++++++++++++++++++++++--------------- 6 files changed, 105 insertions(+), 51 deletions(-) diff --git a/glibc-testsuite.changes b/glibc-testsuite.changes index d14dedd1..891e9f3 100644 --- a/glibc-testsuite.changes +++ b/glibc-testsuite.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 15 15:45:03 UTC 2014 - schwab@suse.de + +- add non-elision-enabled libpthread + ------------------------------------------------------------------- Mon May 12 13:22:40 UTC 2014 - schwab@suse.de diff --git a/glibc-testsuite.spec b/glibc-testsuite.spec index 89a7165..8b6b3a9 100644 --- a/glibc-testsuite.spec +++ b/glibc-testsuite.spec @@ -626,17 +626,21 @@ configure_and_build_glibc() { profile="--enable-profile" fi %endif - CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ - CC="$BuildCC" CXX="$BuildCCplus" ../configure \ + elision=--enable-lock-elision + if [ "$dirname" = "noelision" ]; then + elision=--disable-lock-elision + fi + ../configure \ + CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ + CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ --enable-add-ons=nptl$addons \ - $profile \ + $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} --enable-stackguard-randomization \ %endif - --enable-lock-elision \ --build=%{target} --host=%{target} \ %ifarch armv7hl ppc ppc64 ppc64le %{ix86} x86_64 sparc sparc64 s390 s390x --enable-multi-arch \ @@ -698,6 +702,10 @@ configure_and_build_glibc() { %endif %endif # optimize_power +%ifarch i686 x86_64 +configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +%endif + # # Build html documentation # @@ -799,10 +807,9 @@ do else cp -a ${lib}.so $destdir/$libbaseso fi - # Emulate ldconfig - ln -sf $libbaseso $destdir/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) done cd .. +cc-base/elf/ldconfig -vn $destdir } # Install power-optimized glibc @@ -817,7 +824,7 @@ cd .. install_optimized_variant power7 power7 ".." %endif %if %{powerpc_optimize_cpu_cell} - install_optimized_variant ppc-cell-be ppc-cell-be ".." + install_optimized_variant ppc-cell-be ppc-cell-be ".." %endif %if %{powerpc_optimize_cpu_power6} # power6 is compatible with power6x @@ -825,17 +832,23 @@ cd .. if test -d %{buildroot}/%{_lib}/power6; then mkdir -p %{buildroot}/%{_lib}/power6x for i in %{buildroot}/%{_lib}/power6/*.so; do - b=`basename $i` - ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b - libbase=${b%.so} - libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so) - # Emulate ldconfig - ln -sf $libbaseso %{buildroot}/%{_lib}/power6x/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) + b=$(basename $i) + ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b done + cc-base/elf/ldconfig -vn %{buildroot}/%{_lib}/power6x fi %endif %endif # optimize_power +%ifarch i686 x86_64 +cd cc-noelision +destdir=$RPM_BUILD_ROOT/%{_lib}/noelision +mkdir -p $destdir +install -m 755 nptl/libpthread.so $destdir/libpthread-%{glibc_major_version}.so +cd .. +cc-base/elf/ldconfig -vn $destdir +%endif + # Install locales %if %{build_locales} # XXX Do not install locales in parallel! @@ -1184,6 +1197,9 @@ exit 0 %{optimized_libs ppc-cell-be} %endif %endif # optimize_power +%ifarch i686 x86_64 +/%{_lib}/noelision +%endif %dir %attr(0700,root,root) /var/cache/ldconfig /sbin/ldconfig %{_bindir}/gencat @@ -1204,10 +1220,7 @@ exit 0 %ifarch i586 %files obsolete %defattr (755,root,root,755) -%dir /%{_lib}/obsolete/ - %dir /%{_lib}/obsolete/noversion - /%{_lib}/obsolete/noversion/libNoVersion-%{glibc_major_version}.so - /%{_lib}/obsolete/noversion/libNoVersion.so.1 +/%{_lib}/obsolete %endif %files locale -f libc.lang diff --git a/glibc-utils.changes b/glibc-utils.changes index d14dedd1..891e9f3 100644 --- a/glibc-utils.changes +++ b/glibc-utils.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 15 15:45:03 UTC 2014 - schwab@suse.de + +- add non-elision-enabled libpthread + ------------------------------------------------------------------- Mon May 12 13:22:40 UTC 2014 - schwab@suse.de diff --git a/glibc-utils.spec b/glibc-utils.spec index fd7a8f3..8d93109 100644 --- a/glibc-utils.spec +++ b/glibc-utils.spec @@ -626,17 +626,21 @@ configure_and_build_glibc() { profile="--enable-profile" fi %endif - CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ - CC="$BuildCC" CXX="$BuildCCplus" ../configure \ + elision=--enable-lock-elision + if [ "$dirname" = "noelision" ]; then + elision=--disable-lock-elision + fi + ../configure \ + CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ + CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ --enable-add-ons=nptl$addons \ - $profile \ + $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} --enable-stackguard-randomization \ %endif - --enable-lock-elision \ --build=%{target} --host=%{target} \ %ifarch armv7hl ppc ppc64 ppc64le %{ix86} x86_64 sparc sparc64 s390 s390x --enable-multi-arch \ @@ -698,6 +702,10 @@ configure_and_build_glibc() { %endif %endif # optimize_power +%ifarch i686 x86_64 +configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +%endif + # # Build html documentation # @@ -799,10 +807,9 @@ do else cp -a ${lib}.so $destdir/$libbaseso fi - # Emulate ldconfig - ln -sf $libbaseso $destdir/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) done cd .. +cc-base/elf/ldconfig -vn $destdir } # Install power-optimized glibc @@ -817,7 +824,7 @@ cd .. install_optimized_variant power7 power7 ".." %endif %if %{powerpc_optimize_cpu_cell} - install_optimized_variant ppc-cell-be ppc-cell-be ".." + install_optimized_variant ppc-cell-be ppc-cell-be ".." %endif %if %{powerpc_optimize_cpu_power6} # power6 is compatible with power6x @@ -825,17 +832,23 @@ cd .. if test -d %{buildroot}/%{_lib}/power6; then mkdir -p %{buildroot}/%{_lib}/power6x for i in %{buildroot}/%{_lib}/power6/*.so; do - b=`basename $i` - ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b - libbase=${b%.so} - libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so) - # Emulate ldconfig - ln -sf $libbaseso %{buildroot}/%{_lib}/power6x/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) + b=$(basename $i) + ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b done + cc-base/elf/ldconfig -vn %{buildroot}/%{_lib}/power6x fi %endif %endif # optimize_power +%ifarch i686 x86_64 +cd cc-noelision +destdir=$RPM_BUILD_ROOT/%{_lib}/noelision +mkdir -p $destdir +install -m 755 nptl/libpthread.so $destdir/libpthread-%{glibc_major_version}.so +cd .. +cc-base/elf/ldconfig -vn $destdir +%endif + # Install locales %if %{build_locales} # XXX Do not install locales in parallel! @@ -1184,6 +1197,9 @@ exit 0 %{optimized_libs ppc-cell-be} %endif %endif # optimize_power +%ifarch i686 x86_64 +/%{_lib}/noelision +%endif %dir %attr(0700,root,root) /var/cache/ldconfig /sbin/ldconfig %{_bindir}/gencat @@ -1204,10 +1220,7 @@ exit 0 %ifarch i586 %files obsolete %defattr (755,root,root,755) -%dir /%{_lib}/obsolete/ - %dir /%{_lib}/obsolete/noversion - /%{_lib}/obsolete/noversion/libNoVersion-%{glibc_major_version}.so - /%{_lib}/obsolete/noversion/libNoVersion.so.1 +/%{_lib}/obsolete %endif %files locale -f libc.lang diff --git a/glibc.changes b/glibc.changes index d14dedd1..891e9f3 100644 --- a/glibc.changes +++ b/glibc.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu May 15 15:45:03 UTC 2014 - schwab@suse.de + +- add non-elision-enabled libpthread + ------------------------------------------------------------------- Mon May 12 13:22:40 UTC 2014 - schwab@suse.de diff --git a/glibc.spec b/glibc.spec index 4bc0abc..f17140d 100644 --- a/glibc.spec +++ b/glibc.spec @@ -626,17 +626,21 @@ configure_and_build_glibc() { profile="--enable-profile" fi %endif - CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ - CC="$BuildCC" CXX="$BuildCCplus" ../configure \ + elision=--enable-lock-elision + if [ "$dirname" = "noelision" ]; then + elision=--disable-lock-elision + fi + ../configure \ + CFLAGS="$conf_cflags" BUILD_CFLAGS="$conf_cflags" \ + CC="$BuildCC" CXX="$BuildCCplus" \ --prefix=%{_prefix} \ --libexecdir=%{_libexecdir} --infodir=%{_infodir} \ --enable-add-ons=nptl$addons \ - $profile \ + $profile $elision \ "$@" \ %if %{enable_stackguard_randomization} --enable-stackguard-randomization \ %endif - --enable-lock-elision \ --build=%{target} --host=%{target} \ %ifarch armv7hl ppc ppc64 ppc64le %{ix86} x86_64 sparc sparc64 s390 s390x --enable-multi-arch \ @@ -698,6 +702,10 @@ configure_and_build_glibc() { %endif %endif # optimize_power +%ifarch i686 x86_64 +configure_and_build_glibc noelision "$BuildFlags" "$add_ons" +%endif + # # Build html documentation # @@ -799,10 +807,9 @@ do else cp -a ${lib}.so $destdir/$libbaseso fi - # Emulate ldconfig - ln -sf $libbaseso $destdir/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) done cd .. +cc-base/elf/ldconfig -vn $destdir } # Install power-optimized glibc @@ -817,7 +824,7 @@ cd .. install_optimized_variant power7 power7 ".." %endif %if %{powerpc_optimize_cpu_cell} - install_optimized_variant ppc-cell-be ppc-cell-be ".." + install_optimized_variant ppc-cell-be ppc-cell-be ".." %endif %if %{powerpc_optimize_cpu_power6} # power6 is compatible with power6x @@ -825,17 +832,23 @@ cd .. if test -d %{buildroot}/%{_lib}/power6; then mkdir -p %{buildroot}/%{_lib}/power6x for i in %{buildroot}/%{_lib}/power6/*.so; do - b=`basename $i` - ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b - libbase=${b%.so} - libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so) - # Emulate ldconfig - ln -sf $libbaseso %{buildroot}/%{_lib}/power6x/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*) + b=$(basename $i) + ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b done + cc-base/elf/ldconfig -vn %{buildroot}/%{_lib}/power6x fi %endif %endif # optimize_power +%ifarch i686 x86_64 +cd cc-noelision +destdir=$RPM_BUILD_ROOT/%{_lib}/noelision +mkdir -p $destdir +install -m 755 nptl/libpthread.so $destdir/libpthread-%{glibc_major_version}.so +cd .. +cc-base/elf/ldconfig -vn $destdir +%endif + # Install locales %if %{build_locales} # XXX Do not install locales in parallel! @@ -1184,6 +1197,9 @@ exit 0 %{optimized_libs ppc-cell-be} %endif %endif # optimize_power +%ifarch i686 x86_64 +/%{_lib}/noelision +%endif %dir %attr(0700,root,root) /var/cache/ldconfig /sbin/ldconfig %{_bindir}/gencat @@ -1204,10 +1220,7 @@ exit 0 %ifarch i586 %files obsolete %defattr (755,root,root,755) -%dir /%{_lib}/obsolete/ - %dir /%{_lib}/obsolete/noversion - /%{_lib}/obsolete/noversion/libNoVersion-%{glibc_major_version}.so - /%{_lib}/obsolete/noversion/libNoVersion.so.1 +/%{_lib}/obsolete %endif %files locale -f libc.lang