diff --git a/openexr.spec b/openexr.spec index b983bf3..8ffbd0e 100644 --- a/openexr.spec +++ b/openexr.spec @@ -138,15 +138,16 @@ export CXXFLAGS="%{optflags} -O0" --enable-imffuzztest \ --enable-imfhugetest %if %{asan_build} -for i in $(find -name Makefile | grep -v 'IlmImf/Makefile'); do +vmemlimit=$(ulimit -v) +if [ $vmemlimit != unlimited ]; then + echo "ulimit -v has to be unlimited (currently $vmemlimit) to run ASAN build" + exit 1 +fi +for i in $(find -name Makefile); do sed -i -e 's/\(^CXXFLAGS.*\)/\1 -fsanitize=address/' \ -e 's/\(^LIBS =.*\)/\1 -lasan/' \ $i done -# IlmImf/Makefile requires special handling: IlmImf/b44ExpLogTable and IlmImf/eLut -# helpers will run during build; but asan is not compatible with ulimit -v limitation -sed -i -e 's/\($(AM_V_CXX)$(LTCXXCOMPILE)\)/\1 -fsanitize=address/' IlmImf/Makefile -sed -i -e 's/\(^libIlmImf_la_LIBADD.*\)/\1 -lasan/' IlmImf/Makefile %endif make %{?_smp_mflags}