mirror of
https://github.com/neovim/neovim.git
synced 2025-10-02 07:58:35 +00:00
Merge pull request #5595 from jamessan/tsan-pie
tsan: Compile with -fPIE and updated clang
This commit is contained in:
18
.travis.yml
18
.travis.yml
@@ -9,9 +9,7 @@ env:
|
|||||||
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
# http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM
|
||||||
- MAKE_CMD="make -j2"
|
- MAKE_CMD="make -j2"
|
||||||
# Update PATH for pip.
|
# Update PATH for pip.
|
||||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$PATH"
|
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.8/bin:$PATH"
|
||||||
# LLVM symbolizer path.
|
|
||||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.4)"
|
|
||||||
# Build directory for Neovim.
|
# Build directory for Neovim.
|
||||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||||
# Build directory for third-party dependencies.
|
# Build directory for third-party dependencies.
|
||||||
@@ -36,9 +34,8 @@ env:
|
|||||||
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
-DCMAKE_TOOLCHAIN_FILE=$TRAVIS_BUILD_DIR/cmake/i386-linux-gnu.toolchain.cmake"
|
||||||
# Environment variables for Clang sanitizers.
|
# Environment variables for Clang sanitizers.
|
||||||
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
- ASAN_OPTIONS="detect_leaks=1:check_initialization_order=1:log_path=$LOG_DIR/asan"
|
||||||
- ASAN_SYMBOLIZER_PATH="$LLVM_SYMBOLIZER"
|
- TSAN_OPTIONS="log_path=$LOG_DIR/tsan"
|
||||||
- TSAN_OPTIONS="external_symbolizer_path=$LLVM_SYMBOLIZER log_path=$LOG_DIR/tsan"
|
- UBSAN_OPTIONS="print_stacktrace=1 log_path=$LOG_DIR/ubsan"
|
||||||
- UBSAN_OPTIONS="log_path=$LOG_DIR/ubsan"
|
|
||||||
# Environment variables for Valgrind.
|
# Environment variables for Valgrind.
|
||||||
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
- VALGRIND_LOG="$LOG_DIR/valgrind-%p.log"
|
||||||
# Cache marker for third-party dependencies cache.
|
# Cache marker for third-party dependencies cache.
|
||||||
@@ -70,10 +67,10 @@ matrix:
|
|||||||
compiler: gcc-5 -m32
|
compiler: gcc-5 -m32
|
||||||
env: BUILD_32BIT=ON
|
env: BUILD_32BIT=ON
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang-3.8
|
||||||
env: CLANG_SANITIZER=ASAN_UBSAN
|
env: CLANG_SANITIZER=ASAN_UBSAN
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang
|
compiler: clang-3.8
|
||||||
env: CLANG_SANITIZER=TSAN
|
env: CLANG_SANITIZER=TSAN
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang
|
compiler: clang
|
||||||
@@ -96,11 +93,12 @@ addons:
|
|||||||
# TODO: Remove PPA when Travis gets Python >=3.3.
|
# TODO: Remove PPA when Travis gets Python >=3.3.
|
||||||
- deadsnakes
|
- deadsnakes
|
||||||
- ubuntu-toolchain-r-test
|
- ubuntu-toolchain-r-test
|
||||||
|
- llvm-toolchain-precise-3.8
|
||||||
packages:
|
packages:
|
||||||
- autoconf
|
- autoconf
|
||||||
- automake
|
- automake
|
||||||
- build-essential
|
- build-essential
|
||||||
- clang-3.4
|
- clang-3.8
|
||||||
- cmake
|
- cmake
|
||||||
- g++-5-multilib
|
- g++-5-multilib
|
||||||
- g++-multilib
|
- g++-multilib
|
||||||
@@ -109,7 +107,7 @@ addons:
|
|||||||
- gdb
|
- gdb
|
||||||
- libc6-dev-i386
|
- libc6-dev-i386
|
||||||
- libtool
|
- libtool
|
||||||
- llvm-3.4-dev
|
- llvm-3.8-dev
|
||||||
- pkg-config
|
- pkg-config
|
||||||
- python3.3-dev
|
- python3.3-dev
|
||||||
- unzip
|
- unzip
|
||||||
|
@@ -326,6 +326,7 @@ elseif(CLANG_TSAN)
|
|||||||
message(STATUS "Enabling Clang thread sanitizer for nvim.")
|
message(STATUS "Enabling Clang thread sanitizer for nvim.")
|
||||||
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ")
|
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-DEXITFREE ")
|
||||||
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fsanitize=thread ")
|
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fsanitize=thread ")
|
||||||
|
set_property(TARGET nvim APPEND_STRING PROPERTY COMPILE_FLAGS "-fPIE ")
|
||||||
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=thread ")
|
set_property(TARGET nvim APPEND_STRING PROPERTY LINK_FLAGS "-fsanitize=thread ")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -788,8 +788,28 @@ EXTERN int vr_lines_changed INIT(= 0); /* #Lines changed by "gR" so far */
|
|||||||
/// Encoding used when 'fencs' is set to "default"
|
/// Encoding used when 'fencs' is set to "default"
|
||||||
EXTERN char_u *fenc_default INIT(= NULL);
|
EXTERN char_u *fenc_default INIT(= NULL);
|
||||||
|
|
||||||
// To speed up BYTELEN() we keep a table with the byte lengths for utf-8
|
// To speed up BYTELEN(); keep a lookup table to quickly get the length in
|
||||||
EXTERN char utf8len_tab[256];
|
// bytes of a UTF-8 character from the first byte of a UTF-8 string. Bytes
|
||||||
|
// which are illegal when used as the first byte have a 1. The NUL byte has
|
||||||
|
// length 1.
|
||||||
|
EXTERN char utf8len_tab[256] INIT(= {
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
|
||||||
|
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
||||||
|
4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1,
|
||||||
|
});
|
||||||
|
|
||||||
# if defined(USE_ICONV) && defined(DYNAMIC_ICONV)
|
# if defined(USE_ICONV) && defined(DYNAMIC_ICONV)
|
||||||
/* Pointers to functions and variables to be loaded at runtime */
|
/* Pointers to functions and variables to be loaded at runtime */
|
||||||
|
@@ -68,24 +68,6 @@ struct interval {
|
|||||||
# include "unicode_tables.generated.h"
|
# include "unicode_tables.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Lookup table to quickly get the length in bytes of a UTF-8 character from
|
|
||||||
* the first byte of a UTF-8 string.
|
|
||||||
* Bytes which are illegal when used as the first byte have a 1.
|
|
||||||
* The NUL byte has length 1.
|
|
||||||
*/
|
|
||||||
char utf8len_tab[256] =
|
|
||||||
{
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
|
|
||||||
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
|
|
||||||
3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1,
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Like utf8len_tab above, but using a zero for illegal lead bytes.
|
* Like utf8len_tab above, but using a zero for illegal lead bytes.
|
||||||
*/
|
*/
|
||||||
|
@@ -326,7 +326,9 @@ void msgpack_rpc_from_string(String result, msgpack_packer *res)
|
|||||||
FUNC_ATTR_NONNULL_ARG(2)
|
FUNC_ATTR_NONNULL_ARG(2)
|
||||||
{
|
{
|
||||||
msgpack_pack_str(res, result.size);
|
msgpack_pack_str(res, result.size);
|
||||||
|
if (result.size > 0) {
|
||||||
msgpack_pack_str_body(res, result.data, result.size);
|
msgpack_pack_str_body(res, result.data, result.size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
@@ -1575,7 +1575,9 @@ static char *shada_filename(const char *file)
|
|||||||
do { \
|
do { \
|
||||||
const String s_ = (s); \
|
const String s_ = (s); \
|
||||||
msgpack_pack_bin(spacker, s_.size); \
|
msgpack_pack_bin(spacker, s_.size); \
|
||||||
|
if (s_.size > 0) { \
|
||||||
msgpack_pack_bin_body(spacker, s_.data, s_.size); \
|
msgpack_pack_bin_body(spacker, s_.data, s_.size); \
|
||||||
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/// Write single ShaDa entry
|
/// Write single ShaDa entry
|
||||||
|
Reference in New Issue
Block a user