Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix compilation on el9 with older pmix releases #106

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

garlick
Copy link
Member

@garlick garlick commented Dec 11, 2024

Problem: compilation fails in the TOSS 5 build farm with pmix-3.2.5.

pmix.c: In function 'op_initialize.part.0':
pmix.c:175:10: error: 'PMIx_Get' reading 512 bytes from a region of size 14 [-Werror=stringop-overread]
175 | rc = PMIx_Get (&proc, PMIX_JOB_SIZE, NULL, 0, &val);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pmix.c:175:10: note: referencing argument 2 of type 'const char *'
In file included from pmix.c:21:
/usr/include/pmix.h:203:27: note: in a call to function 'PMIx_Get'
203 | PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, const pmix_key_t key,
| ^~~~~~~~
cc1: all warnings being treated as errors

This is probably due to the fact that PMIx_Get() in pmix-3.2.5 is prototyped with the second arg effectively 'const char key[512]'. It is declared as a 'const char key[]' in modern pmix releases.

Since PMIx_Get() is used in more than one place, disable the promotion of that warning to an error project-wide.

Fixes #100

Copy link
Contributor

@grondo grondo left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me!

@garlick
Copy link
Member Author

garlick commented Dec 11, 2024

Aw crap, I thought those warning suppressions were ignored if unknown

2024-12-11T21:39:54.4103071Z Making all in src/common/libccan
2024-12-11T21:39:54.4675106Z   CC       ccan/base64/base64.lo
2024-12-11T21:39:54.4675717Z cc1: error: -Werror=stringop-overread: no option -Wstringop-overread

I guess we'll have only use it where supported.

Problem: compilation fails in the TOSS 5 build farm with pmix-3.2.5.

  pmix.c: In function 'op_initialize.part.0':
  pmix.c:175:10: error: 'PMIx_Get' reading 512 bytes from a region of size 14 [-Werror=stringop-overread]
    175 |     rc = PMIx_Get (&proc, PMIX_JOB_SIZE, NULL, 0, &val);
        |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  pmix.c:175:10: note: referencing argument 2 of type 'const char *'
  In file included from pmix.c:21:
  /usr/include/pmix.h:203:27: note: in a call to function 'PMIx_Get'
    203 | PMIX_EXPORT pmix_status_t PMIx_Get(const pmix_proc_t *proc, const pmix_key_t key,
        |                           ^~~~~~~~
  cc1: all warnings being treated as errors

This is probably due to the fact that PMIx_Get() in pmix-3.2.5 is
prototyped with the second arg effectively 'const char key[512]'.
It is declared as a 'const char key[]' in modern pmix releases.

Since PMIx_Get() is used in more than one place, disable the promotion
of that warning to an error project-wide.

Since older compilers don't accept the option, add a configure test
for it.

Fixes flux-framework#100
@garlick
Copy link
Member Author

garlick commented Dec 11, 2024

ok that's got it. I'll set MWP.

@garlick garlick added the merge-when-passing Let mergify auto-rebase and merge when CI passes label Dec 11, 2024
@mergify mergify bot merged commit 2442071 into flux-framework:main Dec 11, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-when-passing Let mergify auto-rebase and merge when CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rhel 9 compilation errors
2 participants