Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Dec 2023 16:15:48 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Kristof Provost <kp@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: 5c16e71d30c3 - main - Merge llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367
Message-ID:  <4BE6917B-663A-4ED7-9E1A-A49FBA188456@FreeBSD.org>
In-Reply-To: <E65EEC14-9547-472F-B5EB-7CC70956BBBC@FreeBSD.org>
References:  <202312081739.3B8HdJYC068067@gitrepo.freebsd.org> <E65EEC14-9547-472F-B5EB-7CC70956BBBC@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_9BCCE6DB-3DD5-40D6-9BAA-65DC475E8C45
Content-Type: multipart/alternative;
	boundary="Apple-Mail=_C1039ED0-471E-418F-B309-A701E8315DF0"


--Apple-Mail=_C1039ED0-471E-418F-B309-A701E8315DF0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

On 11 Dec 2023, at 16:03, Kristof Provost <kp@FreeBSD.org> wrote:
> On 8 Dec 2023, at 18:39, Dimitry Andric wrote:
> The branch main has been updated by dim:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3D5c16e71d30c388dd43b217de10a3ccb4=
b0219d0d =
<https://cgit.freebsd.org/src/commit/?id=3D5c16e71d30c388dd43b217de10a3ccb=
4b0219d0d>
> commit 5c16e71d30c388dd43b217de10a3ccb4b0219d0d
> Merge: b121cb0095c8 703029dbba78
> Author: Dimitry Andric <dim@FreeBSD.org>
> AuthorDate: 2023-11-30 20:06:52 +0000
> Commit: Dimitry Andric <dim@FreeBSD.org>
> CommitDate: 2023-12-08 17:35:59 +0000
>=20
> Merge llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367
>=20
> This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb =
and
> openmp to llvmorg-17.0.6-0-g6009708b4367.
>=20
> PR: 273753
> MFC after: 1 month
>=20
>=20
> There appears to be some fallout in some ports.
>=20
> For example, devel/ivykis (but also sysutils/flashrom and =
databases/rrdtool) fails like this:
>=20
> /bin/sh ../libtool  --tag=3DCC    --mode=3Dlink cc  -O2 -pipe  =
-fstack-protector-strong -fno-strict-aliasing  -Wall  -version-info =
5:6:5 -Wl,--version-script,../libivykis.posix.ver =
-fstack-protector-strong -o libivykis.la -rpath /usr/local/lib iv_avl.lo =
iv_event.lo iv_fatal.lo iv_task.lo  iv_timer.lo iv_tls.lo iv_work.lo =
iv_event_raw_posix.lo iv_fd.lo  iv_fd_poll.lo iv_fd_pump.lo =
iv_main_posix.lo  iv_popen.lo iv_signal.lo iv_thread_posix.lo  =
iv_tid_posix.lo iv_time_posix.lo iv_wait.lo    iv_fd_kqueue.lo
> libtool: link: cc -shared  -fPIC -DPIC  .libs/iv_avl.o =
.libs/iv_event.o .libs/iv_fatal.o .libs/iv_task.o .libs/iv_timer.o =
.libs/iv_tls.o .libs/iv_work.o .libs/iv_event_raw_posix.o .libs/iv_fd.o =
.libs/iv_fd_poll.o .libs/iv_fd_pump.o .libs/iv_main_posix.o =
.libs/iv_popen.o .libs/iv_signal.o .libs/iv_thread_posix.o =
.libs/iv_tid_posix.o .libs/iv_time_posix.o .libs/iv_wait.o =
.libs/iv_fd_kqueue.o    -O2 -fstack-protector-strong =
-Wl,--version-script -Wl,../libivykis.posix.ver -fstack-protector-strong =
  -Wl,-soname -Wl,libivykis.so.0 -o .libs/libivykis.so.0.5.6
> ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_register' failed: symbol not defined
> ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_unregister' failed: symbol not defined
> ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_watch_register' failed: symbol not defined
> ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_watch_unregister' failed: symbol not defined
> cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
> I believe the issue is that it doesn=E2=80=99t build inotify code on =
FreeBSD, but still mentions the relevant functions in the linker script. =
The other affected ports I=E2=80=99ve run into appear to have similar =
issues.
>=20
In this case, if it never builds the inotify code, you can safely delete =
those symbols from the linker version script.

