-
Notifications
You must be signed in to change notification settings - Fork 36.6k
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
depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin #12466
Conversation
Obvious utACK, sorry for merging before @theuni could get a look at it. |
@laanwj No worries! Unfortunately this isn't quite as obvious as it looks. This change would clobber any default cflags. @fanquake Could you give this a try? diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk
index 9976db43c2..0a17f07e22 100644
--- a/depends/packages/miniupnpc.mk
+++ b/depends/packages/miniupnpc.mk
@@ -5,11 +5,10 @@ $(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9cc220b7
define $(package)_set_vars
-$(package)_build_opts=CC="$($(package)_cc)"
+$(package)_build_opts=CC="$($(package)_cc)" AR="$($(package)_ar)"
$(package)_build_opts_darwin=OS=Darwin LIBTOOL="$($(package)_libtool)"
$(package)_build_opts_mingw32=-f Makefile.mingw
-$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
-$(package)_build_env+=CFLAGS=-D_DARWIN_C_SOURCE
+$(package)_cppflags_darwin+=-D_DARWIN_C_SOURCE
endef
define $(package)_preprocess_cmds
@@ -19,7 +18,7 @@ define $(package)_preprocess_cmds
endef
define $(package)_build_cmds
- $(MAKE) libminiupnpc.a $($(package)_build_opts)
+ CFLAGS="$($(package)_cflags) $($(package)_cppflags)" $(MAKE) libminiupnpc.a $($(package)_build_opts)
endef
define $(package)_stage_cmds |
BTW; isn't this something that should ideally be fixed upstream? |
535a8ee
to
e650112
Compare
@theuni using the patch you suggested, -D_DARWIN_C_SOURCE is now appearing twice in the build flags:
I've pushed up your changes without the cppflags_darwin addition, we'll see what Travis thinks. |
Looks like -D_DARWIN_C_SOURCE is being added without the specific cppflags_darwin +=.
|
@fanquake good catch! Upstream did add the define, as @laanwj mentioned that they should. Our issue turns out to be that upstream added cross-build detection, which we partially override by defining OS. If we just let it be discovered as intended, all is fine. The problem you're seeing now is that LIBTOOL isn't defined (apple has a libtool utility that can handle ar's features, it's unrelated to gnu libtool). Looks like the fix is as simple as: --- a/depends/packages/miniupnpc.mk
+++ b/depends/packages/miniupnpc.mk
@@ -6,10 +6,9 @@ $(package)_sha256_hash=90dda8c7563ca6cd4a83e23b3c66dbbea89603a1675bfdb852897c2c9
define $(package)_set_vars
$(package)_build_opts=CC="$($(package)_cc)"
-$(package)_build_opts_darwin=OS=Darwin LIBTOOL="$($(package)_libtool)"
+$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)"
$(package)_build_opts_mingw32=-f Makefile.mingw
$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)"
-$(package)_build_env+=CFLAGS=-D_DARWIN_C_SOURCE
endef
define $(package)_preprocess_cmds |
e650112
to
65754fd
Compare
65754fd
to
992f568
Compare
…pnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
Summary: ``` miniupnpc changelog: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.0.20180203.tar.gz 2.0.20180203 includes fixes for the recent buffer overflow and segfault issues, see miniupnp/miniupnp#268. expat changelog: https://github.com/libexpat/libexpat/blob/R_2_2_5/expat/Changes 2.2.2 & 2.2.3 included security fixes. Also includes latest config.guess and config.sub. ``` This updates our depends version for expat, miniupnpc, config.guess and config.sub. The ccache version is **NOT** updated (see D5503). It also includes a fix for miniupnpc. Backport of core [[bitcoin/bitcoin#12402 | PR12402]] and [[bitcoin/bitcoin#12466 | PR12466]]. Depends on D5502 and D5503. *Note to reviewers:* the diff ends up fairly large due to the pull of config.guess and config.sub. However this is mostly formatting changes (`${FOO}` vs `$FOO` in particular), and there was no merge conflict during the cherry-pick. Test Plan: Run the Gitian builds twice, ensure the build is still deterministic. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5504
Summary: ``` miniupnpc changelog: http://miniupnp.free.fr/files/changelog.php?file=miniupnpc-2.0.20180203.tar.gz 2.0.20180203 includes fixes for the recent buffer overflow and segfault issues, see miniupnp/miniupnp#268. expat changelog: https://github.com/libexpat/libexpat/blob/R_2_2_5/expat/Changes 2.2.2 & 2.2.3 included security fixes. Also includes latest config.guess and config.sub. ``` This updates our depends version for expat, miniupnpc, config.guess and config.sub. The ccache version is **NOT** updated (see D5503). It also includes a fix for miniupnpc. Backport of core [[bitcoin/bitcoin#12402 | PR12402]] and [[bitcoin/bitcoin#12466 | PR12466]]. Depends on D5502 and D5503. *Note to reviewers:* the diff ends up fairly large due to the pull of config.guess and config.sub. However this is mostly formatting changes (`${FOO}` vs `$FOO` in particular), and there was no merge conflict during the cherry-pick. Test Plan: Run the Gitian builds twice, ensure the build is still deterministic. Reviewers: #bitcoin_abc, deadalnix Reviewed By: #bitcoin_abc, deadalnix Subscribers: deadalnix Differential Revision: https://reviews.bitcoinabc.org/D5504
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
…g miniupnpc on darwin 992f568 depends: Only use D_DARWIN_C_SOURCE when building miniupnpc on darwin (fanquake) Pull request description: Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere. cc @theuni Tree-SHA512: e49a8456ba2b9925c06e62c73e139152b6d63cc5a4cee66944e41c863ca9103e98ac81a5718eceb3d0885a677fc53ece34062b02c304a05c3280e094965e856a
Only use D_DARWIN_C_SOURCE when building on darwin, so we don't inadvertently introduce issues elsewhere.
cc @theuni