Skip to content

Explicitly drop support for old clang versions on Windows #15415

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

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 14, 2024

This ensures compatibility with the typedef redefinitions we use, and makes it clear during the configure stage that old compiler versions are not supported.

See https://releases.llvm.org/ regarding the release history of clang.


Note that clang 3.1.0 added support for C11, and that may include support for typedef redefinitions, but I'm not sure about that. And the oldest clang I've managed to install on my machine is 4.0.0. I did a minimal PHP build successfully, so I'm reasonable sure that the typedef redifinition won't cause an issue as of clang 4.0.0. And frankly, I don't see much point in claiming support for even older clang versions, while clang 4.0.0 has been released on 2017-03-13, and I'm not even sure that newer clang versions are fully supported with PHP on Windows.

This ensures compatibility with the typedef redefinitions we use, and
makes it clear during the `configure` stage that old compiler versions
are not supported.

See <https://releases.llvm.org/> regarding the release history of clang.
Up to clang 3.4, the versions had no revision number; only as of clang
3.4.1 they have, and since we're going to drop support for such old
versions anyway, we don't need to cater to two number versions any
longer.
@cmb69
Copy link
Member Author

cmb69 commented Aug 14, 2024

Note that in combination with PR #15403, this ensures compatibility with master (at least basic compatibility). There is, however, a third "supported" toolset on Windows, namely ICC. I have never used it, so I have no idea whether it is actually still useable, but I don't really mind sticking with what we have for ICC (and possibly let users report issues).

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM

@cmb69
Copy link
Member Author

cmb69 commented Aug 15, 2024

I'm going to commit this, since attempting to support much older versions would cause more issues. E.g. there is

#elif defined(_MSC_VER) && _MSC_VER >= 1800 && !defined(__clang__)
# define ZEND_FASTCALL __vectorcall

So ZEND_FASTCALL for x64 builds is __vectorcall for MSVC, but __cdecl for clang. Of course, this is bad for interoperability, and likely causes linker issues (especially for clang < 13, which may fall back to MSVC compilation). Note that the clang exclusion had been commit on 2015-07-19, so targeted clang <= 3.6.2, while __vectorcall support has been added to clang as of 3.6.0. Maybe back then there have been glitches, or only an older clang version had been tested (clang 3.5.2 had only been released a few months prior to this commit).

@cmb69 cmb69 merged commit b0ac9bf into php:master Aug 15, 2024
10 checks passed
@cmb69 cmb69 deleted the cmb/bump-clang branch August 18, 2024 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants