Hi, When compiling this package using this port on a amd64/x86_64 machine, no JIT support will be compiled for PCRE2. > checking for JIT support in PCRE2... no PCRE2 JIT is supported on amd64/x86_64 and this not being compiled can cause a (sometimes huge) performance decrease in certain PHP scripts relying on regex matching. In the Makefile the following line is specified: GNU_CONFIGURE= yes This option will append this to the configure arguments. --build=${CONFIGURE_TARGET} Where CONFIGURE_TARGET defaults to ${ARCH}-portbld-${OPSYS:tl}${OSREL}, and $ARCH in our case is "amd64". Specifying --build to the PHP configure script will override PHP:s "config.guess" which otherwise will try to find out which machine it's building for. If "config.guess" HAD run, it whould have discovered "amd64" but then translated it to "x86_64" before returning it. Now instead, because of the --build is stating the target architecture, the configure script have the value "amd64". Later in the script, when deciding if it should compile with HAVE_PCRE_JIT_SUPPORT, it runs the following check. 19706 case $host_cpu in 19707 arm*|i3456786|x86_64|mips*|powerpc*|sparc) The check will fail as $host_cpu is "amd64" which it doesn't think is a supported architecture and no JIT support will be compiled into the binary.
I ran som tests and the problem was not what I wrote from the beginning. Sorry for that. The problem with the name of the cpu architecture is only when cross compiling PHP. The real problem seems to be that the PHP installer is running a test script to determine if PCRE2 have JIT support. But the script fails when including the PCRE library header (#include <pcre2.h>). This is because PHP is looking for the header files in /usr/include, when they are actually in /usr/local/include. "./configure --help" says: Some influential environment variables: CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if you have headers in a nonstandard directory <include dir> So my solution and proposed change to fix this is adding this row to the Makefile: CONFIGURE_ENV= CPPFLAGS="-I/usr/local/include"
A commit references this bug: Author: tz Date: Fri May 3 22:31:47 UTC 2019 New revision: 500756 URL: https://svnweb.freebsd.org/changeset/ports/500756 Log: lang/php73: enable PRCE2 JIT support This will speed up certain PHP scripts relying on regex matches. PR: 237722 Submitted by: Jon Tejnung <jon@herrskogen.se> Changes: head/lang/php73/Makefile
Hello Jon, thanks for the detailed explanation and the suggestion for a fix. I tested it and it was fine. So i committed it a second ago! Thank you! Torsten
(In reply to Torsten Zuehlsdorff from comment #3) What happens if I don't install ports in /usr/local?
(In reply to mikael.urankar from comment #4) > What happens if I don't install ports in /usr/local? Your question is a very polite way to tell me, that i broke it for this case! ;) Thank you for sharing this question. I fixed it through the use of ${LOCALBASE} Greetings, Torsten
A commit references this bug: Author: tz Date: Mon May 6 20:27:18 UTC 2019 New revision: 500929 URL: https://svnweb.freebsd.org/changeset/ports/500929 Log: lang/php73: convert CPPFLAGS from /usr/local to ${LOCALBASE} As mat point out too often: if you write /usr/local you should write ${LOCALBASE} PR: 237722 Reported by: mikael.urankar@gmail.com Changes: head/lang/php73/Makefile