Skip to content
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

phps: Fix build with GCC 14 #393

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

phps: Fix build with GCC 14 #393

wants to merge 3 commits into from

Conversation

jtojnar
Copy link
Member

@jtojnar jtojnar commented Jan 23, 2025

No description provided.

Concatenate all the flags from array and also move to `env` attribute.
GCC 14 has gotten stricter as well.
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4989a246d7a390a859852baddb1013f825435cee?narHash=sha256-kMBQ5PRiFLagltK0sH%2B08aiNt3zGERC2297iB6vrvlU%3D' (2024-12-17)
  → 'github:NixOS/nixpkgs/5757bbb8bd7c0630a0cc4bb19c47e588db30b97c?narHash=sha256-3wFonKmNRWKq1himW9N3TllbeGIHFACI5vmLpk6moF8%3D' (2025-01-22)
@drupol
Copy link
Collaborator

drupol commented Jan 23, 2025

Current issue:

       > /nix/store/4fvc5fm8bszmkydng1ivrvr5cbvr1g60-bash-5.2p37/bin/bash /build/php-7.0.33/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext/hash/ -I/build/php-7.0.33/ext/hash/ -DPHP_ATOM_INC -I/build/php-7.0.33/include -I/build/php-7.0.33/main -I/build/php-7.0.33 -I/nix/store/vvjw3qra3bq198alp4wfbx52g46hvh0b-systemd-257.2-dev/include -I/build/php-7.0.33/ext/date/lib -I/nix/store/jjwjnbfqip6fbaii1czrfcfp6cg1s90f-libxml2-2.12.9-dev/include/libxml2 -I/nix/store/s99hv8mcyrkxznz4ljgnmbc9r12zwzgl-pcre-8.45-dev/include -I/build/php-7.0.33/TSRM -I/build/php-7.0.33/Zend    -g -O2 -fvisibility=hidden   -c /build/php-7.0.33/ext/hash/hash.c -o ext/hash/hash.lo
       > /build/php-7.0.33/ext/libxml/libxml.c: In function 'zif_libxml_use_internal_errors':
       > /build/php-7.0.33/ext/libxml/libxml.c:995:49: error: passing argument 2 of 'xmlSetStructuredErrorFunc' from incompatible pointer type []
       >   995 |                 xmlSetStructuredErrorFunc(NULL, php_libxml_structured_error_handler);
       >       |                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       >       |                                                 |
       >       |                                                 void (*)(void *, xmlError *) {aka void (*)(void *, struct _xmlError *)}
       > In file included from /nix/store/jjwjnbfqip6fbaii1czrfcfp6cg1s90f-libxml2-2.12.9-dev/include/libxml2/libxml/valid.h:15,
       >                  from /nix/store/jjwjnbfqip6fbaii1czrfcfp6cg1s90f-libxml2-2.12.9-dev/include/libxml2/libxml/parser.h:19,
       >                  from /build/php-7.0.33/ext/libxml/libxml.c:39:
       > /nix/store/jjwjnbfqip6fbaii1czrfcfp6cg1s90f-libxml2-2.12.9-dev/include/libxml2/libxml/xmlerror.h:898:57: note: expected 'xmlStructuredErrorFunc' {aka 'void (*)(void *, const struct _xmlError *)'} but argument is of type 'void (*)(void *, xmlError *)' {aka 'void (*)(void *, struct _xmlError *)'}
       >   898 |                                  xmlStructuredErrorFunc handler);
       >       |                                  ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
       > /build/php-7.0.33/ext/libxml/libxml.c: In function 'zif_libxml_get_last_error':
       > /build/php-7.0.33/ext/libxml/libxml.c:1011:15: warning: assignment discards 'const' qualifier from pointer target type []
       >  1011 |         error = xmlGetLastError();
       >       |               ^
       > At top level:
       > cc1: note: unrecognized command-line option '-Wno-incompatible-pointer-types-discards-qualifiers' may have been intended to silence earlier diagnostics
       > cc1: note: unrecognized command-line option '-Wno-incompatible-function-pointer-types' may have been intended to silence earlier diagnostics
       > cc1: note: unrecognized command-line option '-Wno-implicit-const-int-float-conversion' may have been intended to silence earlier diagnostics
       > make: *** [Makefile:668: ext/libxml/libxml.lo] Error 1
       > make: *** Waiting for unfinished jobs....
       For full logs, run 'nix log /nix/store/djfcsdm9hayg8k52j49xbs4gfv3f6fmd-php-7.0.33.drv'.
error (ignored): error: cannot unlink '"/tmp/nix-build-openssl-1.1.1w.drv-0/build/openssl-1.1.1w"': Directory not empty
error: 1 dependencies of derivation '/nix/store/lbhqb1aslj0hv6ihh1r5wii6yycqgamb-php-with-extensions-7.0.33.drv' failed to build

@jtojnar
Copy link
Member Author

jtojnar commented Jan 23, 2025

Maybe it is necessary to switch from -Wno- to -Wno-error=:

According to https://gcc.gnu.org/onlinedocs/gcc-14.2.0/gcc/Warning-Options.html#index-Werror:

  • -Werror
    Make all warnings into errors.
  • -Werror=
    Make the specified warning into an error. The specifier for a warning is appended; for example -Werror=switch turns the warnings controlled by -Wswitch into errors. This switch takes a negative form, to be used to negate -Werror for specific warnings; for example -Wno-error=switch makes -Wswitch warnings not be errors, even when -Werror is in effect.

@drupol
Copy link
Collaborator

drupol commented Jan 23, 2025

IMO, I think we should not spend too much time on this and use the most simple and straightforward solution to fix these old and unmaintained PHP versions.
If you believe that changing that flag might fix the issue, then let's go for it and move on!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants