From nobody Fri Jan 10 13:01: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 4YV1y64xjJz5kHgg for ; Fri, 10 Jan 2025 13:01: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 4YV1y62x1Qz4f71; Fri, 10 Jan 2025 13:01:50 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736514110; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nkwz/rcr0gW9VcKgIsSkGOdGeUsAssnA2AK8WsK94gQ=; b=QaRjeeG/Xg2gicvWt5OQyM5vVJY6CN6ywywkNsdZubKq/VvFZDsmOgsN01lpaeLfBezaqT E06/aVSCuMDjz7K9ztD/QzYdoEKHmrYqVkKZVRmkBdz/Mjx4jh41M/gA3PduN01TwXp15t WD9+5K58I6XdLRNxxYB4DMh7OJC3yvvG3zYVCi7vNu2U0idIv5ZERZXeg/UXDOleDfc7z0 UefE/7xxs3AVa0eJOloMSeou2KIpYz5G5+mSweOkB0Z4/85PBYKGu/cgIxYcmG5ELOGIa6 mjLNNUuE6SsgZQ0IpeZyI8ev23aEpQe+nHARv1n78gjwW0sWkHeE66jWVssAMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736514110; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nkwz/rcr0gW9VcKgIsSkGOdGeUsAssnA2AK8WsK94gQ=; b=lr9gfisD0dzTQS8BHCXLhp3wOl+Kx+HjEBlMOLlkuSZCeG+IflV5JWvj7TYr7LJKB/+kHe 0rqgFF0z58SQTvOFpyCxo9kWXCKKY1OPbjY+VPlBPSbcX/4ozFTGFHpETPwS7OlbtEc+8k CINsw7X00zvJy6PpwnjYbYN+986KEnX3bhGSuP9yZeyPEWAjCPcCkhs+t4UQYSIx9p5E03 Hx3ocCKIL5R7zItHbxLFD0biY6Edwe2L1+gio7Xm5lL9X6jpdBJYs5aGYXHZfL5cDp9Slf lPIb/VcE3yC8n0hjgmyQ4dvQz8uJWIotne6oq1xPmfSdxQDIeRCsJEbeiN1WCA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736514110; a=rsa-sha256; cv=none; b=aQEg0vTjUVEngDNBsukJBq4PRQC5RBkxdQK2WYC7kWNvgMsTX0JPBJZt4o8Q6ZB+0AbBvs jdTl4SBZGGx11a+b97mW22wm0MznblcqFPYQhYaNehFkS+HVpQGgPn02fJQe1i3OzzVXp+ KdjA1RzmwRtdx0mMkWQXw6uJ7UfVftkmqhadA0FP863pocyYrXcdbXw581eFQAP+BQDSmr yRMIcSXjKDBARD3V03HBmpqhlmQTK5WA0TLF6RnPs5CIDrWpU7Qb/71N4UC5TTjr68BVhO mPy/cuHTiysb+xuc4T53qD+jg3pdfpN9x0sOBoDZDWGuqQOF/HKlkOAu9k3X5w== 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 4YV1y61yKDznpJ; Fri, 10 Jan 2025 13:01: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 2CE286766D; Fri, 10 Jan 2025 14:01:49 +0100 (CET) Content-Type: text/plain; charset=utf-8 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 From: Dimitry Andric In-Reply-To: <221ED4CB-CC81-40F1-91A9-9DD8BE7298A7@FreeBSD.org> Date: Fri, 10 Jan 2025 14:01:49 +0100 Cc: FreeBSD CURRENT Content-Transfer-Encoding: quoted-printable Message-Id: References: <518E81E7-F1F0-422C-88A0-718088E4FDB6@bsd4all.org> <1DCB46A8-04C7-4F1A-ADEE-A5402E4B5617@FreeBSD.org> <2EFAFFD8-E1E1-42D0-B41D-217E97C27F2E@bsd4all.org> <221ED4CB-CC81-40F1-91A9-9DD8BE7298A7@FreeBSD.org> To: Peter Blok X-Mailer: Apple Mail (2.3731.700.6.1.9) https://github.com/xkbcommon/libxkbcommon/pull/585 -Dimitry > On 10 Jan 2025, at 13:51, Dimitry Andric wrote: >=20 > Upstream solved this slightly differently, and it's become a bit = messy: >=20 > https://github.com/xkbcommon/libxkbcommon/commit/ebe4157d by bapt = added the --undefined-version option > https://github.com/xkbcommon/libxkbcommon/commit/1d8a25d6 added yet = another check, some old ld versions don't support --undefined-version >=20 > This could all go, if they used test version script, instead of the = full script. >=20 > I'll see about putting in a pull request. >=20 > -Dimitry >=20 >> On 10 Jan 2025, at 13:42, Peter Blok wrote: >>=20 >> Patch works fine! Thanks. >>=20 >> Do I need to open up a bug to get this pushed upstream? >>=20 >> Peter >>=20 >>=20 >>> On 10 Jan 2025, at 13:28, Dimitry Andric wrote: >>>=20 >>> 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. >>>=20 >>> 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. >>>=20 >>> -Dimitry >>>=20 >>> >>=20 >>=20 >=20 >=20