Commit 067df26
1 parent d312a0c commit 067df26
File tree
11 files changed
+39
-9
lines changed- Zend
- ext
- pdo_firebird
- zlib
- main
- streams
- sapi/fpm/fpm
11 files changed
+39
-9
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
214 | 218 |
| |
215 | 219 |
| |
216 | 220 |
| |
| |||
222 | 226 |
| |
223 | 227 |
| |
224 | 228 |
| |
| 229 | + | |
225 | 230 |
| |
226 | 231 |
| |
227 | 232 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
29 | 31 |
| |
30 | 32 |
| |
31 | 33 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
265 | 265 |
| |
266 | 266 |
| |
267 | 267 |
| |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
268 | 274 |
| |
269 | 275 |
| |
270 | 276 |
| |
| |||
609 | 615 |
| |
610 | 616 |
| |
611 | 617 |
| |
| 618 | + | |
612 | 619 |
| |
613 | 620 |
| |
614 | 621 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
21 |
| - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
22 | 24 |
| |
23 | 25 |
| |
24 | 26 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15 | 15 |
| |
16 | 16 |
| |
17 | 17 |
| |
18 |
| - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
19 | 21 |
| |
20 | 22 |
| |
21 | 23 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
76 | 78 |
| |
77 | 79 |
| |
78 | 80 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
18 | 20 |
| |
19 | 21 |
| |
20 | 22 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 |
| |
22 | 24 |
| |
23 | 25 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
4 | 6 |
| |
5 | 7 |
| |
6 | 8 |
| |
|
8 commit comments
jmikola commentedon Dec 8, 2021
@dstogov: I was testing
ext-mongodb
against PHP'smaster
branch and ran into several "implicit declaration" warnings formemrchr
, which lead me to this commit. Does this impact third-party extensions that may also include<string.h>
(either directly or through other dependencies)? If so, does this warrant a note in UPGRADING.INTERNALS?Adding
-D_GNU_SOURCE
to our CFLAGS inconfig.m4
seemed to do the trick. Not sure aboutconfig.w32
(or if this is even relevant there), but I'd plan to look into that down the line.dstogov commentedon Dec 8, 2021
@jmikola sorry for troubles. You already explained almost everything yourself.
Prototype of
memrchr
is defined in<string.h>
, but it's visible only if<string.h>
included after_GNU_SOURCE
is defined.Actually,
_GNU_SOURCE
is defined inconfig.h
but some sources include<string.h>
beforeconfig.h
.We fixed this in main PHP source tree by adding
-D_GNU_SOURCE
intoCFLAGS
, but I didn't think about third-party extensions.Probably, we will need to add
-D_GNU_SOURCE
throughphpize
. I'll try to take a look.Windows build shouldn't be affected.
jmikola commentedon Feb 15, 2022
@dstogov: I was just reminded about this comment chain while sorting through my GitHub notifications.
Is this still outstanding and/or being tracked anywhere? I haven't compiled
ext-mongodb
against the master branch since I first reported this, but figured there was no harm in asking.derickr commentedon Jun 16, 2022
@dstogov I am running into this with Xdebug on PHP 8.2 as well now, and forcing to add
-D_GNU_SOURCE
in myconfig.m4
does the trick, but of course meaningless for platforms withoutGNU
on it, although it doesn't hurt. The following patch makes it work for me on Linux at least, and I can make a PR so that everything on CI checks this (if phpize is checked at all somehow):derickr commentedon Jun 16, 2022
I've made a PR for this now: #8807
derickr commentedon Jun 17, 2022
And FWIW @jmikola , this PR is now merged.
jmikola commentedon Jul 14, 2023
@dstogov: Hello again. Fancy coincidence coming back to this issue after all this time.
The MongoDB driver recently received an issue (mongodb/mongo-php-driver#1445) reporting a build failure with PHP 8.2 and Alpine Linux, which is due to one of our dependencies failing to detect the version of strerror_r(3) being used (XSI or GNU). The user tested a wide span of PHP versions and their research lead them back to the
configure.ac
changes in this commit, which added-D_GNU_SOURCE
to PHP's build options. They also reported that the behavior was identical when buildingext-mongodb
on its own or as a static extension, which may be thanks to @derickr's previousphpize
PR.Anyway, we're tracking the issue in CDRIVER-4679 and will get it sorted out.
The main reason I'm commenting here is to ask whether PHP might have a similar issue with
strerror_r()
compatibility. A code search revealed that is called once inzend_strerror_noreturn()
. PHP ignores the return value, which makes it immune to theint-conversion
error we experienced, but I think it may not be handling an edge case in the GNU variation. Consider the following from the man page description (emphasis mine):If the GNU variant of
strerror_r()
returns a pointer to a static string,buf
is left empty and the returned message will be incomplete. This wouldn't manifest as a build error, but it seems like it could be a subtle bug. I'm not familiar with howzend_strerror_noreturn()
is used but I wanted to bring this to your attention.dstogov commentedon Jul 24, 2023
@jmikola I supose the problem should be fixed by #11624