echo "Add argument 'architecture (armv7l or aarch64)'"
exit
fi
-fi
-if [ $ASAN == "false" ]; then
- if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-TV/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT/local/repos/device/$ARCH/RPMS"
- else
- echo "Add argument 'device build type (mobile or wearable or tv or common_iot)'"
- exit
- fi
-else
- if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE-ASAN/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE-ASAN/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-TV-ASAN/local/repos/device/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT-ASAN/local/repos/device/$ARCH/RPMS"
+ if [ $ASAN == "false" ]; then
+ if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-TV/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT/local/repos/device/$ARCH/RPMS"
+ else
+ echo "Add argument 'device build type (mobile or wearable or tv or common_iot)'"
+ exit
+ fi
else
- echo "Add argument 'device build type (mobile or wearable or tv)'"
- exit
+ if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE-ASAN/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE-ASAN/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-TV-ASAN/local/repos/device/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT-ASAN/local/repos/device/$ARCH/RPMS"
+ else
+ echo "Add argument 'device build type (mobile or wearable or tv)'"
+ exit
+ fi
+ ASAN_BUILD_PATH="$RPM_DIR/../../../../BUILD-ROOTS/scratch.$ARCH.0/home/abuild/rpmbuild/BUILD/"
+ ASAN_EXE_PATH="$RPM_DIR/$ASAN_EXE_FOLDER/"
fi
- ASAN_BUILD_PATH="$RPM_DIR/../../../../BUILD-ROOTS/scratch.$ARCH.0/home/abuild/rpmbuild/BUILD/"
- ASAN_EXE_PATH="$RPM_DIR/$ASAN_EXE_FOLDER/"
fi
if [ "$1" = "install_custom" ]; then
echo "Add argument 'architecture (i586 or x86_64)'"
exit
fi
-fi
-if [ $ASAN == "false" ]; then
- if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-TV/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT/local/repos/sdk/$ARCH/RPMS"
- else
- echo "Add argument 'sdk build type (mobile or wearable or tv or common_iot)'"
- exit
- fi
-else
- if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE-ASAN/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE-ASAN/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-TV-ASAN/local/repos/sdk/$ARCH/RPMS"
- elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
- RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT-ASAN/local/repos/sdk/$ARCH/RPMS"
+ if [ $ASAN == "false" ]; then
+ if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-TV/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT/local/repos/sdk/$ARCH/RPMS"
+ else
+ echo "Add argument 'sdk build type (mobile or wearable or tv or common_iot)'"
+ exit
+ fi
else
- echo "Add argument 'device build type (mobile or wearable or tv)'"
- exit
+ if [ $BUILD_DEVICE_TYPE == "mobile" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-MOBILE-ASAN/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "wearable" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-WEARABLE-ASAN/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "tv" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-TV-ASAN/local/repos/sdk/$ARCH/RPMS"
+ elif [ $BUILD_DEVICE_TYPE == "common_iot" ]; then
+ RPM_DIR="$HOME/GBS-ROOT-TCT-COMMON_IOT-ASAN/local/repos/sdk/$ARCH/RPMS"
+ else
+ echo "Add argument 'device build type (mobile or wearable or tv)'"
+ exit
+ fi
+ ASAN_BUILD_PATH="$RPM_DIR/../../../../BUILD-ROOTS/scratch.$ARCH.0/home/abuild/rpmbuild/BUILD/"
+ ASAN_EXE_PATH="$RPM_DIR/$ASAN_EXE_FOLDER/"
fi
- ASAN_BUILD_PATH="$RPM_DIR/../../../../BUILD-ROOTS/scratch.$ARCH.0/home/abuild/rpmbuild/BUILD/"
- ASAN_EXE_PATH="$RPM_DIR/$ASAN_EXE_FOLDER/"
fi
if [ "$1" = "install_custom" ]; then
DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
)
+IF( DEFINED ASAN )
+SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
+ELSE()
SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -O0 -g -fPIE -Wall")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
+ENDIF()
export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="mobile" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="wearable" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_TV:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tv" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%if %{?ASAN_BUILD:1}0
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+%else
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="ctc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
%endif
make %{?jobs:-j%jobs}
DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
)
+IF( DEFINED ASAN )
+SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
+ELSE()
SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -O0 -g -fPIE -Wall")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
+ENDIF()
export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_TV:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="common_iot" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%if %{?ASAN_BUILD:1}0
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+%else
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="itc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
%endif
make %{?jobs:-j%jobs}
DESTINATION ${BIN_DIR}/${RPM_NAME}/bin
)
+IF( DEFINED ASAN )
+SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address")
+ELSE()
SET(CMAKE_%{LANG_COMPILER_NAME}_FLAGS "${CMAKE_%{LANG_COMPILER_NAME}_FLAGS} -O0 -g -fPIE -Wall")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie")
+ENDIF()
export LDFLAGS+="-Wl,--rpath=%{PREFIX} -Wl,--as-needed"
-%if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_TV:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DCMAKE_INSTALL_PREFIX=%{_prefix}
-%endif
-
-%if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
-cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="common_iot" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+%if %{?ASAN_BUILD:1}0
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="true" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+%else
+ %if %{?DEVICE_BUILD_TYPE_MOBILE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="mobile" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_WEARABLE:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="wearable" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_TV:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="tv" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
+ %if %{?DEVICE_BUILD_TYPE_COMMON_IOT:1}0
+ cmake . -DMODULE="%{MODULE_NAME}" -DBUILDTCTYPE="utc" -DDEVICE_BUILD_TYPE="common_iot" -DASANBUILD="false" -DCMAKE_INSTALL_PREFIX=%{_prefix}
+ %endif
%endif
make %{?jobs:-j%jobs}