Skip to content

Delete broken checks for GCC version that break -fstack-protector-strong#478

Merged
bgotowal merged 1 commit intointel:mainfrom
berrange:gcc-version-checks
Mar 31, 2026
Merged

Delete broken checks for GCC version that break -fstack-protector-strong#478
bgotowal merged 1 commit intointel:mainfrom
berrange:gcc-version-checks

Conversation

@berrange
Copy link
Copy Markdown
Contributor

@berrange berrange commented Dec 4, 2025

The expr comparison is performing a string comparison and is thus broken for any GCC version >= 10, preventing use of -fstack-protector-strong

Since GCC 4.9 was released over 9 years ago (Aug 2016), it is thought reasonable to just drop the conditional check and assume -fstack-protector-strong is always available for GCC.

@berrange
Copy link
Copy Markdown
Contributor Author

Fixes #447

Comment thread QuoteGeneration/quote_wrapper/qgs_msg_lib/linux/Makefile Outdated
Comment thread QuoteGeneration/quote_wrapper/tdx_attest/linux/Makefile
Comment thread QuoteGeneration/buildenv.mk
Comment thread QuoteVerification/dcap_tvl/Makefile
Comment thread QuoteVerification/dcap_tvl/Makefile.standalone
Comment thread QuoteVerification/QvE/Makefile Outdated
Comment thread tools/PCKRetrievalTool/Makefile
Copy link
Copy Markdown
Contributor

@bgotowal bgotowal left a comment

Choose a reason for hiding this comment

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

Thank you for proposing the changes!

As noted in #447, we've done modifications in similar areas as part of flag usage refactor in 8814a5e.

Yet, I still see some of you changes worth merging as apparently we've not covered all the fixes. Unsure if you're willing to resolve the conflicts to proceed with this PR...

Looking forward to hearing from you!

@berrange
Copy link
Copy Markdown
Contributor Author

Yet, I still see some of you changes worth merging as apparently we've not covered all the fixes. Unsure if you're willing to resolve the conflicts to proceed with this PR...

Looking forward to hearing from you!

Sure, I'll put this on my to do list to rebase and drop any obsolete pieces.

@bgotowal bgotowal self-assigned this Mar 17, 2026
The expr comparison is performing a string comparison and is thus
broken for any GCC version >= 10, preventing use of -fstack-protector-strong

Since GCC 4.9 was released almost 10 years ago (Aug 2016), it is reasonable
to drop the conditional check and assume -fstack-protector-strong is always
available for GCC.

A number of equivalent changes tht assume -fstack-protector-strong were
also already made in

  commit 8814a5e
  Author: aplatasz <anna.platasz@intel.com>
  Date:   Wed Jan 21 09:58:00 2026 +0100

    Security related flags added

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
@berrange berrange force-pushed the gcc-version-checks branch from d9bee99 to 128eb5a Compare March 26, 2026 17:25
@berrange
Copy link
Copy Markdown
Contributor Author

This is now rebased to latest git main

Copy link
Copy Markdown
Contributor

@bgotowal bgotowal left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for adjusting the code to the recent changes and contributing to DCAP!

@bgotowal bgotowal merged commit 2d483e3 into intel:main Mar 31, 2026
2 checks passed
else
Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections -fstack-protector-strong
endif
Enclave_C_Flags := $(SGX_COMMON_CFLAGS) -nostdinc -fvisibility=hidden -fpie -ffunction-sections -fdata-sections
Copy link
Copy Markdown
Contributor

@bgotowal bgotowal Mar 31, 2026

Choose a reason for hiding this comment

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

Hi @berrange! Just noticed, unfortunately post merging, that here we miss the -fstack-protector-strong added at the end.

I think we can fix it internally and push in the next release cycle as this is not critical here in the samples.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Opps, sorry about that mess up.

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