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

Binaries built by SEQ_CC do not use build flags such as CFLAGS CPPFLAGS LDFLAGS #121

Closed
loqs opened this issue Feb 12, 2024 · 4 comments
Closed

Comments

@loqs
Copy link

loqs commented Feb 12, 2024

This was partially addressed in 5d8cfaa which was reverted in 000d67f.
I am currently working around this with SEQ_CC="$CC $CPPFLAGS $CFLAGS $LDFLAGS" to add hardening such as FULL RELRO to cdfdiff ncoffsets pnetcdf-openmpi ncvalidator.
PnetCDF checkpoint.1.12.3 built using:

./configure --prefix=/usr --enable-shared --enable-netcdf4
make
@wkliao
Copy link
Member

wkliao commented Feb 13, 2024

Reusing CFLAGS for MPI compilers when compiling utility programs designed to run sequentially
can cause problems in the cross-compile environment.

One way to solve the problem in your case is to introduce new environment variables, such as
SEQ_CFLAGS and SEQ_LDFLAGS. Will that work for your case? e.g.

./configure SEQ_CC=gcc SEQ_CFLAGS="-Wl,-z,relro,-z,now" SEQ_LDFLAGS="-lc"

@loqs
Copy link
Author

loqs commented Feb 13, 2024

New environment variables would work for my use case. Thank you very much for the fast response and explanation of the issue.

@wkliao
Copy link
Member

wkliao commented Feb 13, 2024

Three environment variables SEQ_CFLAGS, SEQ_LDFLAGS, and SEQ_LIBS have
been added in PR #122, which has also been merged into the master branch.
If you would like to give it a try, please let me know if that works.

@loqs
Copy link
Author

loqs commented Feb 13, 2024

I have tried #122 and with SEQ_CFLAGS and SEQ_LDFLAGS set and the options are being applied. Thank you for the fast fix.

@wkliao wkliao closed this as completed Feb 13, 2024
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

No branches or pull requests

2 participants