OSDN Git Service

glibc v1
authorHe Chenlan <210hcl@gmail.com>
Thu, 28 Jan 2021 13:31:57 +0000 (21:31 +0800)
committerHe Chenlan <210hcl@gmail.com>
Thu, 28 Jan 2021 13:31:57 +0000 (21:31 +0800)
glibc.spec [new file with mode: 0644]

diff --git a/glibc.spec b/glibc.spec
new file mode 100644 (file)
index 0000000..18f5e62
--- /dev/null
@@ -0,0 +1,134 @@
+%bcond_with    fast_build
+%define flavor %{nil}
+%bcond_with build_all
+%define build_main 1
+%define build_utils %{with build_all}
+%define build_testsuite %{with build_all}
+%if "%flavor" == "utils"
+%if %{with ringdisabled}
+ExclusiveArch:  do_not_build
+%endif
+%define build_main 0
+%define build_utils 1
+%define build_testsuite 0
+%endif
+%if "%flavor" == "testsuite"
+%if %{with ringdisabled}
+ExclusiveArch:  do_not_build
+%endif
+%define build_main 0
+%define build_utils 0
+%define build_testsuite 1
+%endif
+%if %{build_main}
+%define name_suffix %{nil}
+%else
+%define name_suffix -%{flavor}-src
+%endif
+Name:           glibc%{name_suffix}
+Summary:        Standard Shared Libraries (from the GNU C Library)
+License:        LGPL-2.1+ AND LGPL-2.1+ with GCC-exception-2.0 AND GPL-2.0+
+Group:          System/Libraries
+
+%define enablekernel 3.2
+
+Version:        2.32
+Release:        1
+URL:            https://www.gnu.org/software/libc/
+Source:         https://mirrors.ustc.edu.cn/gnu/glibc/glibc-%{version}.tar.xz
+Source1:        https://mirrors.ustc.edu.cn/gnu/glibc/glibc-%{version}.tar.xz.sig
+
+%if %{with fast_build} || %{build_utils} && %{without build_all}
+%define build_profile 0
+%define build_locales 0
+%define build_html 0
+%else
+# Default:
+%define build_profile 1
+%define build_locales 1
+%define build_html 1
+%endif
+%if %{build_utils}
+Requires:       glibc = %{version}
+%endif
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+
+##Default not enable libselinux
+%description
+The GNU C Library provides the most important standard libraries used
+by nearly all programs: the standard C library, the standard math
+library, and the POSIX thread library. A system is not functional
+without these libraries.
+
+%prep
+%setup
+# If build in OpenSUSE
+## export SUSE_ASNEEDED=0
+chmod +x benchtests/scripts/*.py scripts/pylint
+find . -name configure | xargs touch
+
+%build
+if [ -x /bin/uname.bin ]; then
+       /bin/uname.bin -a
+else
+       uname -a
+fi
+uptime || :
+ulimit -a
+nice
+GCC=gcc
+GXX=g++
+%define target %{_target_cpu}-essential-linux
+echo "#define CONFHOST \"%{target}\"" >> version.h
+EnableKernel="--enable-kernel=%{enablekernel}"
+rm -rf build
+mkdir build
+pushd build
+
+../configure CC="$GCC" CXX="$GXX"   \
+--prefix=%{_prefix} \
+--with-headers=%{_prefix}/include \
+$EnableKernel \
+--build=%{target} --host=%{target} \
+--enable-bind-now \
+--enable-tunables \
+--enable-systemtap \
+--enable-stackguard-randomization \
+%ifarch x86_64
+--enable-static-pie \
+--enable-cet \
+## --enable-multi-arch \
+%endif
+--disable-werror \
+--disable-profile \
+--disable-timezone-tools \
+--disable-selinux \
+--disable-crypt
+
+make %{?_smp_mflags}
+
+%check
+export TIMEOUTFACTOR=16
+# The testsuite does its own malloc checking
+unset MALLOC_CHECK_
+make %{?_smp_mflags} check || {
+  cd build
+  o=$-
+  set +x
+  for sum in subdir-tests.sum */subdir-tests.sum; do
+    while read s t; do
+      case $s in
+       XPASS:|PASS:)
+         echo ++++++ $s $t ++++++
+         ;;
+       *) # X?FAIL:
+         echo ------ $s $t ------
+         test ! -f $t.out || cat $t.out
+         ;;
+       esac
+    done < $sum
+  done
+  set -$o
+  # Fail build if there where compilation errors during testsuite run
+  test -f tests.sum
+}