From nobody Fri Jan 10 12:51:07 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 4YV1jq0Hwjz5kGnc for ; Fri, 10 Jan 2025 12:51:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4YV1jp3FCYz4bwR; Fri, 10 Jan 2025 12:51:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736513470; 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=dtfB7cZ300BTdoFAGwVg4gumn0F6KEii8ROGY/PZfkk=; b=wu1t8XCEt4VfiWZVI2mywHD4B0OqP2zmx6lg9RsYpGtOVeTVdxi8j0Np00JAuAEOiaRmpM xHDG+vkg/NjuZ7x5z6fZETqEJBlpr/4+/DQwD3OuuyzvcDxjw+RttZAAv7wJGA1PrbpUHU vjodCjTibDe2SbaaxIZAMs2fF4+dV8SMn/+tV4fr8nyimIZxyU/V+v2lkPRkIufymCOW1C gseIfhP4MdA4eZWANTKLd/x/Q6KBFCdEyn6TFgqNCBDf6D0gwDwbMpsLqVAhN8FjbRqo0R QnCdinGz4DSdJ/vb6wq7zHSzLjU42yGuR4toZknppOd1te8Ja6QrqWE60W2fCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736513470; 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=dtfB7cZ300BTdoFAGwVg4gumn0F6KEii8ROGY/PZfkk=; b=TleEj74I7TYx0wsPGE3NNy+ezYuCx7j8ikcsOmTcBQlyFQ0Fz3C9c2cM8c8GVVTPQg+GAy 52yzC2+PX6UxZDAZFYaYn4b26XwozVNMFn725JB/LMarHR4qs6syDo4IuDcre01l0XKhKw edfH57GMWbEP/gJpxk8JcVjn+ZEO3AxIgwbagixh+8pNXwkdhKwN3nEztfyuGl9wN7Ee4s XJ1iEFQZiwiubzho77CDD6RF2XP0Uw96T+qogla958b2Vt8EU17zhyqOJOXl2swBUM416s Y+HEaIb0AJiklTau6aY6xLpKyaiWp74/5nKJI04vinTaSM66ozSL9B/tkfWcTA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736513470; a=rsa-sha256; cv=none; b=KNx4fI0azSGnW0Ja0AuKcvVzUF4KoweuC4iyTYSolqwLJTcQ+81O1zIGvfZEs+c4Mrl8mD xNpHngh+kWNT5awYLCBMxs4BlkX/3BbwS82NSfXkLRaAuBGnR+Q2sOehspOhfRixhKZHxd C8DtRoYIih2QfzAUWPnEHsawfd9A7NDq5l/R3yNTCbqHP6sp6/5gA2z0WbThNsUaYHYwTI vYmlmQqKGT9ACw45VT4ddO4I/AadgukBe5cMW6tS6VnjjNBvlGEOhWzxdPnLotM8XzmWOE 0bjXYeqKZ0kDVkUAj24hid16g81ECl0QVU4Kxz3GJPjaSCRx1YROW2GUUBpuKw== 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 4YV1jn5VDSzmZ7; Fri, 10 Jan 2025 12:51:09 +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 C1FD46772F; Fri, 10 Jan 2025 13:51:07 +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: Date: Fri, 10 Jan 2025 13:51:07 +0100 Cc: FreeBSD CURRENT Content-Transfer-Encoding: quoted-printable Message-Id: <221ED4CB-CC81-40F1-91A9-9DD8BE7298A7@FreeBSD.org> References: <518E81E7-F1F0-422C-88A0-718088E4FDB6@bsd4all.org> <1DCB46A8-04C7-4F1A-ADEE-A5402E4B5617@FreeBSD.org> <2EFAFFD8-E1E1-42D0-B41D-217E97C27F2E@bsd4all.org> To: Peter Blok X-Mailer: Apple Mail (2.3731.700.6.1.9) Upstream solved this slightly differently, and it's become a bit messy: 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 This could all go, if they used test version script, instead of the full = script. I'll see about putting in a pull request. -Dimitry > 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