mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 19:15:54 +00:00
linked model flags specific to amd64
Signed-off-by: Pratik Mankawde <pmankawde@ripple.com>
This commit is contained in:
17
.github/scripts/strategy-matrix/generate.py
vendored
17
.github/scripts/strategy-matrix/generate.py
vendored
@@ -166,9 +166,12 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
# names get truncated. Add Address and Thread (both coupled with UB) sanitizers when the distro is bookworm.
|
# names get truncated. Add Address and Thread (both coupled with UB) sanitizers when the distro is bookworm.
|
||||||
if os['distro_version'] == 'bookworm':
|
if os['distro_version'] == 'bookworm':
|
||||||
# Use medium code model to avoid relocation errors with large binaries
|
# Use medium code model to avoid relocation errors with large binaries
|
||||||
extra_warning_flags = '-mcmodel=medium'
|
# Only for x86-64 (amd64) - ARM64 doesn't support -mcmodel=medium
|
||||||
# Linker also needs to know about the code model
|
extra_warning_flags = ''
|
||||||
linker_flags = '-DCMAKE_EXE_LINKER_FLAGS="-mcmodel=medium" -DCMAKE_SHARED_LINKER_FLAGS="-mcmodel=medium"'
|
linker_flags = ''
|
||||||
|
if architecture['platform'] == 'linux/amd64':
|
||||||
|
cxx_flags += ' -mcmodel=medium'
|
||||||
|
linker_flags = ' -DCMAKE_EXE_LINKER_FLAGS="-mcmodel=medium" -DCMAKE_SHARED_LINKER_FLAGS="-mcmodel=medium"'
|
||||||
# Suppress false positive warnings in GCC with stringop-overflow
|
# Suppress false positive warnings in GCC with stringop-overflow
|
||||||
if os['compiler_name'] == 'gcc':
|
if os['compiler_name'] == 'gcc':
|
||||||
extra_warning_flags += ' -Wno-stringop-overflow'
|
extra_warning_flags += ' -Wno-stringop-overflow'
|
||||||
@@ -181,7 +184,9 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
else:
|
else:
|
||||||
cxx_flags += " -O1"
|
cxx_flags += " -O1"
|
||||||
|
|
||||||
cmake_args_flags = f'{cmake_args} -DCMAKE_CXX_FLAGS="-fsanitize=address,{sanitizers_flags} -fno-omit-frame-pointer {cxx_flags} {extra_warning_flags}" {linker_flags}'
|
cmake_args_flags = f'{cmake_args} -DCMAKE_CXX_FLAGS="-fsanitize=address,{sanitizers_flags} -fno-omit-frame-pointer {cxx_flags} {extra_warning_flags}"'
|
||||||
|
if linker_flags:
|
||||||
|
cmake_args_flags +=linker_flags
|
||||||
configurations.append({
|
configurations.append({
|
||||||
'config_name': config_name + "_asan",
|
'config_name': config_name + "_asan",
|
||||||
'cmake_args': cmake_args_flags,
|
'cmake_args': cmake_args_flags,
|
||||||
@@ -195,7 +200,9 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
# gcc doesn't supports atomic_thread_fence with tsan. Suppress warnings.
|
# gcc doesn't supports atomic_thread_fence with tsan. Suppress warnings.
|
||||||
if os['compiler_name'] == 'gcc':
|
if os['compiler_name'] == 'gcc':
|
||||||
extra_warning_flags += ' -Wno-tsan'
|
extra_warning_flags += ' -Wno-tsan'
|
||||||
cmake_args_flags = f'{cmake_args} -DCMAKE_CXX_FLAGS="-fsanitize=thread,{sanitizers_flags} -fno-omit-frame-pointer {cxx_flags} {extra_warning_flags}" {linker_flags}'
|
cmake_args_flags = f'{cmake_args} -DCMAKE_CXX_FLAGS="-fsanitize=thread,{sanitizers_flags} -fno-omit-frame-pointer {cxx_flags} {extra_warning_flags}"'
|
||||||
|
if linker_flags:
|
||||||
|
cmake_args_flags +=linker_flags
|
||||||
configurations.append({
|
configurations.append({
|
||||||
'config_name': config_name+ "_tsan",
|
'config_name': config_name+ "_tsan",
|
||||||
'cmake_args': cmake_args_flags,
|
'cmake_args': cmake_args_flags,
|
||||||
|
|||||||
@@ -165,13 +165,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Run the separate tests
|
- name: Run the separate tests
|
||||||
if: ${{ !inputs.build_only }}
|
if: ${{ !inputs.build_only }}
|
||||||
|
with:
|
||||||
|
sanitizers_supp_dir: ${{ github.workspace }}/external/
|
||||||
working-directory: ${{ inputs.build_dir }}
|
working-directory: ${{ inputs.build_dir }}
|
||||||
# Windows locks some of the build files while running tests, and parallel jobs can collide
|
# Windows locks some of the build files while running tests, and parallel jobs can collide
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ inputs.build_type }}
|
BUILD_TYPE: ${{ inputs.build_type }}
|
||||||
PARALLELISM: ${{ runner.os == 'Windows' && '1' || steps.nproc.outputs.nproc }}
|
PARALLELISM: ${{ runner.os == 'Windows' && '1' || steps.nproc.outputs.nproc }}
|
||||||
ASAN_OPTIONS: "suppressions=${{ github.workspace }}/external/asan_suppressions.txt"
|
ASAN_OPTIONS: "suppressions=${{ sanitizers_supp_dir }}/asan_suppressions.txt"
|
||||||
TSAN_OPTIONS: "suppressions=${{ github.workspace }}/external/tsan_suppressions.txt"
|
TSAN_OPTIONS: "suppressions=${{ sanitizers_supp_dir }}/tsan_suppressions.txt"
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
ctest \
|
ctest \
|
||||||
|
|||||||
Reference in New Issue
Block a user