package/python-pycryptodomex: fix package build with gcc 4.8
A message that is not in the archive (sent off-list or not yet received): [email protected]
Yann E. MORIN
AppliedOleg, All,
On 2023-10-27 18:52 +0300, Oleg Lyovin via buildroot spake thusly:
Quoted 17 lines
python-pycryptodomex uses C99 features like variable declaration in for-loop statement, while old compilers assumes C89 by default.
This patch explicitly specifies C99 standard.
Change-Id I934211714307cea43541167fbc72ff30fb66ad5fSigned-off-by Oleg Lyovin <[email protected]>--- package/python-pycryptodomex/python-pycryptodomex.mk | 6 ++++++ 1 file changed, 6 insertions(+)package/python-pycryptodomex/python-pycryptodomex.mk +0
-0
package/python-pycryptodomex/python-pycryptodomex.mk PYTHON_PYCRYPTODOMEX_LICENSE = \ · line 20
Quoted 8 lines
package/python-pycryptodomex/python-pycryptodomex.mk +5
-0@@ -13,5 +13,11 @@ PYTHON_PYCRYPTODOMEX_LICENSE = \ Public Domain (pycrypto original code) PYTHON_PYCRYPTODOMEX_LICENSE_FILES = LICENSE.rst Doc/LEGAL/COPYRIGHT.pycrypto +PYTHON_PYCRYPTODOMEX_CFLAGS = -std=c99 + +PYTHON_PYCRYPTODOMEX_ENV = \ + CFLAGS="$(PYTHON_PYCRYPTODOMEX_CFLAGS)" +HOST_PYTHON_PYCRYPTODOMEX_ENV = $(PYTHON_PYCRYPTODOMEX_ENV)
It is weird to use the target settings for the host settings, even if they appear to be identical. Instead, we prefer duplicating the assignment; indeed if the target variable gains target-related settings in the future, they would inadvertently leak into the host variant.
The second issue is that (AFAIU) passing CFLAGS in the environment will override the other CFLAGS we set in our infrastructure, and we instead must complement them, see for example how it's done in python-brotli.
So, I've done that, and... the target settings leaked into the host variable...
So, I've fixed that so that the host and target variant are based of the TARGET/HOST_CFLAGS, plus -std=c99
Applied to master with the above fix, thanks.
Regards,
Yann E. MORIN.
Quoted 9 lines
package/python-pycryptodomex/python-pycryptodomex.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))Signature · 6 lines
2.42.0.270.gbcb6cae296 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Yann,
Quoted 41 lines · Yann E. MORIN
Oleg, All,
On 2023-10-27 18:52 +0300, Oleg Lyovin via buildroot spake thusly:
Quoted 17 lines
python-pycryptodomex uses C99 features like variable declaration in for-loop statement, while old compilers assumes C89 by default.
This patch explicitly specifies C99 standard.
Change-Id I934211714307cea43541167fbc72ff30fb66ad5fSigned-off-by Oleg Lyovin <[email protected]>--- package/python-pycryptodomex/python-pycryptodomex.mk | 6 ++++++ 1 file changed, 6 insertions(+)package/python-pycryptodomex/python-pycryptodomex.mk +0
-0package/python-pycryptodomex/python-pycryptodomex.mk PYTHON_PYCRYPTODOMEX_LICENSE = \ · line 20
Quoted 8 lines
package/python-pycryptodomex/python-pycryptodomex.mk +5
-0@@ -13,5 +13,11 @@ PYTHON_PYCRYPTODOMEX_LICENSE = \ Public Domain (pycrypto original code) PYTHON_PYCRYPTODOMEX_LICENSE_FILES = LICENSE.rst Doc/LEGAL/COPYRIGHT.pycrypto +PYTHON_PYCRYPTODOMEX_CFLAGS = -std=c99 + +PYTHON_PYCRYPTODOMEX_ENV = \ + CFLAGS="$(PYTHON_PYCRYPTODOMEX_CFLAGS)" +HOST_PYTHON_PYCRYPTODOMEX_ENV = $(PYTHON_PYCRYPTODOMEX_ENV)It is weird to use the target settings for the host settings, even if they appear to be identical. Instead, we prefer duplicating the assignment; indeed if the target variable gains target-related settings in the future, they would inadvertently leak into the host variant.
The second issue is that (AFAIU) passing CFLAGS in the environment will override the other CFLAGS we set in our infrastructure, and we instead must complement them, see for example how it's done in python-brotli.
So, I've done that, and... the target settings leaked into the host variable...
Quoted 18 lines
So, I've fixed that so that the host and target variant are based of the TARGET/HOST_CFLAGS, plus -std=c99
Applied to master with the above fix, thanks.
Regards,
Yann E. MORIN.Quoted 9 lines
package/python-pycryptodomex/python-pycryptodomex.mk +0
-0$(eval $(python-package)) $(eval $(host-python-package))Signature · 6 lines
2.42.0.270.gbcb6cae296 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Much appreciate for the great explanation and patch fix!
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Oleg" == Oleg Lyovin via buildroot <[email protected]> writes:
python-pycryptodomex uses C99 features like variable declaration in for-loop statement, while old compilers assumes C89 by default.
This patch explicitly specifies C99 standard.
Change-Id I934211714307cea43541167fbc72ff30fb66ad5fSigned-off-by Oleg Lyovin <[email protected]>
Committed to 2023.08.x, thanks.
Signature · 5 lines
Bye, Peter Korsgaard _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot