Summary: musl libc - new standard library to power a new generation of Linux-based devices
Summary(pl.UTF-8): musl libc - nowa biblioteka standardowa dla urządzeń linuksowych nowej generacji
Name: musl
-Version: 1.1.10
-Release: 1
+Version: 1.1.15
+Release: 2
License: MIT
Group: Libraries
Source0: http://www.musl-libc.org/releases/%{name}-%{version}.tar.gz
-# Source0-md5: fc30892ee582c91920505bbd0021049f
+# Source0-md5: 9590a9d47ee64f220b3c12f7afb864ca
+Patch0: %{name}-gcc.patch
URL: http://www.musl-libc.org/
BuildRequires: gcc >= 5:3.2
BuildRequires: zlib-devel
Requires: uname(release) >= 2.6.0
-ExclusiveArch: %{ix86} %{x8664} arm mips microblaze ppc
+ExclusiveArch: %{ix86} %{x8664} x32 arm mips microblaze ppc
ExcludeArch: i386
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _fortify_cflags %{nil}
%define _ssp_cflags %{nil}
-# i386, x86_64, arm, mips, microblaze, ppc
+# i386, x86_64, x32, arm, mips, microblaze, ppc
+%ifarch x32
+%define musl_arch x32
+%else
%define musl_arch %{_target_base_arch}
+%endif
%description
musl libc is a new standard library to power a new generation of
%prep
%setup -q
+%patch0 -p1
%build
%configure \
--syslibdir=/%{_lib}
-%{__make}
+
+# WRAPCC_GCC that will be used as $REALGCC fallback in musl-gcc script
+# regardless what is value when this package is built (ccache, etc)
+%{__make} \
+ WRAPCC_GCC="%{_target_platform}-gcc"
%install
rm -rf $RPM_BUILD_ROOT
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
+# move actual library to /lib to handle /usr mounts
+mv $RPM_BUILD_ROOT{%{_libdir}/libc.so,/%{_lib}/ld-musl-%{musl_arch}.so.1}
+ln -s /%{_lib}/ld-musl-%{musl_arch}.so.1 $RPM_BUILD_ROOT%{_libdir}/libc.so
+
install -d $RPM_BUILD_ROOT%{_sysconfdir}
echo '%{_libdir}' > $RPM_BUILD_ROOT%{_sysconfdir}/ld-musl-%{musl_arch}.path