Skip to content

Commit 8201281

Browse files
committed
Fix sanitizer tests: Add to LDFLAGS
sanitizer flags need to be passed to both the compiler and the linker to work properly. Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent 88d9c04 commit 8201281

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

.github/actions/config-variations/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ runs:
2424
gh_token: ${{ inputs.gh_token }}
2525
compile_mode: native
2626
cflags: "-DMLD_CONFIG_KEYGEN_PCT -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
27+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
2728
func: true
2829
kat: true
2930
acvp: true
@@ -51,6 +52,7 @@ runs:
5152
gh_token: ${{ inputs.gh_token }}
5253
compile_mode: native
5354
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/custom_zeroize_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
55+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
5456
func: true
5557
kat: true
5658
acvp: true
@@ -63,6 +65,7 @@ runs:
6365
gh_token: ${{ inputs.gh_token }}
6466
compile_mode: native
6567
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/no_asm_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
68+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
6669
func: true
6770
kat: true
6871
acvp: true
@@ -75,6 +78,7 @@ runs:
7578
gh_token: ${{ inputs.gh_token }}
7679
compile_mode: native
7780
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/custom_randombytes_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
81+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
7882
func: true
7983
kat: true
8084
acvp: true
@@ -87,6 +91,7 @@ runs:
8791
gh_token: ${{ inputs.gh_token }}
8892
compile_mode: native
8993
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/custom_memcpy_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
94+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
9095
func: true
9196
kat: true
9297
acvp: true
@@ -99,6 +104,7 @@ runs:
99104
gh_token: ${{ inputs.gh_token }}
100105
compile_mode: native
101106
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/custom_memset_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
107+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
102108
func: true
103109
kat: true
104110
acvp: true
@@ -111,6 +117,7 @@ runs:
111117
gh_token: ${{ inputs.gh_token }}
112118
compile_mode: native
113119
cflags: "-std=c11 -D_GNU_SOURCE -DMLD_CONFIG_FILE=\\\\\\\"../test/custom_stdlib_config.h\\\\\\\" -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
120+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
114121
func: true
115122
kat: true
116123
acvp: true

.github/actions/functest/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ inputs:
2424
cflags:
2525
description: CFLAGS to pass to compilation
2626
default: ""
27+
ldflags:
28+
description: LDFLAGS to pass to linking
29+
default: ""
2730
cross_prefix:
2831
description: Binary prefix for cross compilation
2932
default: ""
@@ -95,7 +98,7 @@ runs:
9598
shell: ${{ env.SHELL }}
9699
run: |
97100
make clean
98-
./scripts/tests all --exec-wrapper="${{ inputs.exec_wrapper }}" --cross-prefix="${{ inputs.cross_prefix }}" --cflags="${{ inputs.cflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.ACVP }} --${{ env.EXAMPLES }} --${{ env.STACK }} -v
101+
./scripts/tests all --exec-wrapper="${{ inputs.exec_wrapper }}" --cross-prefix="${{ inputs.cross_prefix }}" --cflags="${{ inputs.cflags }}" --ldflags="${{ inputs.ldflags }}" --opt=${{ inputs.opt }} --${{ env.FUNC }} --${{ env.KAT }} --${{ env.ACVP }} --${{ env.EXAMPLES }} --${{ env.STACK }} -v
99102
- name: Post ${{ env.MODE }} Tests
100103
shell: ${{ env.SHELL }}
101104
if: success() || failure()

.github/actions/multi-functest/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ inputs:
2424
cflags:
2525
description: CFLAGS to pass to compilation
2626
default: ""
27+
ldflags:
28+
description: LDFLAGS to pass to linking
29+
default: ""
2730
compile_mode:
2831
description: all | native | cross-x86_64 | cross-aarch64 | cross-riscv64
2932
default: "native"
@@ -58,6 +61,7 @@ runs:
5861
gh_token: ${{ inputs.gh_token }}
5962
custom_shell: ${{ inputs.custom_shell }}
6063
cflags: ${{ inputs.cflags }}
64+
ldflags: ${{ inputs.ldflags }}
6165
opt: ${{ inputs.opt }}
6266
func: ${{ inputs.func }}
6367
kat: ${{ inputs.kat }}
@@ -74,6 +78,7 @@ runs:
7478
gh_token: ${{ inputs.gh_token }}
7579
custom_shell: ${{ inputs.custom_shell }}
7680
cflags: "${{ inputs.cflags }} -DMLD_FORCE_X86_64"
81+
ldflags: ${{ inputs.ldflags }}
7782
cross_prefix: x86_64-unknown-linux-gnu-
7883
exec_wrapper: qemu-x86_64
7984
opt: ${{ inputs.opt }}
@@ -92,6 +97,7 @@ runs:
9297
gh_token: ${{ inputs.gh_token }}
9398
custom_shell: ${{ inputs.custom_shell }}
9499
cflags: "${{ inputs.cflags }} -DMLD_FORCE_AARCH64"
100+
ldflags: ${{ inputs.ldflags }}
95101
cross_prefix: aarch64-unknown-linux-gnu-
96102
exec_wrapper: qemu-aarch64
97103
opt: ${{ inputs.opt }}
@@ -110,6 +116,7 @@ runs:
110116
gh_token: ${{ inputs.gh_token }}
111117
custom_shell: ${{ inputs.custom_shell }}
112118
cflags: "${{ inputs.cflags }} -DMLD_FORCE_PPC64LE"
119+
ldflags: ${{ inputs.ldflags }}
113120
cross_prefix: powerpc64le-unknown-linux-gnu-
114121
exec_wrapper: qemu-ppc64le
115122
opt: ${{ inputs.opt }}
@@ -128,6 +135,7 @@ runs:
128135
gh_token: ${{ inputs.gh_token }}
129136
custom_shell: ${{ inputs.custom_shell }}
130137
cflags: "${{ inputs.cflags }} -static -DMLD_FORCE_AARCH64_EB"
138+
ldflags: ${{ inputs.ldflags }}
131139
cross_prefix: aarch64_be-none-linux-gnu-
132140
exec_wrapper: qemu-aarch64_be
133141
opt: ${{ inputs.opt }}
@@ -146,6 +154,7 @@ runs:
146154
gh_token: ${{ inputs.gh_token }}
147155
custom_shell: ${{ inputs.custom_shell }}
148156
cflags: "${{ inputs.cflags }} -DMLD_FORCE_RISCV64"
157+
ldflags: ${{ inputs.ldflags }}
149158
cross_prefix: riscv64-unknown-linux-gnu-
150159
exec_wrapper: qemu-riscv64
151160
opt: ${{ inputs.opt }}

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ jobs:
152152
gh_token: ${{ secrets.GITHUB_TOKEN }}
153153
compile_mode: native
154154
cflags: "-DMLDSA_DEBUG -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
155+
ldflags: "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all"
155156
compiler_tests:
156157
name: Compiler tests (${{ matrix.compiler.name }}, ${{ matrix.target.name }}, ${{ matrix.cflags }})
157158
strategy:

0 commit comments

Comments
 (0)