Bug 240883 - Mk/Uses/php.mk: fix build of all PHP modules when using php74 on GCC architectures
Summary: Mk/Uses/php.mk: fix build of all PHP modules when using php74 on GCC architec...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-27 20:47 UTC by Piotr Kubaj
Modified: 2019-10-07 14:32 UTC (History)
3 users (show)

See Also:
ale: maintainer-feedback+
pkubaj: exp-run?


Attachments
patch (762 bytes, patch)
2019-09-27 20:47 UTC, Piotr Kubaj
no flags Details | Diff
v2 (817 bytes, patch)
2019-09-29 09:34 UTC, Piotr Kubaj
pkubaj: maintainer-approval? (ale)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer 2019-09-27 20:47:44 UTC
Created attachment 207902 [details]
patch

php74 introduced C11 requirement and all optional PHP modules available in the ports tree need a patch like this:

.include <bsd.port.options.mk>
.if ${FLAVOR} == php74
USES+=compiler:c11
.endif

With over 400 ports that need, it's not feasible to fix. And there will be php75 (or 80) next year which will require all those ports to be fixed again.

Change php.mk to fix it in one place.

Additionally, fix a typo.
Comment 1 Piotr Kubaj freebsd_committer 2019-09-29 09:31:26 UTC
Don't commit it yet, it looks like the ports that I was testing it for were inheriting compiler:c11 from lang/php74. It doesn't seem to work for ports that don't.

root@talos:$/usr/ports/security/pecl-mcrypt$ make FLAVOR=php74 -V USES
php:pecl compiler:c11
root@talos:$/usr/ports/security/pecl-mcrypt$ make FLAVOR=php74 -V CC
cc
Comment 2 Piotr Kubaj freebsd_committer 2019-09-29 09:34:32 UTC
Created attachment 207931 [details]
v2

This seems to work, but powerpc* switches to LLVM when LLVM9 is merged to head, so it will need some modifications in the coming weeks.
Comment 3 Alex Dupre freebsd_committer 2019-10-07 07:32:36 UTC
Why the previous patch doesn't work and why do we not have USE_GCC for those archs in lang/php74 Makefile?
Comment 4 Piotr Kubaj freebsd_committer 2019-10-07 14:32:12 UTC
(In reply to Alex Dupre from comment #3)
"Why the previous patch doesn't work"
It's probably because USES is added too late, it should be in the Makefile instead. When added to Mk/Uses, USES value is actually changed, but CC doesn't change.

Look at Mk/Uses/qt-dist.mk, it's done the same way.

"why do we not have USE_GCC for those archs in lang/php74 Makefile"
We do have USES=compiler:c11 (which sets USE_GCC on GCC platforms), but that only works for php74 and the ports that include lang/php74/Makefile (all */php74-* ports, e.g. archivers/php74-bz2).