> There=E2=80=99s likely to be a fair amount of fallout from that, e.g. =
https://github.com/llvm/llvm-project/issues/75056
>=20
> I=E2=80=99m not sure what the best path forward is. Should we try to =
make ld warn but not fail on issues like that, or fix each affected port =
or ?
>=20
I fixed dozens of ports for this in https://bugs.freebsd.org/273753, but =
I haven't gone over all of them, since I have limited resources.

That said, there are generally two ways to fix this: either add =
-Wl,--undefined-version to the linker flags, or actually remove the =
undefined symbols from the linker version scripts.

Example of the former: =
https://cgit.freebsd.org/ports/commit/?id=3De0c21e404ed0f04c06c3bce7dd093c=
6e5ffea188 :

--- a/java/openjfx14/Makefile
+++ b/java/openjfx14/Makefile
@@ -95,6 +95,9 @@ _INSTALLDIR=3D  ${PREFIX}/${PKGBASE}
 CFLAGS+=3D       -Wno-error=3Dincompatible-function-pointer-types
 .endif

+# Suppress errors with lld >=3D 17 due to undefined symbols.
+LDFLAGS+=3D      -Wl,--undefined-version
+
 post-extract:
        ${MKDIR} ${WRKDIR}/jars
 .for f in core grouping queries queryparser sandbox

Example of the latter: =
https://cgit.freebsd.org/ports/commit/?id=3Daef056cf0fe1852a7b708d090310a6=
eb4853b269 :

--- =
a/databases/rubygem-pg_query/files/patch-ext_pg__query_pg__query__ruby.sym=

+++ =
b/databases/rubygem-pg_query/files/patch-ext_pg__query_pg__query__ruby.sym=

@@ -1,5 +1,5 @@
---- ext/pg_query/pg_query_ruby.sym.orig        2023-06-25 07:13:00 UTC
+--- ext/pg_query/pg_query_ruby.sym.orig        2023-11-19 20:29:16 UTC
 +++ ext/pg_query/pg_query_ruby.sym
-@@ -1 +1,2 @@
- _Init_pg_query
+@@ -1 +1 @@
+-_Init_pg_query
 +Init_pg_query

-Dimitry


--Apple-Mail=_C1039ED0-471E-418F-B309-A701E8315DF0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
	charset=utf-8

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">On 11 Dec =
2023, at 16:03, Kristof Provost &lt;kp@FreeBSD.org&gt; =
wrote:<br><div><blockquote type=3D"cite"><span style=3D"font-family: =
sans-serif;">On 8 Dec 2023, at 18:39, Dimitry Andric =
wrote:</span><br><div><div><div style=3D"font-family: sans-serif;"><div =
class=3D"plaintext" style=3D"white-space: normal;"><blockquote =
style=3D"margin: 0 0 5px; padding-left: 5px; border-left: 2px solid =
#136BCE; color: #136BCE;"><p dir=3D"auto">The branch main has been =
updated by dim:</p><p dir=3D"auto">URL: <a =
href=3D"https://cgit.freebsd.org/src/commit/?id=3D5c16e71d30c388dd43b217de=
10a3ccb4b0219d0d">https://cgit.FreeBSD.org/src/commit/?id=3D5c16e71d30c388=
dd43b217de10a3ccb4b0219d0d</a></p><p dir=3D"auto">commit =
5c16e71d30c388dd43b217de10a3ccb4b0219d0d
<br>
Merge: b121cb0095c8 703029dbba78
<br>
Author:     Dimitry Andric &lt;dim@FreeBSD.org&gt;
<br>
AuthorDate: 2023-11-30 20:06:52 +0000
<br>
Commit:     Dimitry Andric &lt;dim@FreeBSD.org&gt;
<br>
CommitDate: 2023-12-08 17:35:59 +0000</p><p dir=3D"auto">    Merge =
llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367</p><p =
dir=3D"auto">    This updates llvm, clang, compiler-rt, libc++, =
libunwind, lld, lldb and
<br>
    openmp to llvmorg-17.0.6-0-g6009708b4367.</p><p dir=3D"auto">    PR: =
            273753
