Changes between Initial Version and Version 1 of Ticket #70468


Ignore:
Timestamp:
Jul 31, 2024, 12:02:30 AM (8 weeks ago)
Author:
ryandesign (Ryan Carsten Schmidt)
Comment:

The relevant error in the log is:

Undefined symbols for architecture arm64:
  "_res_9_dn_expand", referenced from:
      _php_parserr in dns.o
      _php_parserr in dns.o
      _php_parserr in dns.o
      _php_parserr in dns.o
      _php_parserr in dns.o
      _php_parserr in dns.o
      _php_parserr in dns.o
      ...
  "_res_9_dn_skipname", referenced from:
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
      _zif_dns_get_mx in dns.o
  "_res_9_init", referenced from:
      _zif_dns_check_record in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
  "_res_9_search", referenced from:
      _zif_dns_check_record in dns.o
      _zif_dns_get_record in dns.o
      _zif_dns_get_mx in dns.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The log also shows you are using the Xcode command line tools version 15.3. This problem is caused by using Xcode or CLT version 15.3 or later because those versions consider implicit int to be an error. Previous compilers allowed implicit int with just a warning. For reasons of laziness we still use Xcode and CLT 15.2 on our macOS 14 build machines and this is able to build PHP without problems.

PHP cleaned up its code for implicit int issues in version 8.0, for example in this commit. I need to either backport that commit, and probably others, or downgrade the error back to a warning to allow php74 and earlier to build again with the latest Xcode and CLT.

If you are able to use a newer version of PHP for your project, try php80 or newer. They shouldn't have this problem.

If you require php74 or older, with the understanding that those versions have reached end of life, you can work around the problem by running:

sudo port clean php74-apache2handler
sudo port install php74-apache2handler configure.cflags="-Os -Wno-error=implicit-int"

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #70468

    • Property Status changed from new to accepted
    • Property Cc ryandesign@… removed
    • Property Summary changed from php74-apache2handler build fails for MacOS Sonoma (Apple M3) to php74-apache2handler @7.4.33: Undefined symbols _res_9_dn_expand, _res_9_dn_skipname, _res_9_init, _res_9_search,
    • Property Keywords arm64 removed
    • Property Owner set to ryandesign
  • Ticket #70468 – Description

    initial v1  
    22attempting to install php74-apache2handler fails. The log it points me to has this at the bottom:
    33
     4{{{
    45:info:build ld: symbol(s) not found for architecture arm64
    56:info:build clang: error: linker command failed with exit code 1 (use -v to see invocation)
     
    1920:debug:build "$procedure $targetname"
    2021:error:build See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php74-apache2handler/main.log for details.
     22}}}
    2123
    2224I tried port clean but that fails:
    2325
     26{{{
    2427Can't map the URL 'file://.' to a port description file ("Could not find Portfile in /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_php/php74-apache2handler").
    2528Please verify that the directory and portfile syntax are correct.
    2629To use the current port, you must be in a port's directory.
     30}}}
    2731
    2832I have no idea what is causing this. MacPorts has worked for me for years. I am doing everything as root