sanitizers cleanup (#10551)

- add to AddressSanitizer and UndefinedBehaviorSanitizer to CMAKE_BUILD_TYPE options
 - handle environment variable helpers outside of CMake
 - add -O1 optimization
 - cleanup whitespace
This commit is contained in:
Daniel Agar
2018-09-23 16:52:09 -04:00
committed by GitHub
parent 38aa9a20f6
commit 18a0b39968
4 changed files with 104 additions and 96 deletions
+3 -15
View File
@@ -6,27 +6,13 @@ pipeline {
parameters {
choice(
name: 'PX4_CMAKE_BUILD_TYPE',
choices: ['RelWithDebInfo', 'Coverage', 'AddressSanitizer'],
choices: ['RelWithDebInfo', 'Coverage', 'AddressSanitizer', 'UndefinedBehaviorSanitizer'],
description: "CMake build type"
)
}
stages {
stage('Setup Environment') {
steps {
script {
env.CTEST_OUTPUT_ON_FAILURE=1
if (env.PX4_CMAKE_BUILD_TYPE == 'AddressSanitizer') {
env.PX4_ASAN=1
env.ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1"
}
}
}
}
stage('Build') {
agent {
@@ -206,8 +192,10 @@ pipeline {
} //stages
environment {
ASAN_OPTIONS = 'detect_stack_use_after_return=1:check_initialization_order=1'
CCACHE_DIR = '/tmp/ccache'
CI = true
CTEST_OUTPUT_ON_FAILURE = 1
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactDaysToKeepStr: '30'))