Opened 2 years ago

Last modified 14 months ago

#64255 accepted defect

php81-apache2handler: unexpectedly uses xxhashlib, which fails

Reported by: BjarneDMat Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: snowleopard Cc: Schamschula (Marius Schamschula)
Port: php, xxhashlib

Description

Undefined symbols for architecture x86_64:
  "_static_assert", referenced from:
      _PHP_XXH32Final in hash_xxhash.o
      _PHP_XXH64Final in hash_xxhash.o
      _PHP_XXH3_64_Final in hash_xxhash.o
      _PHP_XXH3_128_Init in hash_xxhash.o
      _PHP_XXH3_128_Final in hash_xxhash.o
      _XXH3_initCustomSecret_sse2 in hash_xxhash.o
      _XXH3_update in hash_xxhash.o
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Attachments (1)

main.log (772.8 KB) - added by BjarneDMat 2 years ago.

Download all attachments as: .zip

Change History (11)

Changed 2 years ago by BjarneDMat

Attachment: main.log added

comment:1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign removed
Port: php added; php81-apache2handler removed
Status: assignedaccepted
Summary: php81-apache2handler : Undefined symbols for architecture x86_64php81-apache2handler: unexpectedly uses xxhashlib, which fails
Version: 2.7.1

We have a successful build of this port on all OS versions on the buildbot.

The problem seems to come from xxhash:

In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php81-apache2handler/work/php-8.1.1/ext/hash/hash_xxhash.c:18:
In file included from ext/hash/php_hash_xxhash.h:21:
/opt/local/include/xxhash.h:2266:5: warning: implicit declaration of function 'static_assert' is invalid in C99 [-Wimplicit-function-declaration]
    XXH_STATIC_ASSERT(sizeof(XXH32_canonical_t) == sizeof(XXH32_hash_t));
    ^

It was not intentional that php use xxhashlib; I didn't know it could. If you build with trace mode (sudo port clean php81-apache2handler && sudo port -t install php81-apache2handler) it should hide your xxhashlib from the php build until I can fix it.

comment:2 Changed 2 years ago by BjarneDMat

      System Version: Mac OS X 10.6.8 (10K549)
      Kernel Version: Darwin 10.8.0
#=> port installed php81-apache2handler
  php81-apache2handler @8.1.0_0 (active)

there's no problem w/ 8.1.0_0; it's specific to 8.1.1_0 on SnowLeopard

      System Version: macOS 10.15.7 (19H1519)
      Kernel Version: Darwin 19.6.0
#=> port installed php81-apache2handler
  php81-apache2handler @8.1.1_0 (active)

neither of these works :

port -d -t -cuNp upgrade php81-apache2handler (macmini1,1)
port -d -t -cuNp install php81-apache2handler (macmini2,1)
Last edited 2 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:3 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Interesting. As I said, we have successful builds of these ports on the buildbot, yes even on Snow Leopard. The PHP changelog shows xxhash support was added in 8.1.0.

Make sure you've cleaned php81-apache2handler before attempting the trace mode build. If you already did that, and trace mode doesn't properly hide xxhashlib, then you could deactivate it prior to installing php81-apache2handler and reactivate it afterward.

sudo port -f deact xxhashlib
sudo port clean php81-apache2handler
sudo port upgrade php81-apache2handler
sudo port act xxhashlib

You almost never want to use the -p flag with port install or port upgrade. It will proceed to install or upgrade a port despite one of its dependencies not being able to be upgraded. This could mean that the port you upgraded or installed with -p is now built improperly, because it was not built against the intended version of its dependency.

comment:4 Changed 2 years ago by BjarneDMat

Your suggestion fixed it on both my of my macmini [thumbs-up]

If you need it, I can give you ssh access to an un-privileged account on my server ?

comment:5 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Thanks, but I can probably reproduce the condition that php tries to use xxhashlib on my system, now that I know that's a thing it does.

And the fact that xxhashlib doesn't work on your system is a separate issue that also needs to be addressed, ideally in a separate ticket and by the maintainer of that port.

comment:6 Changed 2 years ago by BjarneDMat

I've got

#=> port dependents xxhashlib
rsync depends on xxhashlib

And I've no issues with rsync, so out-of-the-box it doesn't seem as if xxhashlib is the problem; especially not when php81-apache2handler @8.1.0_0 had no issues w/ compiling. Unfortunately, I haven't had an active server on my macmini2,1 w/ php81 @8.1.0_0

But if you need me to test something, just give me a holler :-)

comment:7 in reply to:  1 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: Schamschula added
Port: xxhashlib added

We previously experienced this problem with the xxhashlib port itself and worked around it there; see #64113. Now it appears that maybe all ports that use xxhashlib need the same workaround.

comment:8 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)

In 8e734d3d5c29ca0ece5a1b94dfaff6b1fe4dc189/macports-ports (master):

xxhash: Fix C11 build with some clang versions

Closes: #64113
See: #64255

comment:9 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

We fixed the bug by adding an upstream patch to xxhash.h in the xxhashlib port but php has its own copy of xxhash.h that needs to be fixed as well. I reported it to the developers of php: https://github.com/php/php-src/issues/10659

comment:10 Changed 14 months ago by ryandesign (Ryan Carsten Schmidt)

In 03338c491a558acc1b6afa3e7a590e1067357c94/macports-ports (master):

php82: Fix C11 build with some clang versions

See: #64113
See: #64255

Note: See TracTickets for help on using tickets.