Building apache2handler with APR 1.7.5 fails if compiler doesn't support __has_attribute
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
Description
Not quite sure where to report this yet, so I'm starting here.
A commit exhibiting the problem has made it into latest APR 1.7.5. The assumption that __has_attribute would be predefined is valid in theory, but not in practise. E.g. ap_config.h defines __has_attribute to 0 in case it is not defined. php-src does the same at least in TSRM.h, zend_portability.h and zend_cpuinfo.h. In my opinion, this is bad practise and should be fixed; see e.g. xxhash.h for a proper solution. Of course, the existing definitions might be relied upon by downstream consumers of our headers, so changing this would be an API break.
Anyhow, coming back to the issue at hand, I wonder whether apache2handler is even supposed to include ap_config.h explicitly. If not, we can neither blame httpd nor APR, since latest httpd can apparently be successfully built against latest APR with a compiler not supporting __has_attribute.
PHP Version
any
Operating System
any
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the apache2handler build and its inclusion of ap_config.h, then compare the relevant __has_attribute handling with APR 1.7.5 and the definitions in TSRM.h, zend_portability.h, and zend_cpuinfo.h. Reproduce the failure with a compiler that lacks __has_attribute and determine whether the include or compatibility behavior is responsible; done means the affected build succeeds without breaking the stated header compatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- apache, c
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100