Skip to content

WIP: CMake: Better handle -fstack-protector flag support#2781

Merged
chriseth merged 1 commit intodevelopfrom
compiler-flags
Aug 24, 2017
Merged

WIP: CMake: Better handle -fstack-protector flag support#2781
chriseth merged 1 commit intodevelopfrom
compiler-flags

Conversation

@chfast
Copy link
Contributor

@chfast chfast commented Aug 23, 2017

No description provided.


check_cxx_compiler_flag(-fstack-protector-strong stack_protector_support)
if (stack_protector_support)
add_compile_options(-fstack-protector-strong)
Copy link
Contributor

Choose a reason for hiding this comment

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

This new way doesn't pass the -fstack-protector option anymore as it was the case before. According to gcc it seems that -strong implies the basic one too. Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

More / less yes. The -strong one is stronger. The strongest is -all. I think this only selects what function to protect...

We are skipping an exotic case where a compiler supports -fstack-protector but not -fstack-protector-strong. I can leave with this. This does not affect solidity releases.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you support both?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. And we will. I've found that GCC 4.8 has only the basic flag.

@chriseth
Copy link
Contributor

So does this PR need to be fixed or can it be merged?

@chfast chfast changed the title CMake: Better handle -fstack-protector flag support WIP: CMake: Better handle -fstack-protector flag support Aug 24, 2017
@chfast
Copy link
Contributor Author

chfast commented Aug 24, 2017

To be fixed.

@chfast
Copy link
Contributor Author

chfast commented Aug 24, 2017

@chriseth chriseth merged commit 220259d into develop Aug 24, 2017
@axic axic deleted the compiler-flags branch August 24, 2017 13:37
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

Comments