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

Unset _FORTIFY_SOURCE before setting it to fix error about redefinition #165

Merged
merged 1 commit into from
Oct 18, 2021

Conversation

sburton84
Copy link
Contributor

When building for the x86_64-fortanix-unknown-sgx target in release mode I receive the following errors:

  <command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]
  <built-in>: note: this is the location of the previous definition
  <command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]
  <built-in>: note: this is the location of the previous definition
  cc1: all warnings being treated as errors

I think these would only be warnings but MBEDTLS_FATAL_WARNINGS defaults to ON which makes them into errors.

This patch fixes this by explicitly unsetting _FORTIFY_SOURCE before setting it to a new value.

@jethrogb
Copy link
Member

Thanks for the PR!

I think we used to have -U but removed that for some reason, so I'm not immediately inclined to land this as is. Which C compiler are you using?

@sburton84
Copy link
Contributor Author

Which C compiler are you using?

Currently using this version of GCC: gcc (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0

@jethrogb
Copy link
Member

I think we used to have -U but removed that for some reason, so I'm not immediately inclined to land this as is.

Actually I misremembered. We do both in the build script for mbedtls, but not mbedtls-sys.

@sburton84
Copy link
Contributor Author

The CI build failures seem to be due to an unrelated issue (rust-lang/rust#82730 I think)

@jethrogb
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Oct 18, 2021
@bors
Copy link
Contributor

bors bot commented Oct 18, 2021

try

Build succeeded:

  • continuous-integration/travis-ci/push

@jethrogb
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 18, 2021

Build succeeded:

@bors bors bot merged commit e7e9f98 into fortanix:master Oct 18, 2021
shuwens added a commit to shuwens/rust-mbedtls that referenced this pull request Nov 29, 2021
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.

2 participants