This package contains all necessary include files and libraries needed
to develop applications that require these.
+%if %{asan}
+%package noasan-static
+Summary: An ELF Object File Access Library (static library build without of ASan)
+Group: Development/Libraries/C and C++
+Requires: glibc-devel,
+Conflicts: libelf1-devel
+
+%description noasan-static
+This package contains static library built without of ASan.
+It is required for static builds in full ASan sanitized environment.
+%endif
+
%prep
%setup -q -n libelf-%{version}
cp %{SOURCE1001} .
%build
-%{?asan:/usr/bin/gcc-unforce-options}
-
export LDFLAGS+=" -z relro"
%configure --disable-nls
make %{?_smp_mflags}
+%if %{asan}
+/usr/bin/gcc-unforce-options
+mkdir noasan
+cd noasan
+../configure --disable-nls --disable-shared
+make %{?_smp_mflags} all
+cd ..
+%endif
+
%install
make install instroot=%{buildroot}
+%{?asan:cp ./noasan/lib/libelf.a %{buildroot}%{_libdir}/libelf-noasan.a}
# remove the wrapper includes
rm -f %{buildroot}%{_includedir}/*.h
# remove unneeded *.la and *.a files
%{_libdir}/pkgconfig/libelf.pc
%{_includedir}/libelf
+%if %{asan}
+%files noasan-static
+%manifest %{name}.manifest
+%defattr(-,root,root)
+%{_libdir}/libelf-noasan.a
+%endif
+
%changelog