From nobody Fri Jan 10 11:10:08 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 4YTzTH1W7gz5k6kc for ; Fri, 10 Jan 2025 11:10:11 +0000 (UTC) (envelope-from pblok@bsd4all.org) Received: from mail.bsd4all.org (mail.bsd4all.org [88.99.169.216]) by mx1.freebsd.org (Postfix) with ESMTP id 4YTzTG5dBkz4Nhw; Fri, 10 Jan 2025 11:10:10 +0000 (UTC) (envelope-from pblok@bsd4all.org) Authentication-Results: mx1.freebsd.org; none Received: from mail.bsd4all.org (localhost [127.0.0.1]) by mail.bsd4all.org (Postfix) with ESMTP id 06561B89A; Fri, 10 Jan 2025 12:10:11 +0100 (CET) X-Virus-Scanned: amavisd-new at bsd4all.org Received: from mail.bsd4all.org ([127.0.0.1]) by mail.bsd4all.org (mail.bsd4all.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gOCBH_9fBXCD; Fri, 10 Jan 2025 12:10:10 +0100 (CET) Received: from smtpclient.apple (geer_ip [81.172.230.56]) by mail.bsd4all.org (Postfix) with ESMTPSA id 5720CB899; Fri, 10 Jan 2025 12:10:10 +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 \(3696.120.41.1.10\)) Subject: Re: libxkbcommon version-script detection From: Peter Blok In-Reply-To: <1DCB46A8-04C7-4F1A-ADEE-A5402E4B5617@FreeBSD.org> Date: Fri, 10 Jan 2025 12:10:08 +0100 Cc: FreeBSD CURRENT Content-Transfer-Encoding: quoted-printable Message-Id: <2C91EB52-9E56-40D7-8FA0-0265EBB704E7@bsd4all.org> References: <518E81E7-F1F0-422C-88A0-718088E4FDB6@bsd4all.org> <1DCB46A8-04C7-4F1A-ADEE-A5402E4B5617@FreeBSD.org> To: Dimitry Andric X-Mailer: Apple Mail (2.3696.120.41.1.10) X-Rspamd-Queue-Id: 4YTzTG5dBkz4Nhw 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:24940, ipnet:88.99.0.0/16, country:DE] Hi Dimitry, Yes it is stable/14 from a week ago. It is from within a jail, but I = just tested it outside the jail and it fails as well. The jail environment has been freshly rebuild on Januari 8. All = executables and binaries are completely recompiled. Same problem on another older stable/14 system. Peter > 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 > -Dimitry >=20