From nobody Fri Jan 10 12:28:49 2025 X-Original-To: freebsd-current@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 4YV1D25NzDz5kDqv for ; Fri, 10 Jan 2025 12:28:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YV1D24ccCz4XGx; Fri, 10 Jan 2025 12:28:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736512130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cbnj8HFmVVrLeaurOcl2Pw4s+cAf1nqtslk94DEmtTc=; b=dpKPFZXOuKwQOacjbTE3qvSocroV5uyIOSuEFH29P8Cs10eDPUWloaYtD49Hj61nUXm8kJ qJzkz6/AVidlbrDn0Spvmsm6FKDP69JgJ8FIHY2fGfRpcqKCrB5NCrtVzM1GgNa3noyAJh jThGGDJyt5arvl7+gAltjscTgueH0khiJEXHb/srHnJGlbR+1x/1f96mE3ISd6gLSyYSUr S2W6wTb8v7MqnSKoMskLDY0YrGZgN3nOE7DKDEQmyre2/OFSelxLH/Rcy/VS/AT+fucwID KgEKOQ4XfAGghbJfGHzIz04LOXXlUQggfBEK2D/D7zuj17xsRiYsim8E8fw0wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736512130; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cbnj8HFmVVrLeaurOcl2Pw4s+cAf1nqtslk94DEmtTc=; b=vKaaeIhM3ixJDhc71tdYKkBFco7K4feuaGeFzXYMgK542YbmI1HKVvxuMg4RefpoC4yKKJ og/7lO8LPSsUZdUZiTx8mfQfeQKsPX6eknv0vtrSTsF92mKWTWEc+tk4WLtF559Wo6sT8S AC4UkczuNcaR8wO1xSlVbKbx26B8GhwDWHKkcG2eJ9z4nIC1p2YBp7/BQXg5N/ROat+T1J 9VBZXxzvGTDS645HXl3aPgrn9j9TySdC9ccUtp2EVHicszIjZPxurxnlvb9qSJnJEwySb0 7Chm29sp5kcBWqNiIvb2ZqpGfqMw6AVxA1zWQU90We7RQpG5rM0QPV8x3KoNzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736512130; a=rsa-sha256; cv=none; b=Y/mxNNej4ZrLS6GN49cU/AiGdR5kXLMmZQVu6A/UwIIYwF27ZEzu0tr+h6A6moBqpD/Z6c 3HvZdWXjUnzxHDD1cnvdy3zUGcD22ERSdf8t5+6IIVcAlYUEy7uTMZCHC/FWRqSTe6t8O9 mugpFh/C94/b69y4MRTHU9s7XK7oGVXauy0UcnZJjCW2HyASLyZZ1DeZg+FDwS1DQoND/d a9dHbpKjUjebIYKQ4/ARZTQ3MKIr3LnUyoSC1u/1VwxOXTu/dw4ucoDVuaNnqKWaQQaZyC CJMMBqiMU6wpbdCYIrKtlMGC2PFrEHPBFG19DuTAzOBljTrkrjoF7mlmTofaig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (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 "tensor.andric.com", Issuer "R10" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 4YV1D22z07zn5t; Fri, 10 Jan 2025 12:28:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtpclient.apple (longrow.home.andric.com [192.168.0.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 6874E67653; Fri, 10 Jan 2025 13:28:49 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/mixed; boundary="Apple-Mail=_63BA83E1-1412-418C-AAF8-083C4CFA12DE" List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6.1.9\)) Subject: Re: libxkbcommon version-script detection Date: Fri, 10 Jan 2025 13:28:49 +0100 In-Reply-To: Cc: FreeBSD CURRENT To: Peter Blok References: <518E81E7-F1F0-422C-88A0-718088E4FDB6@bsd4all.org> <1DCB46A8-04C7-4F1A-ADEE-A5402E4B5617@FreeBSD.org> <2EFAFFD8-E1E1-42D0-B41D-217E97C27F2E@bsd4all.org> X-Mailer: Apple Mail (2.3731.700.6.1.9) --Apple-Mail=_63BA83E1-1412-418C-AAF8-083C4CFA12DE Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 10 Jan 2025, at 12:56, Dimitry Andric wrote: >=20 > On 10 Jan 2025, at 12:20, Peter Blok wrote: >>=20 >> Test works ok when using clang18 from ports >>=20 >>> On 10 Jan 2025, at 11:19, Dimitry Andric wrote: >>>=20 >>> On 10 Jan 2025, at 10:22, Peter Blok wrote: >>>>=20 >>>> I have recompiled x11/libxkbcommon and it fails to detect if the = compiler/linker supports versioned symbols. As a result other code = expecting the versioned symbol to exist, fail to link. >>>>=20 >>>> C compiler for the host machine: cc (clang 19.1.5 "FreeBSD clang = version 19.1.5 (https://github.com/llvm/llvm-project.git = llvmorg-19.1.5-0-gab4b5a2db582)") >>>> C linker for the host machine: cc ld.lld 19.1.5 >>>>=20 >>>> Below the meson.build check. If I force have_version_script to = true, the versioned symbols are created and other code links fine. >>>>=20 >>>> # Supports -Wl,--version-script? >>>> have_version_script =3D cc.links( >>>> 'int main(){}', >>>> args: '-Wl,--undefined-version,--version-script=3D' + = meson.current_source_dir()/'xkbcommon.map', >>>> name: '-Wl,--version-script', >>>> ) >>>>=20 >>>> Below the output for the test. >>>>=20 >>>> Checking if "-Wl,--version-script" : links: NO >>>>=20 >>>> If I create test.c with content "int main(){}=E2=80=9D and compile = it manually with the same flags AFAIK, it compiles ok. No errors. >>>>=20 >>>> However when I capture "make configure" with ktrace, it fails with = the error below. >>>>=20 >>>> ld: error: non-exported symbol 'environ' in '/usr/lib/crt1.o' is = referenced by DSO '/lib/libc.so.7' >>>> ld: error: non-exported symbol '__progname' in = '/usr/lib/crt1.o' is referenced by DSO '/lib/libc.so.7' >>>> cc: error: linker command failed with exit code 1 (use -v to = see invocation) >>>>=20 >>>> What flags need to be added in meson.build to allow it to work? >>>>=20 >>>> BTW This is on recent stable, but I suspect it fails the same way = on current which I do not run at the moment. >>>=20 >>> It works just fine on -CURRENT: >>>=20 >>> ... >>> Checking if "-Wl,--version-script" : links: YES >>>=20 >>> Not sure what is going wrong in your environment. Is this stable/14? >=20 > It appears to help when the lines: >=20 > local: > *; >=20 > are removed from = /wrkdirs/usr/ports/x11/libxkbcommon/work/libxkbcommon-1.7.0/xkbcommon.map.= Apparently on main, environ and __progname are slightly different. >=20 > In any case, the "local: *;" thing has caused problems before, so = maybe it's better to get rid of it. Here's a better patch, that can also be upstreamed. It avoids the whole = problem of trying to use the "full" xkbcommon.map during meson tests. -Dimitry --Apple-Mail=_63BA83E1-1412-418C-AAF8-083C4CFA12DE Content-Disposition: attachment; filename=x11__libxkbcommon-fix-version-script-check-1.diff Content-Type: application/octet-stream; x-unix-mode=0644; name="x11__libxkbcommon-fix-version-script-check-1.diff" Content-Transfer-Encoding: 7bit commit 51f362f344d06786f686a108ee3b68187a8ed03c Author: Dimitry Andric Date: 2025-01-10T13:26:38+01:00 x11/libxkbcommon: fix --version-script check in meson.build for good diff --git a/x11/libxkbcommon/files/patch-meson.build b/x11/libxkbcommon/files/patch-meson.build new file mode 100644 index 000000000000..adb5872f2a23 --- /dev/null +++ b/x11/libxkbcommon/files/patch-meson.build @@ -0,0 +1,11 @@ +--- meson.build.orig 2024-03-23 21:23:43 UTC ++++ meson.build +@@ -145,7 +145,7 @@ have_version_script = cc.links( + # Supports -Wl,--version-script? + have_version_script = cc.links( + 'int main(){}', +- args: '-Wl,--undefined-version,--version-script=' + meson.current_source_dir()/'xkbcommon.map', ++ args: '-Wl,--version-script=' + meson.current_source_dir()/'meson_test.map', + name: '-Wl,--version-script', + ) + diff --git a/x11/libxkbcommon/files/patch-meson__test.map b/x11/libxkbcommon/files/patch-meson__test.map new file mode 100644 index 000000000000..102e02a3534a --- /dev/null +++ b/x11/libxkbcommon/files/patch-meson__test.map @@ -0,0 +1,4 @@ +--- meson_test.map.orig 2025-01-10 12:22:45 UTC ++++ meson_test.map +@@ -0,0 +1 @@ ++TEST {}; --Apple-Mail=_63BA83E1-1412-418C-AAF8-083C4CFA12DE--