<br>
    MFC after:      1 month</p>
<br></blockquote></div>
<div class=3D"markdown" style=3D"white-space: normal;"><p =
dir=3D"auto">There appears to be some fallout in some ports.</p><p =
dir=3D"auto">For example, devel/ivykis (but also sysutils/flashrom and =
databases/rrdtool) fails like this:</p>
<pre style=3D"margin-left: 15px; margin-right: 15px; padding: 5px; =
border: thin solid gray; overflow-x: auto; max-width: 90vw; =
background-color: #E4E4E4;"><code style=3D"padding: 0 0.25em; =
background-color: #E4E4E4;">/bin/sh ../libtool  --tag=3DCC    =
--mode=3Dlink cc  -O2 -pipe  -fstack-protector-strong =
-fno-strict-aliasing  -Wall  -version-info 5:6:5 =
-Wl,--version-script,../libivykis.posix.ver -fstack-protector-strong -o =
libivykis.la -rpath /usr/local/lib iv_avl.lo iv_event.lo iv_fatal.lo =
iv_task.lo  iv_timer.lo iv_tls.lo iv_work.lo iv_event_raw_posix.lo =
iv_fd.lo  iv_fd_poll.lo iv_fd_pump.lo iv_main_posix.lo  iv_popen.lo =
iv_signal.lo iv_thread_posix.lo  iv_tid_posix.lo iv_time_posix.lo =
iv_wait.lo    iv_fd_kqueue.lo
libtool: link: cc -shared  -fPIC -DPIC  .libs/iv_avl.o .libs/iv_event.o =
.libs/iv_fatal.o .libs/iv_task.o .libs/iv_timer.o .libs/iv_tls.o =
.libs/iv_work.o .libs/iv_event_raw_posix.o .libs/iv_fd.o =
.libs/iv_fd_poll.o .libs/iv_fd_pump.o .libs/iv_main_posix.o =
.libs/iv_popen.o .libs/iv_signal.o .libs/iv_thread_posix.o =
.libs/iv_tid_posix.o .libs/iv_time_posix.o .libs/iv_wait.o =
.libs/iv_fd_kqueue.o    -O2 -fstack-protector-strong =
-Wl,--version-script -Wl,../libivykis.posix.ver -fstack-protector-strong =
  -Wl,-soname -Wl,libivykis.so.0 -o .libs/libivykis.so.0.5.6
ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_register' failed: symbol not defined
ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_unregister' failed: symbol not defined
ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_watch_register' failed: symbol not defined
ld: error: version script assignment of 'IVYKIS_0.29' to symbol =
'iv_inotify_watch_unregister' failed: symbol not defined
cc: error: linker command failed with exit code 1 (use -v to see =
invocation)
</code></pre><p dir=3D"auto">I believe the issue is that it doesn=E2=80=99=
t build inotify code on FreeBSD, but still mentions the relevant =
functions in the linker script. The other affected ports I=E2=80=99ve =
run into appear to have similar =
issues.</p></div></div></div></div></blockquote><div>In this case, if it =
never builds the inotify code, you can safely delete those symbols from =
the linker version script.</div><br><blockquote =
type=3D"cite"><div><div><div style=3D"font-family: sans-serif;"><div =
class=3D"markdown" style=3D"white-space: normal;"><p =
dir=3D"auto">There=E2=80=99s likely to be a fair amount of fallout from =
that, e.g. <a =
href=3D"https://github.com/llvm/llvm-project/issues/75056">https://github.=
com/llvm/llvm-project/issues/75056</a></p><p dir=3D"auto">I=E2=80=99m =
not sure what the best path forward is. Should we try to make ld warn =
but not fail on issues like that, or fix each affected port or =
?</p></div></div></div></div></blockquote><div>I fixed dozens of ports =
for this in&nbsp;<a =
href=3D"https://bugs.freebsd.org/273753">https://bugs.freebsd.org/273753</=
a>, but I haven't gone over all of them, since I have limited =
resources.</div><div><br></div><div>That said, there are generally two =
ways to fix this: either add -Wl,--undefined-version to the linker =
flags, or actually remove the undefined symbols from the linker version =
scripts.</div><div><br></div><div>Example of the former:&nbsp;<a =
href=3D"https://cgit.freebsd.org/ports/commit/?id=3De0c21e404ed0f04c06c3bc=
e7dd093c6e5ffea188">https://cgit.freebsd.org/ports/commit/?id=3De0c21e404e=
d0f04c06c3bce7dd093c6e5ffea188</a>&nbsp;:</div><div><br></div><div><div><f=
ont face=3D"Menlo">--- a/java/openjfx14/Makefile</font></div><div><font =
face=3D"Menlo">+++ b/java/openjfx14/Makefile</font></div><div><font =
face=3D"Menlo">@@ -95,6 +95,9 @@ _INSTALLDIR=3D =
&nbsp;${PREFIX}/${PKGBASE}</font></div><div><font =
face=3D"Menlo">&nbsp;CFLAGS+=3D &nbsp; &nbsp; &nbsp; =
-Wno-error=3Dincompatible-function-pointer-types</font></div><div><font =
face=3D"Menlo">&nbsp;.endif</font></div><div><font =
face=3D"Menlo"><br></font></div><div><font face=3D"Menlo">+# Suppress =
errors with lld &gt;=3D 17 due to undefined =
symbols.</font></div><div><font face=3D"Menlo">+LDFLAGS+=3D &nbsp; =
&nbsp; &nbsp;-Wl,--undefined-version</font></div><div><font =
face=3D"Menlo">+</font></div><div><font =
face=3D"Menlo">&nbsp;post-extract:</font></div><div><font =
face=3D"Menlo">&nbsp; &nbsp; &nbsp; &nbsp; ${MKDIR} =
${WRKDIR}/jars</font></div><div><font face=3D"Menlo">&nbsp;.for f in =
core grouping queries queryparser =
sandbox</font></div><div><br></div><div>Example of the latter:&nbsp;<a =
href=3D"https://cgit.freebsd.org/ports/commit/?id=3Daef056cf0fe1852a7b708d=
090310a6eb4853b269">https://cgit.freebsd.org/ports/commit/?id=3Daef056cf0f=
e1852a7b708d090310a6eb4853b269</a>&nbsp;:</div><div><br></div><div><div><f=
ont face=3D"Menlo">--- =
a/databases/rubygem-pg_query/files/patch-ext_pg__query_pg__query__ruby.sym=
</font></div><div><font face=3D"Menlo">+++ =
b/databases/rubygem-pg_query/files/patch-ext_pg__query_pg__query__ruby.sym=
</font></div><div><font face=3D"Menlo">@@ -1,5 +1,5 =
@@</font></div><div><font face=3D"Menlo">---- =
ext/pg_query/pg_query_ruby.sym.orig &nbsp; &nbsp; &nbsp; =
&nbsp;2023-06-25 07:13:00 UTC</font></div><div><font face=3D"Menlo">+--- =
ext/pg_query/pg_query_ruby.sym.orig &nbsp; &nbsp; &nbsp; =
&nbsp;2023-11-19 20:29:16 UTC</font></div><div><font =
face=3D"Menlo">&nbsp;+++ =
ext/pg_query/pg_query_ruby.sym</font></div><div><font face=3D"Menlo">-@@ =
-1 +1,2 @@</font></div><div><font face=3D"Menlo">- =
_Init_pg_query</font></div><div><font face=3D"Menlo">+@@ -1 +1 =
@@</font></div><div><font =
face=3D"Menlo">+-_Init_pg_query</font></div><div><font =
face=3D"Menlo">&nbsp;+Init_pg_query</font></div><div><br></div><div>-Dimit=
ry</div><div><br></div></div></div></div></body></html>=

--Apple-Mail=_C1039ED0-471E-418F-B309-A701E8315DF0--

--Apple-Mail=_9BCCE6DB-3DD5-40D6-9BAA-65DC475E8C45
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCZXcnpAAKCRCwXqMKLiCW
o2wvAKDRVumoSrgNKyR3a8ZAyvXl9FgtQACgtG+38ivaq2zYKtAHDifxS7kwCJY=
=N/rs
-----END PGP SIGNATURE-----

--Apple-Mail=_9BCCE6DB-3DD5-40D6-9BAA-65DC475E8C45--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4BE6917B-663A-4ED7-9E1A-A49FBA188456>