ENDIF(NOT_USE_FUNCTION)
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pthread -std=c++11 -Wl,--no-as-needed -ggdb")
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs" )
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -pthread -std=c++11 -ggdb")
#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIE")
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fdata-sections -ffunction-sections")
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -D_FILE_OFFSET_BITS=64")
#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DLAUNCHING_TIME_MEASURE")
+IF(ASAN_ENABLED)
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fno-omit-frame-pointer -fsanitize=address")
+ELSE(ASAN_ENABLED)
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,-zdefs")
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,--no-as-needed")
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wl,--gc-sections")
+ENDIF(ASAN_ENABLED)
+
SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
SET(CMAKE_CXX_FLAGS_DEBUG "-O2 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
INSTALL(FILES dotnet.loader DESTINATION ${LOADERDIR})
INSTALL(FILES dotnet.launcher DESTINATION ${LOADERDIR})
INSTALL(FILES dotnet.debugger DESTINATION ${LOADERDIR})
-ENDIF(NOT DEFINED NO_TIZEN)
+ENDIF(NOT DEFINED NO_TIZEN)
\ No newline at end of file
BuildRequires: aul-devel
BuildRequires: dotnet-build-tools
+%if 0%{?asan_enabled}
+BuildRequires: clang >= 3.8
+BuildRequires: compiler-rt
+%endif
+
Requires: aul
Requires: launchpad
%endif
%build
+
+%if 0%{?asan_enabled}
+%define _dotnet_build_conf Debug
+export CFLAGS=" --target=%{_host} "
+export CXXFLAGS=" --target=%{_host} "
+%ifarch %{ix86}
+export CFLAGS=$(echo $CFLAGS | sed -e 's/--target=i686/--target=i586/')
+export CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/--target=i686/--target=i586/')
+%endif
+%endif
+
cmake \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
+%if 0%{?asan_enabled}
+ -DCMAKE_C_COMPILER=clang \
+ -DCMAKE_CXX_COMPILER=clang++ \
+ -DASAN_ENABLED=TRUE \
+%endif
-DPACKAGE_NAME=%{name} \
-DLIBDIR=%{_libdir} \
-DBINDIR=%{_bindir} \