Skip to content

gh-75382: Fail configure early if a sanitizer cannot be linked - #159496

Merged
StanFromIreland merged 3 commits into
python:mainfrom
vasiliyk:gh-75382-sanitizer-link-check
Oct 21, 2026
Merged

StanFromIreland merged 3 commits into
python:mainfrom
vasiliyk:gh-75382-sanitizer-link-check

Conversation

@vasiliyk

@vasiliyk vasiliyk commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

--with-*-sanitizer puts -fsanitize=.... into LDFLAGS unchecked, so a missing sanitizer runtime makes configure fail on unrelated checks.

This PR links an empty program right after the flags are set and fails with a clear message if that does not work.

I added checks for all sanitizer options. For msan and hwasan replaced AX_CHECK_COMPILE_FLAG, which only compiled and could not catch missing runtime.

Supersedes #12433 that was closed as stale.

Link a test program after each --with-*-sanitizer option and stop with
a clear error if the flag is unsupported or the runtime is missing.
Comment thread configure.ac Resolved
Comment thread configure.ac Resolved

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@StanFromIreland

Copy link
Copy Markdown
Member

Oh wait, sorry, you'll have to regenerate configure.

@vasiliyk

Copy link
Copy Markdown
Contributor Author

done

@StanFromIreland
StanFromIreland enabled auto-merge (squash) October 21, 2026 18:23
@StanFromIreland
StanFromIreland merged commit b94fdb7 into python:main Oct 21, 2026
51 checks passed
@vasiliyk
vasiliyk deleted the gh-75382-sanitizer-link-check branch October 21, 2026 19:35
@StanFromIreland

Copy link
Copy Markdown
Member

Merged, thanks!

@emmatyping

Copy link
Copy Markdown
Member

Should we backport this?

@StanFromIreland

Copy link
Copy Markdown
Member

Should we backport this?

I debated that, since it is a behaviour change and to some extent a new feature. I was split, so what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants