Skip to content

Conversation

@theuni
Copy link
Member

@theuni theuni commented Aug 1, 2017

For depends builds without this, configure thinks that the user has overridden CXXFLAGS manually, when really they've just been set by the config.site.

The effect is that warnings and extra cxxflags (sse4.2 for example) were not being added.

@laanwj laanwj added this to the 0.15.0 milestone Aug 2, 2017
@laanwj
Copy link
Member

laanwj commented Aug 2, 2017

But what if CXXFLAGS is overridden manually with a depends build?
(or is that not supported/possible)

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

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

But what if CXXFLAGS is overridden manually with a depends build?
(or is that not supported/possible)

It does seem to be possible:

CXXFLAGS="@CXXFLAGS@ $CXXFLAGS"

Could handle this case by adding a line to config.site like USER_CXXFLAGS="$CXXFLAGS" and changing the condition added here to && test "x${USER_CXXFLAGS+set}" = x -o -n "$USER_CXXFLAGS"

Or if this is too complicated, it would be good to add a comment explaining the ac_site_file check, since it is slightly broken.

@theuni
Copy link
Member Author

theuni commented Aug 3, 2017

Yep, what @ryanofsky said. I was trying to keep this simple.

I think that's a good suggestion though, will do.

This avoids a counter-intuitive drop in performance when manually adjusting the
flags.
@theuni theuni force-pushed the fix-config-override branch from 4397a5b to 9baca41 Compare August 4, 2017 19:45
@theuni
Copy link
Member Author

theuni commented Aug 4, 2017

After experimenting with this for far too long, I've decided that it just doesn't make sense to tie sse42 to CXXFLAGS.

Gitian, for example, sets the CXXFLAGS manually in order to enable debugging. Linux distros will probably set them to "-O2" by default to reduce the object size. Gentoo will have some value set by the user's flags. Etc. All of those would end up with quietly disabled crc optimizations.

Instead, I think we should just enable this flags if they work, possibly behind configure switches.

For 0.15, I propose that we just keep it simple and always check for sse42, and punt worrying about the warnings until 0.16.

@theuni theuni changed the title build: fix missing warnings and sse42 in depends builds build: fix missing sse42 in depends builds Aug 4, 2017
@laanwj
Copy link
Member

laanwj commented Aug 5, 2017

Not coupling sse42 to CXXFLAGS override seems like a better solution to me, too. Thanks.
utACK 9baca41

@laanwj laanwj merged commit 9baca41 into bitcoin:master Aug 5, 2017
laanwj added a commit that referenced this pull request Aug 5, 2017
9baca41 build: always attempt to enable targeted sse42 cxxflags (Cory Fields)

Pull request description:

  For depends builds without this, configure thinks that the user has overridden CXXFLAGS manually, when really they've just been set by the config.site.

  The effect is that warnings and extra cxxflags (sse4.2 for example) were not being added.

Tree-SHA512: 9fd615ad0e926bd9d6b541ffcf7fc555e2147e8761f57ff3b5fb5d196c9cef0f26aa99681ff72db8c83c0f9a7ed91f4253f46bab09f2c835044b68047358fa47
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Aug 12, 2019
9baca41 build: always attempt to enable targeted sse42 cxxflags (Cory Fields)

Pull request description:

  For depends builds without this, configure thinks that the user has overridden CXXFLAGS manually, when really they've just been set by the config.site.

  The effect is that warnings and extra cxxflags (sse4.2 for example) were not being added.

Tree-SHA512: 9fd615ad0e926bd9d6b541ffcf7fc555e2147e8761f57ff3b5fb5d196c9cef0f26aa99681ff72db8c83c0f9a7ed91f4253f46bab09f2c835044b68047358fa47
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants