From nobody Wed Jan 10 12:16:51 2024 X-Original-To: freebsd-stable@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T96HL3Txyz56pPY for ; Wed, 10 Jan 2024 12:17:02 +0000 (UTC) (envelope-from mike@sentex.net) Received: from smarthost1.sentex.ca (smarthost1.sentex.ca [IPv6:2607:f3e0:0:1::12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smarthost1.sentex.ca", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T96HK6d9sz4WXR; Wed, 10 Jan 2024 12:17:01 +0000 (UTC) (envelope-from mike@sentex.net) Authentication-Results: mx1.freebsd.org; none Received: from pyroxene2a.sentex.ca (pyroxene19.sentex.ca [199.212.134.19]) by smarthost1.sentex.ca (8.17.1/8.16.1) with ESMTPS id 40ACGsmi083813 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=FAIL); Wed, 10 Jan 2024 07:16:54 -0500 (EST) (envelope-from mike@sentex.net) Received: from [IPV6:2607:f3e0:0:4:d1e0:fd54:1ff2:1fb7] ([IPv6:2607:f3e0:0:4:d1e0:fd54:1ff2:1fb7]) by pyroxene2a.sentex.ca (8.17.1/8.15.2) with ESMTPS id 40ACGpAN041668 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NO); Wed, 10 Jan 2024 07:16:53 -0500 (EST) (envelope-from mike@sentex.net) Content-Type: multipart/alternative; boundary="------------TmukDo5Aa3rYMdeA1hJHI5Da" Message-ID: <20ceec23-fe90-41de-a3d8-82eada0d56e7@sentex.net> Date: Wed, 10 Jan 2024 07:16:51 -0500 List-Id: Production branch of FreeBSD source code List-Archive: https://lists.freebsd.org/archives/freebsd-stable List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-stable@freebsd.org X-BeenThere: freebsd-stable@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: clang 17 and ports fallout To: Antoine Brodin Cc: Dimitry Andric , FreeBSD-STABLE Mailing List References: <06381879-c328-4051-bb2f-9c3620d90fa0@sentex.net> <4a0db68d-bb13-4238-a251-74d02ff14a17@sentex.net> <04837a47-a39c-40c5-a045-2d27fb3893ac@sentex.net> Content-Language: en-US From: mike tancsa Autocrypt: addr=mike@sentex.net; keydata= xsBNBFywzOMBCACoNFpwi5MeyEREiCeHtbm6pZJI/HnO+wXdCAWtZkS49weOoVyUj5BEXRZP xflV2ib2hflX4nXqhenaNiia4iaZ9ft3I1ebd7GEbGnsWCvAnob5MvDZyStDAuRxPJK1ya/s +6rOvr+eQiXYNVvfBhrCfrtR/esSkitBGxhUkBjOti8QwzD71JVF5YaOjBAs7jZUKyLGj0kW yDg4jUndudWU7G2yc9GwpHJ9aRSUN8e/mWdIogK0v+QBHfv/dsI6zVB7YuxCC9Fx8WPwfhDH VZC4kdYCQWKXrm7yb4TiVdBh5kgvlO9q3js1yYdfR1x8mjK2bH2RSv4bV3zkNmsDCIxjABEB AAHNHW1pa2UgdGFuY3NhIDxtaWtlQHNlbnRleC5uZXQ+wsCOBBMBCAA4FiEEmuvCXT0aY6hs 4SbWeVOEFl5WrMgFAl+pQfkCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQeVOEFl5W rMiN6ggAk3H5vk8QnbvGbb4sinxZt/wDetgk0AOR9NRmtTnPaW+sIJEfGBOz47Xih+f7uWJS j+uvc9Ewn2Z7n8z3ZHJlLAByLVLtcNXGoRIGJ27tevfOaNqgJHBPbFOcXCBBFTx4MYMM4iAZ cDT5vsBTSaM36JZFtHZBKkuFEItbA/N8ZQSHKdTYMIA7A3OCLGbJBqloQ8SlW4MkTzKX4u7R yefAYQ0h20x9IqC5Ju8IsYRFacVZconT16KS81IBceO42vXTN0VexbVF2rZIx3v/NT75r6Vw 0FlXVB1lXOHKydRA2NeleS4NEG2vWqy/9Boj0itMfNDlOhkrA/0DcCurMpnpbM7ATQRcsMzk AQgA1Dpo/xWS66MaOJLwA28sKNMwkEk1Yjs+okOXDOu1F+0qvgE8sVmrOOPvvWr4axtKRSG1 t2QUiZ/ZkW/x/+t0nrM39EANV1VncuQZ1ceIiwTJFqGZQ8kb0+BNkwuNVFHRgXm1qzAJweEt RdsCMohB+H7BL5LGCVG5JaU0lqFU9pFP40HxEbyzxjsZgSE8LwkI6wcu0BLv6K6cLm0EiHPO l5G8kgRi38PS7/6s3R8QDsEtbGsYy6O82k3zSLIjuDBwA9GRaeigGppTxzAHVjf5o9KKu4O7 gC2KKVHPegbXS+GK7DU0fjzX57H5bZ6komE5eY4p3oWT/CwVPSGfPs8jOwARAQABwsB2BBgB CAAgFiEEmuvCXT0aY6hs4SbWeVOEFl5WrMgFAl+pQfkCGwwACgkQeVOEFl5WrMiVqwf9GwU8 c6cylknZX8QwlsVudTC8xr/L17JA84wf03k3d4wxP7bqy5AYy7jboZMbgWXngAE/HPQU95NM aukysSnknzoIpC96XZJ0okLBXVS6Y0ylZQ+HrbIhMpuQPoDweoF5F9wKrsHRoDaUK1VR706X rwm4HUzh7Jk+auuMYfuCh0FVlFBEuiJWMLhg/5WCmcRfiuB6F59ZcUQrwLEZeNhF2XJV4KwB Tlg7HCWO/sy1foE5noaMyACjAtAQE9p5kGYaj+DuRhPdWUTsHNuqrhikzIZd2rrcMid+ktb0 NvtvswzMO059z1YGMtGSqQ4srCArju+XHIdTFdiIYbd7+jeehg== In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 64.7.153.18 X-Rspamd-Queue-Id: 4T96HK6d9sz4WXR X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:11647, ipnet:2607:f3e0::/32, country:CA] This is a multi-part message in MIME format. --------------TmukDo5Aa3rYMdeA1hJHI5Da Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/10/2024 2:53 AM, Antoine Brodin wrote: > The preferred way is fixing the port by removing the undefined symbols >> from the linker version script in the port, but if that is not possible >> or difficult, add -Wl,--undefined-version to the linker flags suppresses >> the error. E.g. in the port Makefile: >> >> LDFLAGS+= -Wl,--undefined-version >> >> For an example, see: >> >> https://github.com/freebsd/freebsd-ports/commit/37790b26cbda11cd4bb6f237b86cd94739c4059c >> >> Thanks very much! That did indeed fix databases/rrdtool and and sysutils/flashrom builds. What is the best way to flag any such issues ? Just open a PR for each individual port ? > Hello, > > databases/rrdtool builds fine on stable/13 here: > https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/rrdtool-1.8.0_2.log > I am not sure why it fails for me both in poudrier and outside it. But the same type of error as https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/errors/ivykis-0.42.4.log and adding LDFLAGS+= -Wl,--undefined-version fixes it for me I just checked on releng_14 that also has clang 17 MFCd and I get the same error on the port. I am building it with less features than the default so not sure if that makes it fail in my environment. However the same options work with clang16 /usr/local/lib  -L/usr/local/lib  -o rrdupdate rrdupdate.o librrdupd.la libtool: link: cc -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -I.. -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fstack-protector-strong -o rrdupdate rrdupdate.o  -L/usr/local/lib ./.libs/librrdupd.a -lm -lwrap -lglib-2.0 -lintl -pthread libtool: link: echo "{ global:" > .libs/librrd.so.8.3.0-ver libtool: link:           sed -e "s|$|;|" < ./librrd.sym >> .libs/librrd.so.8.3.0-ver libtool: link:   echo "local: *; };" >> .libs/librrd.so.8.3.0-ver libtool: link: cc -shared  -fPIC -DPIC .libs/librrd_la-rrd_version.o .libs/librrd_la-rrd_last.o .libs/librrd_la-rrd_lastupdate.o .libs/librrd_la-rrd_first.o .libs/librrd_la-rrd_dump.o .libs/librrd_la-rrd_flushcached.o .libs/librrd_la-rrd_fetch.o .libs/librrd_la-rrd_fetch_cb.o .libs/librrd_la-rrd_resize.o .libs/librrd_la-rrd_tune.o .libs/librrd_la-rrd_list.o .libs/librrd_la-rrd_restore.o -Wl,--whole-archive ./.libs/librrdupd.a -Wl,--no-whole-archive -L/usr/local/lib -lglib-2.0 -lintl -lm -lwrap -lxml2  -O2 -fstack-protector-strong -pthread -O2 -fstack-protector-strong -fstack-protector-strong -Wl,-rpath -Wl,/usr/local/lib   -pthread -Wl,-soname -Wl,librrd.so.8 -Wl,-version-script -Wl,.libs/librrd.so.8.3.0-ver -o .libs/librrd.so.8.3.0 ld: error: version script assignment of 'global' to symbol 'rrd_graph' failed: symbol not defined ld: error: version script assignment of 'global' to symbol 'rrd_graph_v' failed: symbol not defined ld: error: version script assignment of 'global' to symbol 'rrd_lcd' failed: symbol not defined ld: error: version script assignment of 'global' to symbol 'rrd_reduce_data' failed: symbol not defined ld: error: version script assignment of 'global' to symbol 'rrd_xport' failed: symbol not defined cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[4]: *** [Makefile:773: librrd.la] Error 1 gmake[4]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src' gmake[3]: *** [Makefile:618: all] Error 2 gmake[3]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src' gmake[2]: *** [Makefile:504: all-recursive] Error 1 gmake[2]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/databases/rrdtool *** Error code 1 Stop. make: stopped in /usr/ports/databases/rrdtool - 0 root@build14:/usr/ports/databases/rrdtool # uname -aK FreeBSD build14.sentex.ca 14.0-STABLE FreeBSD 14.0-STABLE #0 stable/14-009c8a3d2: Tue Jan  9 10:06:28 UTC 2024 root@build14.sentex.ca:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1400504 - 0 root@build14:/usr/ports/databases/rrdtool #     ---Mike --------------TmukDo5Aa3rYMdeA1hJHI5Da Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 1/10/2024 2:53 AM, Antoine Brodin wrote:
The preferred way is fixing the port by removing the undefined symbols
from the linker version script in the port, but if that is not possible
or difficult, add -Wl,--undefined-version to the linker flags suppresses
the error. E.g. in the port Makefile:

LDFLAGS+= -Wl,--undefined-version

For an example, see:

https://github.com/freebsd/freebsd-ports/commit/37790b26cbda11cd4bb6f237b86cd94739c4059c

Thanks very much!  That did indeed fix databases/rrdtool and and sysutils/flashrom builds.   What is the best way to flag any such issues ? Just open a PR for each individual port ?
Hello,

databases/rrdtool builds fine on stable/13 here:
https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/rrdtool-1.8.0_2.log

I am not sure why it fails for me both in poudrier and outside it. But the same type of error as

https://pkg-status.freebsd.org/gohan04/data/stable13amd64-default-foo/2024-01-09_21h18m24s/logs/errors/ivykis-0.42.4.log

and adding

LDFLAGS+= -Wl,--undefined-version

fixes it for me

I just checked on releng_14 that also has clang 17 MFCd and I get the same error on the port. I am building it with less features than the default so not sure if that makes it fail in my environment. However the same options work with clang16

/usr/local/lib  -L/usr/local/lib  -o rrdupdate rrdupdate.o librrdupd.la
libtool: link: cc -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -I.. -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -D_GNU_SOURCE -fno-strict-aliasing -Wall -std=gnu99 -pedantic -Wundef -Wshadow -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline -Wold-style-definition -W -fstack-protector-strong -o rrdupdate rrdupdate.o  -L/usr/local/lib ./.libs/librrdupd.a -lm -lwrap -lglib-2.0 -lintl -pthread
libtool: link: echo "{ global:" > .libs/librrd.so.8.3.0-ver
libtool: link:           sed -e "s|$|;|" < ./librrd.sym >> .libs/librrd.so.8.3.0-ver
libtool: link:   echo "local: *; };" >> .libs/librrd.so.8.3.0-ver
libtool: link: cc -shared  -fPIC -DPIC  .libs/librrd_la-rrd_version.o .libs/librrd_la-rrd_last.o .libs/librrd_la-rrd_lastupdate.o .libs/librrd_la-rrd_first.o .libs/librrd_la-rrd_dump.o .libs/librrd_la-rrd_flushcached.o .libs/librrd_la-rrd_fetch.o .libs/librrd_la-rrd_fetch_cb.o .libs/librrd_la-rrd_resize.o .libs/librrd_la-rrd_tune.o .libs/librrd_la-rrd_list.o .libs/librrd_la-rrd_restore.o  -Wl,--whole-archive ./.libs/librrdupd.a -Wl,--no-whole-archive  -L/usr/local/lib -lglib-2.0 -lintl -lm -lwrap -lxml2  -O2 -fstack-protector-strong -pthread -O2 -fstack-protector-strong -fstack-protector-strong -Wl,-rpath -Wl,/usr/local/lib   -pthread -Wl,-soname -Wl,librrd.so.8 -Wl,-version-script -Wl,.libs/librrd.so.8.3.0-ver -o .libs/librrd.so.8.3.0
ld: error: version script assignment of 'global' to symbol 'rrd_graph' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_graph_v' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_lcd' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_reduce_data' failed: symbol not defined
ld: error: version script assignment of 'global' to symbol 'rrd_xport' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[4]: *** [Makefile:773: librrd.la] Error 1
gmake[4]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'
gmake[3]: *** [Makefile:618: all] Error 2
gmake[3]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0/src'
gmake[2]: *** [Makefile:504: all-recursive] Error 1
gmake[2]: Leaving directory '/usr/ports/databases/rrdtool/work/rrdtool-1.8.0'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/databases/rrdtool
*** Error code 1

Stop.
make: stopped in /usr/ports/databases/rrdtool
- 0 root@build14:/usr/ports/databases/rrdtool # uname -aK
FreeBSD build14.sentex.ca 14.0-STABLE FreeBSD 14.0-STABLE #0 stable/14-009c8a3d2: Tue Jan  9 10:06:28 UTC 2024     root@build14.sentex.ca:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64 1400504
- 0 root@build14:/usr/ports/databases/rrdtool #

    ---Mike


    
--------------TmukDo5Aa3rYMdeA1hJHI5Da--