Testing in the i386 lld exp-run found a number of instances of read-only segments (presumably .text) containing relocations, which is undesirable. For example: /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: php_date_global_timezone_db in readonly segment >>> defined in ext/date/.libs/php_date.o >>> referenced by /wrkdirs/usr/ports/lang/php56/work/php-5.6.32/ext/date/php_date.c >>> ext/date/.libs/php_date.o:(zif_strtotime) /usr/bin/ld: error: can't create dynamic relocation R_386_32 against symbol: php_date_global_timezone_db in readonly segment >>> defined in ext/date/.libs/php_date.o >>> referenced by /wrkdirs/usr/ports/lang/php56/work/php-5.6.32/ext/date/php_date.c >>> ext/date/.libs/php_date.o:(zif_strtotime) Simple workaround is to add LDFLAGS+=-Wl,-z,notext which turns off lld's error for read-only segment relocations, matching ld.bfd and ld.gold's behaviour, but it's best if the underlying cause is fixed.
Example full log link: http://package18.nyi.freebsd.org/data/headi386PR214864-default/2017-12-17_08h04m56s/logs/errors/php56-5.6.32_1.log
*** Bug 230207 has been marked as a duplicate of this bug. ***
Author: emaste Date: Tue Sep 18 16:08:02 UTC 2018 New revision: 480035 URL: https://svnweb.freebsd.org/changeset/ports/480035 Log: lang/php*: link with -znotext on i386 This port links some non-PIC code, which fails with lld as it defaults to disallowing relocations against read-only segments. For i386 we can just add -znotext unconditionally: for GNU BFD ld it just affirms BFD's existing default. PR: 214864, 230207 Approved by: bapt Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17193 Changes: head/lang/php56/Makefile head/lang/php70/Makefile head/lang/php71/Makefile head/lang/php72/Makefile