agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH v16 1/5] introduce routine for checking mutually exclusive string GUCs 112+ messages / 2 participants [nested] [flat]
* [PATCH v16 1/5] introduce routine for checking mutually exclusive string GUCs @ 2023-02-15 22:28 Nathan Bossart <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Nathan Bossart @ 2023-02-15 22:28 UTC (permalink / raw) --- src/backend/postmaster/pgarch.c | 8 +++----- src/backend/utils/misc/guc.c | 22 ++++++++++++++++++++++ src/include/utils/guc.h | 3 +++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/pgarch.c b/src/backend/postmaster/pgarch.c index 46af349564..d94730c50c 100644 --- a/src/backend/postmaster/pgarch.c +++ b/src/backend/postmaster/pgarch.c @@ -824,11 +824,9 @@ LoadArchiveLibrary(void) { ArchiveModuleInit archive_init; - if (XLogArchiveLibrary[0] != '\0' && XLogArchiveCommand[0] != '\0') - ereport(ERROR, - (errcode(ERRCODE_INVALID_PARAMETER_VALUE), - errmsg("both archive_command and archive_library set"), - errdetail("Only one of archive_command, archive_library may be set."))); + (void) CheckMutuallyExclusiveStringGUCs(XLogArchiveLibrary, "archive_library", + XLogArchiveCommand, "archive_command", + ERROR); /* * If shell archiving is enabled, use our special initialization function. diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index 39d3775e80..847b62e161 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -2638,6 +2638,28 @@ ReportGUCOption(struct config_generic *record) pfree(val); } +/* + * If both parameters are set, emits a log message at 'elevel' and returns + * false. Otherwise, returns true. + */ +bool +CheckMutuallyExclusiveStringGUCs(const char *p1val, const char *p1name, + const char *p2val, const char *p2name, + int elevel) +{ + if (p1val[0] != '\0' && p2val[0] != '\0') + { + ereport(elevel, + (errcode(ERRCODE_INVALID_PARAMETER_VALUE), + errmsg("cannot set both %s and %s", p1name, p2name), + errdetail("Only one of %s or %s may be set.", + p1name, p2name))); + return false; + } + + return true; +} + /* * Convert a value from one of the human-friendly units ("kB", "min" etc.) * to the given base unit. 'value' and 'unit' are the input value and unit diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 902e57c0ca..e4eef0da81 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -372,6 +372,9 @@ extern int NewGUCNestLevel(void); extern void AtEOXact_GUC(bool isCommit, int nestLevel); extern void BeginReportingGUCOptions(void); extern void ReportChangedGUCOptions(void); +extern bool CheckMutuallyExclusiveStringGUCs(const char *p1val, const char *p1name, + const char *p2val, const char *p2name, + int elevel); extern void ParseLongOption(const char *string, char **name, char **value); extern const char *get_config_unit_name(int flags); extern bool parse_int(const char *value, int *result, int flags, -- 2.25.1 --SLDf9lqlvOQaIe6s Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v16-0002-refactor-code-for-restoring-via-shell.patch" ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
* [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation @ 2026-06-12 00:15 Henson Choi <[email protected]> 0 siblings, 0 replies; 112+ messages in thread From: Henson Choi @ 2026-06-12 00:15 UTC (permalink / raw) The meson build passes c_args verbatim to the clang command that emits the JIT bitcode. Under -fsanitize=address the instrumentation ends up in the bitcode and breaks the JIT: any JIT-compiled query crashes the backend with SIGILL. The autoconf build is unaffected, as it builds BITCODE_CFLAGS from a whitelist that never includes CFLAGS. Filter sanitizer flags out of c_args during bitcode generation. Author: Matheus Alcantara <[email protected]> Reviewer: Henson Choi <[email protected]> --- src/backend/jit/llvm/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/meson.build b/src/backend/jit/llvm/meson.build index 7df8453ad6f..1ebee3bdcaf 100644 --- a/src/backend/jit/llvm/meson.build +++ b/src/backend/jit/llvm/meson.build @@ -61,7 +61,23 @@ endif # XXX: Need to determine proper version of the function cflags for clang bitcode_cflags = ['-fno-strict-aliasing', '-fwrapv'] -bitcode_cflags += get_option('c_args') + +# Sanitizer instrumentation in the JIT bitcode corrupts the JIT code +# generator: JIT-compiled queries crash with SIGILL. Strip sanitizer flags +# from c_args during bitcode generation, and warn when we do, since the +# JIT-compiled code then runs without sanitizer coverage. +bitcode_sanitize_stripped = false +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true +foreach cflag : get_option('c_args') + if cflag.contains('sanitize') + bitcode_sanitize_stripped = true + else + bitcode_cflags += cflag + endif +endforeach +if bitcode_sanitize_stripped + warning('stripping sanitizer flags from LLVM JIT bitcode; JIT-compiled code will not be instrumented') +endif + bitcode_cflags += cppflags # XXX: Worth improving on the logic to find directories here -- 2.47.3 ---- v2-0002-meson-strip-sanitizer.patch ---- Regards, -- Tatsuo Ishii SRA OSS K.K. English: http://www.sraoss.co.jp/index_en/ Japanese:http://www.sraoss.co.jp ^ permalink raw reply [nested|flat] 112+ messages in thread
end of thread, other threads:[~2026-06-12 00:15 UTC | newest] Thread overview: 112+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-02-15 22:28 [PATCH v16 1/5] introduce routine for checking mutually exclusive string GUCs Nathan Bossart <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]> 2026-06-12 00:15 [PATCH v2 2/3] Exclude sanitizer flags from LLVM JIT bitcode generation Henson Choi <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox