Skip to content

configure: don't pass compile flags through WRAPPER - #7921

Open
hzhou wants to merge 2 commits into
pmodels:mainfrom
hzhou:2608_wrapper_flags
Open

configure: don't pass compile flags through WRAPPER#7921
hzhou wants to merge 2 commits into
pmodels:mainfrom
hzhou:2608_wrapper_flags

Conversation

@hzhou

@hzhou hzhou commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Pull Request Description

PAC_PREFIX_FLAG previously copied user's flags (e.g. CFLAGS) into WRAPPER_CFLAGS, causing mpicc to pass them to user applications. WRAPPER compile flags should only contain flags explicitly needed by applications, not MPICH's own build flags.

  • Change PAC_PREFIX_FLAG to initialize prefixed variables to empty
  • Remove -g, sanitizer, and coverage flag appends to WRAPPER flags
  • WRAPPER_LIBS is unaffected and continues to pass needed libraries

tag @Growl1234

Author Checklist

  • Provide Description
    Particularly focus on why, not what. Reference background, issues, test failures, xfail entries, etc.
  • Commits Follow Good Practice
    Commits are self-contained and do not do two things at once.
    Commit message is of the form: module: short description
    Commit message explains what's in the commit.
  • Passes All Tests
    Whitespace checker. Warnings test. Additional tests via comments.
  • Contribution Agreement
    For non-Argonne authors, check contribution agreement.
    If necessary, request an explicit comment from your companies PR approval manager.

@hzhou

hzhou commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/most
test:mpich/ch4/most

hzhou added 2 commits August 4, 2026 21:41
Pass sanitizer ldflags to WRAPPER_LDFLAGS so the user program won't
fail with "ASan runtime does not come first in initial library list".
@hzhou
hzhou force-pushed the 2608_wrapper_flags branch from 8f99d59 to bd13e86 Compare August 5, 2026 02:54
@hzhou

hzhou commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

test:mpich/ch3/most
test:mpich/ch4/most

@Growl1234

Growl1234 commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Correct me if I'm wrong (this comment is generated with the help of AI):

This fixes the immediate leakage of CFLAGS, CXXFLAGS, FCFLAGS, etc. into the compiler wrappers. However, PAC_PREFIX_FLAG is also used by PAC_PREFIX_ALL_FLAGS(USER). With the new semantics, PAC_PREFIX_ALL_FLAGS(USER) initializes all USER_* variables to empty instead of saving the user-provided flags. These variables are subsequently used by PAC_RESET_ALL_FLAGS and PAC_RESET_LINK_FLAGS, so this may cause subconfigures to lose the original build flags.

@hzhou

hzhou commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

@Growl1234 Thanks for the good catch! You are right.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants