#
# Conditional build:
%bcond_without shared # don't build shared lib support
-%bcond_with verbose # verbose mode
+%bcond_with nptl # libpthread: NPTL instead of LinuxThreads (experimental; no i386)
+%bcond_without verbose # verbose mode
#
%ifarch alpha
%undefine with_shared
Summary: C library optimized for size
Summary(pl.UTF-8): Biblioteka C zoptymalizowana na rozmiar
Name: uClibc
-Version: 0.9.30.3
-Release: 2
-Epoch: 3
+Version: 0.9.33.2
+Release: 34
+Epoch: 4
License: LGPL v2.1
Group: Libraries
-Source0: http://uclibc.org/downloads/%{name}-%{version}.tar.bz2
-# Source0-md5: 73a4bf4a0fa508b01a7a3143574e3d21
+Source0: http://uclibc.org/downloads/%{name}-%{version}.tar.xz
+# Source0-md5: 73e6fe215648d02246f4d195b25fb17e
Patch0: %{name}-newsoname.patch
Patch1: %{name}-toolchain-wrapper.patch
Patch2: %{name}-targetcpu.patch
Patch3: %{name}-debug.patch
Patch4: %{name}-stdio-unhide.patch
-Patch5: %{name}-inotify_init1.patch
-Patch6: %{name}-sockflags.patch
+Patch5: %{name}-kernel-types.patch
+Patch6: %{name}-features.patch
URL: http://uclibc.org/
-BuildRequires: binutils-gasp
+BuildRequires: binutils >= 2.16
BuildRequires: cpp
+%if %{with nptl}
+BuildRequires: gcc >= 5:4.1
+%else
BuildRequires: gcc >= 5:3.0
-BuildRequires: linux-libc-headers >= 7:2.6.24
+%endif
+BuildRequires: linux-libc-headers >= 7:2.6.27
+BuildRequires: make >= 3.80
BuildRequires: ncurses-devel
BuildRequires: rpmbuild(macros) >= 1.453
BuildRequires: sed >= 4.0
+BuildRequires: tar >= 1:1.22
BuildRequires: which
+BuildRequires: xz
+%{?with_nptl:Requires: uname(version) >= 2.6}
+# only these supported by this .spec; uClibc code supports some more
ExclusiveArch: alpha %{ix86} ppc sparc sparcv9 %{x8664}
+%{?with_nptl:ExcludeArch: i386}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%if "%{cc_version}" >= "4.2"
%define specflags -fgnu89-inline
%endif
+%define filterout -fstack-protector -fstack-protector-strong --param=ssp-buffer-size=4
+
%define uclibc_root /usr/%{_target_cpu}-linux-uclibc
%description
Summary(pl.UTF-8): Pliki dla programistów uClibc
Group: Development/Libraries
Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires: binutils-gasp
-Requires: linux-libc-headers >= 7:2.6.24
+Requires: linux-libc-headers >= 7:2.6.27
%requires_eq gcc
%description devel
# ARCH is already determined by uname -m
%ifarch %{ix86}
-defconfig=extra/Configs/defconfigs/i386
+defconfig=extra/Configs/defconfigs/i386/defconfig
%ifarch i386
echo 'CONFIG_386=y' >> $defconfig
%endif
%endif
%endif
%ifarch %{x8664}
-defconfig=extra/Configs/defconfigs/x86_64
+defconfig=extra/Configs/defconfigs/x86_64/defconfig
%endif
%ifarch alpha
-defconfig=extra/Configs/defconfigs/alpha
+defconfig=extra/Configs/defconfigs/alpha/defconfig
%endif
%ifarch sparc sparcv9
-defconfig=extra/Configs/defconfigs/sparc
+defconfig=extra/Configs/defconfigs/sparc/defconfig
%endif
%ifarch ppc
-defconfig=extra/Configs/defconfigs/powerpc
+defconfig=extra/Configs/defconfigs/powerpc/defconfig
%endif
%ifarch ia64
-defconfig=extra/Configs/defconfigs/ia64
+defconfig=extra/Configs/defconfigs/ia64/defconfig
%endif
cat <<'EOF' >> $defconfig
+# HAS_NO_THREADS is not set
+%{!?with_nptl:LINUXTHREADS_OLD=y}
+%{?with_nptl:UCLIBC_HAS_THREADS_NATIVE=y}
+UCLIBC_HAS_IPV4=y
UCLIBC_HAS_IPV6=y
DO_C99_MATH=y
UCLIBC_HAS_RPC=y
UCLIBC_HAS_PRINTF_M_SPEC=y
UCLIBC_SUSV3_LEGACY=y
UCLIBC_SUSV3_LEGACY_MACROS=y
+UCLIBC_SUSV4_LEGACY=y
+UCLIBC_USE_NETLINK=y
+UCLIBC_SUPPORT_AI_ADDRCONFIG=y
+UCLIBC_HAS_RESOLVER_SUPPORT=y
+UCLIBC_HAS_LIBRESOLV_STUB=y
+UCLIBC_HAS_COMPAT_RES_STATE=y
+UCLIBC_HAS_EXTRA_COMPAT_RES_STATE=y
# DOSTRIP is not set
%{?debug:DODEBUG=y}
%{?debug:SUPPORT_LD_DEBUG=y}
EOF
%build
+# use ld.bfd; gold doesn't work well for now
+install -d our-ld
+ln -s %{_bindir}/ld.bfd our-ld/ld
+PATH=$(pwd)/our-ld:$PATH; export PATH
# NOTE: 'defconfig' and 'all' must be run in separate make process because of macros
%{__make} -j1 defconfig \
DESTDIR=$RPM_BUILD_ROOT
%if %{with shared}
+%if %{without nptl}
mv -f $RPM_BUILD_ROOT%{uclibc_root}/usr/lib/{libpthread-uclibc,libpthread}.so
ln -sf libpthread-%{version}.so $RPM_BUILD_ROOT%{uclibc_root}/lib/libpthread.so.0
+%endif
chmod a+rx $RPM_BUILD_ROOT%{uclibc_root}/lib/*.so
%endif
fi
done
-rm -rf $RPM_BUILD_ROOT%{uclibc_root}/usr/include/{linux,asm*}
-ln -sf /usr/include/asm $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm
-ln -sf /usr/include/asm-generic $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-generic
-# for future use
-%ifarch sparc64
-ln -sf /usr/include/asm-sparc $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-sparc
-ln -sf /usr/include/asm-sparc64 $RPM_BUILD_ROOT%{uclibc_root}/usr/include/asm-sparc64
-%endif
-ln -sf /usr/include/linux $RPM_BUILD_ROOT%{uclibc_root}/usr/include/linux
+# rpm -ql linux-libc-headers | awk -F/ ' /^\/usr\/include\// { print "/usr/include/" $4 } ' | sort -u
+for dir in asm asm-generic linux mtd rdma sound video xen; do
+ ln -sf /usr/include/${dir} $RPM_BUILD_ROOT%{uclibc_root}/usr/include/${dir}
+done
%clean
rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-cc
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-cpp
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-g++
-%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-gasp
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-gcc
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-ld
%attr(755,root,root) %{_bindir}/%{_target_cpu}-uclibc-nm
%attr(755,root,root) %{uclibc_root}/usr/bin/cc
%attr(755,root,root) %{uclibc_root}/usr/bin/cpp
%attr(755,root,root) %{uclibc_root}/usr/bin/g++
-%attr(755,root,root) %{uclibc_root}/usr/bin/gasp
%attr(755,root,root) %{uclibc_root}/usr/bin/gcc
%attr(755,root,root) %{uclibc_root}/usr/bin/ld
%attr(755,root,root) %{uclibc_root}/usr/bin/nm