From 5df18866966176471d641eb7aa13c112db4e7853 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 23:07:56 +0100 Subject: [PATCH] x86: rebuilt with gcc with cet support to fix 'ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0' [release 2.30-5mamba;Thu Dec 05 2019] --- README.md | 1 - glibc.spec | 533 +++++++++++++++++++++++------------------------------ 2 files changed, 229 insertions(+), 305 deletions(-) diff --git a/README.md b/README.md index baee504..82cf52c 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,3 @@ In order to save disk space and memory, as well as to make upgrading easier, com 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. The glibc package also contains national language (locale) support. - diff --git a/glibc.spec b/glibc.spec index e4af11c..7b4ad71 100644 --- a/glibc.spec +++ b/glibc.spec @@ -8,19 +8,13 @@ # example: build a arm cross-platform glibc package with soft floating point support: #rpmbuild -ba --define='cross_target_cpu arm' --define='softfloat 1' glibc.spec -%define glibc_headers_dir %{_builddir}/%{name}-%{version}/linux-headers/include %define majver %(echo %version | cut -d. -f1-2) #%define minver %(echo %version | cut -d. -f3) -%define enablekernel 2.6.16 %if "%{?build_doc}" == "" %define build_doc 1 %endif -%if "%{?build_profile}" == "" -%define build_profile 1 -%endif - %if "%{?build_selinux}" == "" %define build_selinux 1 %endif @@ -39,7 +33,6 @@ %if "%{stage1}" == "1" %define bootstrap_append -stage1 %define build_doc 0 -%define build_profile 0 %define build_selinux 0 %endif @@ -47,17 +40,11 @@ %if "%{stage2}" == "1" %define bootstrap_append -stage2 %define build_doc 0 -%define build_profile 0 %define build_selinux 0 %endif %define target_cpu %(echo %{_target_platform} | cut -d- -f1) -%if "%{multilib}" == "1" - %define _host %{_build} - %define _target_platform %{_build} -%endif - %if "%{_target_platform}" != "%{_host}" %define _as %{_target_platform}-as %define _ld %{_target_platform}-ld @@ -71,7 +58,6 @@ %else %define _as as %define _ld ld -%if "%{multilib}" != "1" %define glibc_prefix %{_prefix} %define glibc_libdir %{_libdir} %define glibc_datadir %{_datadir} @@ -79,22 +65,12 @@ %define glibc_includedir %{_includedir} %define glibc_target_cpu %{_target_cpu} %define slibdir /%{_lib} -%else - %define glibc_prefix /usr - %define glibc_libdir /usr/lib - %define glibc_datadir %{_datadir} - %define glibc_libexecdir /usr/libexec - %define glibc_includedir /usr/include - %define slibdir /lib - %define glibc_target_cpu %{_build_cpu} -%endif %endif %define buildcc %{_target_platform}-gcc %define buildcxx %{_target_platform}-g++ %if "%{_target_platform}" != "%{_build}" %define build_doc 0 -%define build_profile 0 %define build_selinux 0 %endif @@ -108,7 +84,7 @@ Name: glibc Version: 2.30 -Release: 2mamba +Release: 5mamba Summary: The GNU libc libraries Group: System/Libraries Vendor: openmamba @@ -116,14 +92,6 @@ Distribution: openmamba Packager: Silvan Calarco URL: http://www.gnu.org/software/libc/ Source0: http://ftp.gnu.org/gnu/glibc/glibc-%{version}.tar.xz -## glibc-ports got from head (release/2.12/master) here: -## http://sourceware.org/git/?p=glibc-ports.git -#Source1: http://ftp.gnu.org/gnu/glibc/glibc-ports-%{version}.tar.xz -#Source0: ftp://sources.redhat.com/pub/glibc/snapshots/glibc-%{majver}-%{minver}.tar.bz2 -#Source1: ftp://sources.redhat.com/pub/glibc/snapshots/glibc-%{majver}-ports-latest.tar.bz2 -#Source1: ftp://sources.redhat.com/pub/glibc/snapshots/glibc-%{majver}-ports-%{minver}.tar.bz2 -#Source3: http://ftp.gnu.org/gnu/glibc/glibc-libidn-%{version}.tar.bz2 -#Source3: ftp://sources.redhat.com/pub/glibc/snapshots/glibc-%{majver}-libidn-%{minver}.tar.bz2 Source4: nscd-logrotate Source5: nscd-conf Source6: nscd-initscript @@ -148,6 +116,7 @@ Patch17: glibc-2.21-prevent-ehaustion-of-tls-slots.patch Patch18: glibc-2.25-resolv-no-compat.patch License: LGPL ## AUTOBUILDREQ-BEGIN +BuildRequires: libaudit-devel BuildRequires: libcap-devel BuildRequires: libgd-devel BuildRequires: libpng-devel @@ -174,12 +143,15 @@ BuildRequires: libselinux-devel >= 1.22 BuildRequires: libcap-devel %endif BuildRequires: kernelsanitisedheaders -Provides: glibc-multilib -Obsoletes: glibc-multilib Requires: ldconfig = %{?epoch:%epoch:}%{version}-%{release} Requires: locales = %{?epoch:%epoch:}%{version}-%{release} Requires: glibc-utils = %{?epoch:%epoch:}%{version}-%{release} %systemd_requires +%ifarch x86_64 +Provides: glibc-multilib +Obsoletes: glibc-multilib +Obsoletes: glibc.i586 +%endif Prefix: %{_prefix} BuildRoot: %{_tmppath}/%{name}-%{version}-root @@ -194,31 +166,17 @@ In order to save disk space and memory, as well as to make upgrading easier, com 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. The glibc package also contains national language (locale) support. - -%if "%{multilib}" -%package multilib -Summary: The GNU libc libraries (multilib) -Group: System/Libraries -Requires(post):%{__install_info} - -%description multilib -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. -The glibc package also contains national language (locale) support. -%endif - -%package %{?multilib:multilib-}devel +%package devel Summary: Header and object files for development using standard C libraries. Group: Development/Libraries -Requires: %{name}%{?multilib:-multilib} = %{?epoch:%epoch:}%{version}-%{release} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Prereq: %{__install_info} -%if "%{multilib}" == "1" -# non-multilib glibc-devel required for /usr/include headers -Requires: glibc-devel +%ifarch x86_64 +Provides: glibc-multilib-devel +Obsoletes: glibc-multilib-devel %endif -%description %{?multilib:multilib-}devel +%description devel The glibc-devel package contains the header and 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 header and object files available in order to create the executables. @@ -228,85 +186,81 @@ The header files are also needed for rebuilding the kernel. Install glibc-devel if you are going to develop programs which will use the standard C libraries. -%if "%{build_profile}" == "1" -%package %{?multilib:multilib-}profile -Summary: The GNU libc libraries, including support for gprof profiling -Group: Development/Libraries -Requires: %{name}%{?multilib:-multilib} = %{?epoch:%epoch:}%{version}-%{release} - -%description %{?multilib:multilib-}profile -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. -The glibc package also contains national language (locale) support. - -If you are going to use the gprof program to profile a program, you'll need to install the glibc-profile program. -%endif - %if %{build_doc} -%package %{?multilib:multilib-}apidocs +%package apidocs Summary: GNU libc libraries API documentation Group: Documentation -Requires: glibc-%{?multilib:multilib-}devel = %{?epoch:%epoch:}%{version}-%{release} +Requires: glibc-devel = %{?epoch:%epoch:}%{version}-%{release} +%ifarch x86_64 +Provides: glibc-multilib-apidocs +Obsoletes: glibc-multilib-apidocs +%endif -%description %{?multilib:multilib-}apidocs +%description apidocs GNU libc libraries API documentation. %endif -%package %{?multilib:multilib-}i18ndata +%package i18ndata Summary: Database sources for 'locale' Group: System/Libraries -Requires(pre): %{name}%{?multilib:-multilib} = %{?epoch:%epoch:}%{version}-%{release} +Requires(pre): %{name} = %{?epoch:%epoch:}%{version}-%{release} +%ifarch x86_64 +Provides: glibc-multilib-i18ndata +Obsoletes: glibc-multilib-i18ndata +%endif -%description %{?multilib:multilib-}i18ndata +%description i18ndata This package contains the data needed to build the locale data files to use the internationalization features of the GNU libc. -%package %{?multilib:multilib-}utils +%package utils Summary: Development utilities from GNU C library Group: Development/Tools -Requires: %{name}%{?multilib:-multilib} = %{?epoch:%epoch:}%{version}-%{release} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} +%ifarch x86_64 +Provides: glibc-multilib-utils +Obsoletes: glibc-multilib-utils +%endif -%description %{?multilib:multilib-}utils +%description utils The glibc-utils package contains memusage, a memory usage profiler, mtrace, a memory leak tracer and, a function call tracer which can be helpful during program debugging. -%package -n ldconfig%{?multilib:-multilib} +%package -n ldconfig Summary: Configure dynamic linker run time bindings Group: System/Tools # The dynamic linker supports DT_GNU_HASH Provides: rtld(GNU_HASH) Provides: rtld(GNU_UNIQUE) -%description -n ldconfig%{?multilib:-multilib} +%description -n ldconfig ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and file names of the libraries it encounters when determining which versions should have their links updated. -%package -n timezone%{?multilib:-multilib} +%package -n timezone Summary: Time zone descriptions Group: System/Internationalization Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} Requires(post):tzdata -%description -n timezone%{?multilib:-multilib} +%description -n timezone These are configuration files that describe possible time zones. -%package -n locales%{?multilib:-multilib} +%package -n locales Summary: Base files for localization Group: System/Internationalization Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} -%description -n locales%{?multilib:-multilib} +%description -n locales These are the base files for language localization. You also need to install the specific locales-?? for the language(s) you want. Then the user need to set the LANG variable to their preferred language in their ~/.profile configuration file. -%package -n nscd%{?multilib:-multilib} +%package -n nscd Summary: Name service cache daemon Group: System/Servers Requires: logrotate >= 3.6.8 -%description -n nscd%{?multilib:-multilib} +%description -n nscd Nscd is a daemon that provides a cache for the most common name service requests. %package -n cross-%{_target_platform}-%{name}%{?bootstrap_append}%{?bigendian_append}%{?softfloat_append} @@ -327,10 +281,8 @@ Obsoletes: cross-%{_target_platform}-%{name}-stage1%{?bigendian_append}%{?softfl Cross Platform glibc for %{_target_platform}. %if "%{_target_platform}" == "%{_host}" -%if "%{multilib}" != "1" %debug_package %endif -%endif %prep %setup -q @@ -341,14 +293,6 @@ Cross Platform glibc for %{_target_platform}. %patch17 -p1 #%patch18 -p1 -#cd glibc-ports-%{version} -#%patch15 -p2 -#cd .. -#%patch16 -p1 - -## FIX build with make 3.82 (see http://comments.gmane.org/gmane.linux.lfs.support/31227) -#sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile - %if "%{?stage2}" # link glibc without libgcc_eh, not available in stage1 cross compiler # this is the reason why also a glibc rebuild is needed later @@ -386,187 +330,159 @@ case %{target_cpu} in i*86|athlon*) platform_includes=asm-x86 buildflags="-mtune=pentiumpro -g -O3" -%if "%{cross_target_cpu}" != "" - buildflags="-mtune=pentiumpro -g -O3 -Wno-error=maybe-uninitialized" -%endif + CONFIG_OPTS="--enable-targets=i586-%{_target_vendor}-linux --enable-cet" ;; ppc|powerpc) platform_includes=asm-powerpc buildflags="-g -O3" + CONFIG_OPTS="--enable-targets=powerpc64-%{_target_vendor}-linux" ;; arm) platform_includes=asm-arm - #abi=%{_target_platform} - #abi=`echo ${abi/*-}` - #if [ "$abi" = "gnueabihf" ]; then - # buildflags="-g -O3 -fgnu89-inline -mfloat-abi=hard" - #else - buildflags="-g -O3" - #fi - ;; + buildflags="-g -O3" + %if "%{?softfloat}" == "1" + CONFIG_LIBDIR_ADD="/soft-float" + CONFIG_ADD="--without-fp" + CC_ADD="-msoft-float" + %endif + %if "%{?bigendian}" == "1" + CONFIG_LIBDIR_ADD="/be${CONFIG_LIBDIR_ADD}" + CC_ADD="-mbig-endian" + AS_ADD="-mbig-endian" + %endif + CONFIG_OPTS="" + ;; x86_64) platform_includes=asm-x86_64 buildflags="-g -O3" - ;; + CONFIG_OPTS="--enable-targets=x86_64-%{_target_vendor}-linux --enable-multi-arch --enable-static-pie --enable-cet" + ;; *) echo "Target CPU %{target_cpu} not supported. Aborting." exit 1 ;; esac -# prepare kernel headers for platform -mkdir -p %{glibc_headers_dir} +# set kernel headers for platform if [ -e /usr/src/linux-%{KERNEL_VERSION}%{KERNEL_TARGET}/usr/include/linux/version.h ]; then - cp -af /usr/src/linux-%{KERNEL_VERSION}%{KERNEL_TARGET}/usr/include/* %{glibc_headers_dir} + headers_dir=/usr/src/linux-%{KERNEL_VERSION}%{KERNEL_TARGET}/usr/include elif [ -e /usr/src/linux-%{KERNEL_TARGET}/usr/include/linux/version.h ]; then - cp -af /usr/src/linux-%{KERNEL_TARGET}/usr/include/* %{glibc_headers_dir} + headers_dir=/usr/src/linux-%{KERNEL_TARGET}/usr/include elif [ -e /usr/src/linux/usr/include/linux/version.h ]; then - cp -af /usr/src/linux/usr/include/* %{glibc_headers_dir} + headers_dir=/usr/src/linux/usr/include else echo "ERROR: can't find suitable kernel headers; aborting." exit 1 fi -function build_glibc() { - local builddir="$1"; shift - - case %{target_cpu} in - i*86|athlon*) - %if "%{?bigendian}" == "1" - echo "Error: bigendian build is not supported on i*86 architecture" - exit 1 - %endif - %if "%{?softfloat}" == "1" - echo "Error: softfloat build is not supported for i*86 architecture" - exit 1 - %endif - CONFIG_OPTS="--enable-targets=x86_64-%{_target_vendor}-linux" - ;; - ppc|powerpc) - %if "%{?bigendian}" == "1" - echo "Error: bigendian build is not supported on ppc architecture" - exit 1 - %endif - %if "%{?softfloat}" == "1" - echo "Error: softfloat build is not supported on ppc architecture" - exit 1 - %endif - CONFIG_OPTS="--enable-targets=powerpc64-%{_target_vendor}-linux" - ;; - arm) - %if "%{?softfloat}" == "1" - CONFIG_LIBDIR_ADD="/soft-float" - CONFIG_ADD="--without-fp" - CC_ADD="-msoft-float" - %else - CONFIG_OPTS="" - %endif - %if "%{?bigendian}" == "1" - CONFIG_LIBDIR_ADD="/be${CONFIG_LIBDIR_ADD}" - CC_ADD="-mbig-endian" - AS_ADD="-mbig-endian" - %endif -# PRECONFIG_OPTS="CC=\"arm-%{_target_vendor}-linux-gnu-gcc $CC_ADD -finline-limit=10000\" -# AS=\"arm-%{_target_vendor}-linux-gnu-as $AS_ADD\" -# LD=\"arm-%{_target_vendor}-linux-gnu-ld -EB\"" -# SLIBDIR=/usr/arm-%{_target_vendor}-linux-gnu/lib${CONFIG_LIBDIR_ADD} -# CONFIG_OPTS="$CONFIG_ADD --libdir=$SLIBDIR" - CONFIG_OPTS="" - ;; - x86_64) - %if "%{?bigendian}" == "1" - echo "Error: bigendian build is not supported on i*86 architecture" - exit 1 - %endif - %if "%{?softfloat}" == "1" - echo "Error: softfloat build is not supported for i*86 architecture" - exit 1 - %endif - CONFIG_OPTS="--enable-targets=i586-%{_target_vendor}-linux" - ;; - *) - echo "Target CPU %{target_cpu} not supported.Aborting." - exit 1 - ;; - esac - - rm -rf ../$builddir - mkdir ../$builddir - - ( cd ../$builddir - -# %if "%{?_target_platform}" != "%{_host}" -# echo "libc_cv_forced_unwind=yes" > config.cache -# echo "libc_cv_c_cleanup=yes" >> config.cache -# %endif - - %if "%{?stage2}" == "1" - # there is no --disable-ssp option - echo "libc_cv_ssp=no" > config.cache - %endif - - eval $PRECONFIG_OPTS ../%{name}-%{version}/configure \ - --prefix=%{glibc_prefix} \ - --infodir=%{_infodir} \ - --libexecdir=%{glibc_libexecdir} \ - --with-headers=%{glibc_headers_dir} $@\ - --enable-kernel=%{enablekernel} \ - --without-cvs \ - --enable-bind-now \ - --build=%{_build} \ - %if "%{?stage1}" != "1" - --host=%{_target_platform} \ - %endif - %if "%{?stage2}" - --cache-file=config.cache \ - %endif - $CONFIG_OPTS \ - PYTHON_PROG=%{__python36} \ - CFLAGS=\"$buildflags\ -Wl,--build-id\" - -# --with-binutils=%{_prefix}/bin \ -# CC=%{buildcc} \ -# CXX=%{buildcxx} \ -# %if "%{_target_platform}" != "%{_host}" -# --cache-file=config.cache \ -# %endif - - %if "%{?stage1}" != "1" - make %{_smp_mflags} -r %PARALLELMFLAGS=-s slibdir=%{slibdir} \ - %if "%{_target_platform}" != "%{_host}" - %if "%{?stage2}" != "1" - LDLIBS-resolv.so+="-lssp" LDFLAGS-nscd+="-lssp" - %endif - %endif - #CFLAGS="$buildflags" - %endif - ) -} - %if "%{?stage2}" - # hack, diable nptl for bootstrap gcc - opt_tls="--enable-add-ons --with-tls --disable-sanity-checks" +# hack, diable nptl for bootstrap gcc +opt_tls="--enable-add-ons --with-tls --disable-sanity-checks" %else - opt_tls="--enable-add-ons --with-tls" +opt_tls="--enable-add-ons --with-tls" %endif %if %{build_selinux} - opt_selinux="--with-selinux" +opt_selinux="--with-selinux" %else - opt_selinux="--without-selinux" +opt_selinux="--without-selinux" %endif -%if "%{build_profile}" == "1" - build_glibc glibc-build-profile --enable-profile $opt_tls $opt_selinux +%if "%{?stage2}" == "1" + # there is no --disable-ssp option + echo "libc_cv_ssp=no" > config.cache %endif -build_glibc glibc-build $opt_tls $opt_selinux +_configure_flags=( + --build=%{_build} \ +%if "%{?stage1}" != "1" + --host=%{_target_platform} \ +%endif +%if "%{?stage2}" + --cache-file=config.cache \ +%endif + --prefix=%{glibc_prefix} \ + --infodir=%{_infodir} \ + --libexecdir=%{glibc_libexecdir} \ + --with-headers=${headers_dir} \ + --with-bugurl=https://bugs.openmamba.org/ \ + ${opt_tls} ${opt_selinux} \ + --enable-lock-elision \ +%if "%{_target_platform}" == "%{_host}" + --enable-stack-protector=strong \ + --enable-stackguard-randomization \ +%endif + --enable-bind-now \ + --disable-profile \ + --disable-werror \ + PYTHON_PROG=%{__python3} \ + $CONFIG_OPTS +) + +#:<< __EOF +# Build +rm -rf ../glibc-build +mkdir ../glibc-build +cd ../glibc-build + +#CFLAGS="$buildflags -Wl,--build-id" + +../%{name}-%{version}/configure \ + ${_configure_flags[@]} + +%if "%{?stage1}" != "1" +make %{_smp_mflags} -r %PARALLELMFLAGS=-s slibdir=%{slibdir} \ +%if "%{_target_platform}" != "%{_host}" +%if "%{?stage2}" != "1" + LDLIBS-resolv.so+="-lssp" LDFLAGS-nscd+="-lssp" +%else + CXX= +%endif +%endif # build documentation (pdf and html formats) %if %{build_doc} - make pdf html -C ../glibc-build +make pdf html %endif + +%endif + +#__EOF + +%if "%{_target_platform}" == "%{_host}" +%ifarch x86_64 +%if "%{?stage1}" != "1" +%if "%{?stage2}" != "1" +# Multilib +rm -rf ../glibc-multilib-build +mkdir ../glibc-multilib-build +cd ../glibc-multilib-build + +export CC="gcc -m32 -mstackrealign" +export CXX="g++ -m32 -mstackrealign" + +CFLAGS="-mtune=pentiumpro -g -O3 -Wl,--build-id" + +../%{name}-%{version}/configure \ + ${_configure_flags[@]} \ + --host=i586-openmamba-linux-gnu \ + --libdir=/usr/lib32 \ + --libexecdir=/usr/lib32 \ + --without-selinux + +# Disable building programs +echo "build-programs=no" >> configparms +echo "slibdir=/usr/lib32" >> configparms +echo "rtlddir=/usr/lib32" >> configparms + +make %{_smp_mflags} -r %PARALLELMFLAGS=-s + +%endif +%endif +%endif +%endif + #___EOF %install @@ -579,10 +495,19 @@ cat > %{buildroot}%{_sysconfdir}/ld.so.conf << _EOF include %{_sysconfdir}/ld.so.conf.d/*.conf _EOF -%if "%{build_profile}" == "1" - make install -C ../glibc-build-profile install_root=%{buildroot} +%if "%{_target_platform}" == "%{_host}" +# Multilib +%ifarch x86_64 +make install -C ../glibc-multilib-build install_root=%{buildroot} +cat > %{buildroot}%{_sysconfdir}/ld.so.conf.d/lib32-glibc.conf << _EOF +/usr/lib32 +_EOF +# Symlink /usr/lib32/locale to /usr/lib/locale +ln -s ../lib/locale %{buildroot}/usr/lib32/locale %endif - make install -C ../glibc-build install_root=%{buildroot} +%endif + +make install -C ../glibc-build install_root=%{buildroot} # install openmamba default supported locales mv localedata/SUPPORTED localedata/SUPPORTED.orig @@ -612,8 +537,18 @@ _EOF rm -f %{buildroot}%{_sysconfdir}/localtime # install kernel headers -install -d %{buildroot}%{glibc_includedir} -cp -avrf %{glibc_headers_dir}/* %{buildroot}%{glibc_includedir} +if [ -e /usr/src/linux-%{KERNEL_VERSION}%{KERNEL_TARGET}/usr/include/linux/version.h ]; then + headers_dir=/usr/src/linux-%{KERNEL_VERSION}%{KERNEL_TARGET}/usr/include +elif [ -e /usr/src/linux-%{KERNEL_TARGET}/usr/include/linux/version.h ]; then + headers_dir=/usr/src/linux-%{KERNEL_TARGET}/usr/include +elif [ -e /usr/src/linux/usr/include/linux/version.h ]; then + headers_dir=/usr/src/linux/usr/include +else + echo "ERROR: can't find suitable kernel headers; aborting." + exit 1 +fi + +cp -avrf ${headers_dir}/* %{buildroot}%{glibc_includedir} %if "%{_target_platform}" == "%{_host}" # install/create nscd service dirs and configuration files @@ -635,24 +570,6 @@ rm -f %{buildroot}%{_prefix}/%{_target_platform}/%{_sysconfdir}/ld.so.cache #chmod -x %{buildroot}/%{glibc_libdir}/libthread_db-1.0.so #%endif -%if "%{multilib}" == "1" -cp %{buildroot}%{glibc_includedir}/gnu/stubs-32.h %{buildroot}/ -rm -rf %{buildroot}%{glibc_includedir} -install -d -m0755 %{buildroot}%{glibc_includedir}/gnu/ -mv %{buildroot}/stubs-32.h %{buildroot}%{glibc_includedir}/gnu/stubs-32.h -# multilib: remove unuseful files depending on other 32bit libraries -rm -f %{buildroot}%{_bindir}/memusagestat -rm -f %{buildroot}%{_bindir}/makedb -rm -f %{buildroot}%{_sbindir}/nscd -%endif - -# install rpc headers removed since glibc 2.14 but required by e.g. samba and libtirpc -#install -d -m0755 %{buildroot}%{glibc_includedir}/rpc -#cp -v ../glibc-%{version}/sunrpc/rpc/*.h %{buildroot}%{glibc_includedir}/rpc/ -#install -d -m0755 %{buildroot}%{glibc_includedir}/rpcsvc -#cp -v ../glibc-%{version}/sunrpc/rpcsvc/*.h %{buildroot}%{glibc_includedir}/rpcsvc/ -#cp -v ../glibc-%{version}/nis/rpcsvc/*.h %{buildroot}%{glibc_includedir}/rpcsvc/ - rm -f %{buildroot}%{_libdir}/libnsl.* %if "%{_target_platform}" == "%{_host}" @@ -697,10 +614,10 @@ rm -rf %{buildroot}%{glibc_datadir}/zoneinfo #fi #exit 0 -%post %{?multilib:multilib} -p /sbin/ldconfig -%postun %{?multilib:multilib} -p /sbin/ldconfig +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig -%pre %{?multilib:multilib-}devel +%pre devel [ -L %{_includedir}/asm ] && rm -f %{_includedir}/asm # Remove old directory asm- @@ -726,15 +643,15 @@ fi exit 0 -%post %{?multilib:multilib-}devel +%post devel %install_info libc.info : -%postun %{?multilib:multilib-}devel +%postun devel %uninstall_info libc.info : -%posttrans %{?multilib:multilib-}i18ndata +%posttrans i18ndata # update locale-archive for current language settings LOCALES=(`grep ${LANG:0:5} %{glibc_datadir}/i18n/locales/SUPPORTED | awk '{ print $1 }'`); for l in ${LOCALES[*]}; do @@ -745,7 +662,7 @@ for l in ${LOCALES[*]}; do done : -%pre -n nscd%{?multilib:-multilib} +%pre -n nscd if [ $1 -ge 1 ]; then /usr/sbin/groupadd -g 65001 nscd &>/dev/null || true /usr/sbin/useradd -u 65001 -g nscd -d /dev/null nscd -s /bin/false &>/dev/null || true @@ -753,23 +670,23 @@ fi %systemd_pre nscd : -%post -n nscd%{?multilib:-multilib} +%post -n nscd %systemd_post nscd : -%preun -n nscd%{?multilib:-multilib} +%preun -n nscd %systemd_preun nscd if [ $1 -eq 0 ]; then /usr/sbin/userdel nscd fi : -%postun -n nscd%{?multilib:-multilib} +%postun -n nscd %systemd_postun_with_restart nscd : %if "%{_target_platform}" == "%{_host}" -%files %{?multilib:multilib} +%files %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/rpc /%{slibdir}/* @@ -787,28 +704,24 @@ fi %{glibc_libexecdir}/getconf/XBS5_ILP32_OFFBIG %endif %ifarch x86_64 -%if "%{multilib}" != "1" %{glibc_libexecdir}/getconf/POSIX_V6_LP64_OFF64 %{glibc_libexecdir}/getconf/POSIX_V7_LP64_OFF64 %{glibc_libexecdir}/getconf/XBS5_LP64_OFF64 -%else -%{glibc_libexecdir}/getconf/POSIX_V6_ILP32_OFF32 -%{glibc_libexecdir}/getconf/POSIX_V6_ILP32_OFFBIG* -%{glibc_libexecdir}/getconf/POSIX_V7_ILP32_OFF32 -%{glibc_libexecdir}/getconf/POSIX_V7_ILP32_OFFBIG* -%{glibc_libexecdir}/getconf/XBS5_ILP32_OFF32 -%{glibc_libexecdir}/getconf/XBS5_ILP32_OFFBIG* -%endif +# Multilib +%{_sysconfdir}/ld.so.conf.d/lib32-glibc.conf +%{_prefix}/lib32/lib*-%{version}.so +%{_prefix}/lib32/lib*.so.* +%dir %{_prefix}/lib32/audit +%{_prefix}/lib32/audit/sotruss-lib.so +%{_prefix}/lib32/ld-%{version}.so +%{_prefix}/lib32/ld-linux.so.* +%dir %{_prefix}/lib32/gconv +%{_prefix}/lib32/gconv/* +%{_prefix}/lib32/locale %endif %doc COPYING* LICENSES -%if "%{build_profile}" == "1" -%files %{?multilib:multilib-}profile -%defattr(-,root,root) -%{glibc_libdir}/lib*_p.a -%endif - -%files %{?multilib:multilib-}devel +%files devel %defattr(-,root,root) %{glibc_includedir}/* %{glibc_libdir}/*.o @@ -817,24 +730,32 @@ fi %if "%{build_profile}" == "1" %exclude %{glibc_libdir}/lib*_p.a %endif +%ifarch x86_64 +# Multilib +%{_prefix}/lib32/*.o +%{_prefix}/lib32/lib*.a +%{_prefix}/lib32/lib*.so +%exclude %{_prefix}/lib32/lib*-%{version}.so +%endif + %{_infodir}/* %{_localstatedir}/db/Makefile %doc ChangeLog %doc NEWS README* %if %{build_doc} -%files %{?multilib:multilib-}apidocs +%files apidocs %defattr(-,root,root) %dir %{_docdir}/libc/ %{_docdir}/libc/* %endif -%files %{?multilib:multilib-}i18ndata +%files i18ndata %defattr(-,root,root) %dir %{glibc_datadir}/i18n %{glibc_datadir}/i18n/* -%files %{?multilib:multilib-}utils +%files utils %defattr(-,root,root) %{_sbindir}/iconvconfig %{_bindir}/catchsegv @@ -859,20 +780,15 @@ fi %{_bindir}/xtrace %if "%{glibc_target_cpu}" == "%{_build_cpu}" %{_bindir}/memusage -%if "%{multilib}" == "1" -%{_bindir}/lddlibc4 -%endif -%if "%{multilib}" != "1" %{_bindir}/memusagestat %{_bindir}/makedb %endif -%endif %{glibc_libdir}/audit/sotruss-lib.so #%{glibc_libexecdir}/pt_chown %{slibdir}/libmemusage.so %{slibdir}/libpcprofile.so -%files -n ldconfig%{?multilib:-multilib} +%files -n ldconfig %defattr(-,root,root) /sbin/ldconfig %config(noreplace) %{_sysconfdir}/ld.so.conf @@ -881,7 +797,7 @@ fi #%config(noreplace) %{_sysconfdir}/ld.so.cache #%endif -%files -n locales%{?multilib:-multilib} -f libc.lang +%files -n locales -f libc.lang %defattr(-,root,root) %{glibc_datadir}/locale/locale.alias %ifnarch x86_64 @@ -891,17 +807,15 @@ fi %{_prefix}/lib/locale/locale-archive %endif -%files -n nscd%{?multilib:-multilib} +%files -n nscd %defattr(-,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/nscd %config(noreplace) %{_sysconfdir}/nscd.conf %{_unitdir}/nscd.service -%if "%{multilib}" != "1" %{_sbindir}/nscd -%endif %attr(0755,nscd,nscd) /var/log/nscd -%files -n timezone%{?multilib:-multilib} +%files -n timezone %defattr(-,root,root) %{_sbindir}/zdump %{_sbindir}/zic @@ -922,6 +836,17 @@ fi %endif %changelog +* Thu Dec 05 2019 Silvan Calarco 2.30-5mamba +- x86: rebuilt with gcc with cet support to fix 'ld-linux.so.2: corrupt GNU_PROPERTY_TYPE (5) size: 0' + +* Sat Nov 23 2019 Silvan Calarco 2.30-4mamba +- x86_64: build 32 bit multilib library in unique build + +* Fri Nov 22 2019 Silvan Calarco 2.30-3mamba +- specfile simplification +- removed profile static target support +- added --enable-cet --enable-lock-elision --enable-stack-protector=strong --enable-stackguard-randomization + * Sat Oct 26 2019 Silvan Calarco 2.30-2mamba - remove workaround to not strip libthread_db.so to fix provides (check later if debugging works)