export PAL_DBG_CHANNELS=""
%endif
+%ifarch %{arm}
+# for armoring request from PM group
+# FIXME1: If you find better solution like CMAKE_CXX_FLAGS, please fix this
+# FIXME2: This patch does not work on non-arm archtecture
+export CXXFLAGS+="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
+%endif
+
%if 0%{skipmscorlib}
%if 0%{skipnative}
# No build native and mscorlib.
%else
# Build native only.
-./build.sh %{_barch} %{_buildtype} clang3.8 skipmscorlib skipgenerateversion skipnuget %{testopt} cmakeargs "-DFEATURE_GDBJIT=TRUE -DFEATURE_DBGIPC=0 -DFEATURE_NI_BIND_FALLBACK=false -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
+./build.sh %{_barch} %{_buildtype} clang3.8 skipmscorlib skipgenerateversion skipnuget %{testopt} cmakeargs "-DFEATURE_GDBJIT=TRUE -DFEATURE_DBGIPC=0 -DFEATURE_NI_BIND_FALLBACK=false -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro"
%endif
%else
%if 0%{skipnative}
./build.sh %{_barch} %{_buildtype} -skiprestore skipnative skipnuget %{testopt}
%else
# Build native and mscorlib.
-./build.sh %{_barch} %{_buildtype} clang3.8 skipgenerateversion -skiprestore skipnuget %{testopt} cmakeargs "-DFEATURE_GDBJIT=TRUE -DFEATURE_DBGIPC=0 -DFEATURE_NI_BIND_FALLBACK=false -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
+./build.sh %{_barch} %{_buildtype} clang3.8 skipgenerateversion -skiprestore skipnuget %{testopt} cmakeargs "-DFEATURE_GDBJIT=TRUE -DFEATURE_DBGIPC=0 -DFEATURE_NI_BIND_FALLBACK=false -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,relro -DCMAKE_EXE_LINKER_FLAGS=-Wl,-z,relro"
%endif
%endif