Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
6b8b91e9
Commit
6b8b91e9
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Better ASAN support
parent
8fc0abd6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/cmake/00-Common.cmake
+16
-12
16 additions, 12 deletions
indra/cmake/00-Common.cmake
indra/newview/linux_tools/wrapper.sh
+3
-0
3 additions, 0 deletions
indra/newview/linux_tools/wrapper.sh
with
19 additions
and
12 deletions
indra/cmake/00-Common.cmake
+
16
−
12
View file @
6b8b91e9
...
...
@@ -206,8 +206,8 @@ if (LINUX)
if
(
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"GNU"
OR
"
${
CMAKE_CXX_COMPILER_ID
}
"
STREQUAL
"Clang"
)
if
(
USE_ASAN
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=address"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=address"
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fsanitize=address
-fsanitize-recover=address
"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fsanitize=address
-fsanitize-recover=address
"
)
link_libraries
(
-lasan
)
endif
(
USE_ASAN
)
...
...
@@ -233,23 +233,27 @@ if (LINUX)
CHECK_CXX_COMPILER_FLAG
(
-fstack-protector-strong HAS_STRONG_STACK_PROTECTOR
)
CHECK_CXX_COMPILER_FLAG
(
-fstack-protector HAS_STACK_PROTECTOR
)
if
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Release"
)
if
(
HAS_STRONG_STACK_PROTECTOR
)
if
(
HAS_STRONG_STACK_PROTECTOR
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fstack-protector-strong"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fstack-protector-strong"
)
elseif
(
HAS_STACK_PROTECTOR
)
elseif
(
HAS_STACK_PROTECTOR
)
set
(
CMAKE_C_FLAGS
"
${
CMAKE_C_FLAGS
}
-fstack-protector"
)
set
(
CMAKE_CXX_FLAGS
"
${
CMAKE_CXX_FLAGS
}
-fstack-protector"
)
endif
(
HAS_STRONG_STACK_PROTECTOR
)
endif
(
HAS_STRONG_STACK_PROTECTOR
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
)
endif
(
${
CMAKE_BUILD_TYPE
}
STREQUAL
"Release"
)
if
(
HAS_DEBUG_OPTIMIZATION
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Og
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
else
(
HAS_DEBUG_OPTIMIZATION
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -fno-inline
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
endif
(
HAS_DEBUG_OPTIMIZATION
)
if
(
HAS_DEBUG_OPTIMIZATION
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-Og
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
else
(
HAS_DEBUG_OPTIMIZATION
)
set
(
CMAKE_CXX_FLAGS_DEBUG
"-O0 -fno-inline
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
endif
(
HAS_DEBUG_OPTIMIZATION
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -ffast-math
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
if
(
USE_ASAN OR USE_LEAKSAN OR USE_UBSAN OR USE_THDSAN
)
set
(
CMAKE_CXX_FLAGS_RELEASE
"-Og
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
else
()
set
(
CMAKE_CXX_FLAGS_RELEASE
"-O3 -ffast-math
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
endif
()
# Enable these flags so we have a read only GOT and some linking opts
set
(
CMAKE_EXE_LINKER_FLAGS
"
${
CMAKE_EXE_LINKER_FLAGS
}
-Wl,-z,relro -Wl,-z,now -Wl,--as-needed"
)
set
(
CMAKE_SHARED_LINKER_FLAGS
"
${
CMAKE_SHARED_LINKER_FLAGS
}
-Wl,-z,relro -Wl,-z,now -Wl,--as-needed"
)
...
...
@@ -288,7 +292,7 @@ if (LINUX OR DARWIN)
endif
(
CMAKE_CXX_COMPILER MATCHES
".*clang"
)
if
(
CMAKE_COMPILER_IS_GNUCXX
)
set
(
GCC_WARNINGS
"-Wall -Wno-sign-compare -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-deprecated-copy -Wno-ignored-qualifiers -Wnon-virtual-dtor"
)
set
(
GCC_WARNINGS
"-Wall -Wno-sign-compare -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-deprecated-copy -Wno-ignored-qualifiers
-Wno-unused-function
-Wnon-virtual-dtor"
)
elseif
(
CMAKE_COMPILER_IS_CLANGXX
)
set
(
GCC_WARNINGS
"-Wall -Wno-sign-compare -Wno-trigraphs"
)
endif
()
...
...
This diff is collapsed.
Click to expand it.
indra/newview/linux_tools/wrapper.sh
+
3
−
0
View file @
6b8b91e9
...
...
@@ -55,6 +55,9 @@ fi
#export LL_WRAPPER='gdb --args'
#export LL_WRAPPER='valgrind --smc-check=all --error-limit=no --log-file=secondlife.vg --leak-check=full --suppressions=/usr/lib/valgrind/glibc-2.5.supp --suppressions=secondlife-i686.supp'
## For controlling various sanitizer options
#export ASAN_OPTIONS="halt_on_error=0 detect_leaks=1 symbolize=1"
## - Avoids an often-buggy X feature that doesn't really benefit us anyway.
# export SDL_VIDEO_X11_DGAMOUSE=0
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment