From nobody Mon Apr 06 16:45:06 2026 X-Original-To: dev-commits-src-all@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 4fqFYq5nQ4z6YKyV; Mon, 06 Apr 2026 16:45:19 +0000 (UTC) (envelope-from kib@freebsd.org) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4fqFYq2C31z43ZG; Mon, 06 Apr 2026 16:45:19 +0000 (UTC) (envelope-from kib@freebsd.org) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 636Gj6Us032629; Mon, 6 Apr 2026 19:45:09 +0300 (EEST) (envelope-from kib@freebsd.org) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 636Gj6Us032629 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 636Gj6lj032628; Mon, 6 Apr 2026 19:45:06 +0300 (EEST) (envelope-from kib@freebsd.org) X-Authentication-Warning: tom.home: kostik set sender to kib@freebsd.org using -f Date: Mon, 6 Apr 2026 19:45:06 +0300 From: Konstantin Belousov To: Dima Panov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: 3a01e1e1a50c - main - msun/aarch64: convert fenv functions to proper linkage Message-ID: References: <69caafbb.408c4.7b20a1e1@gitrepo.freebsd.org> <1f2ad4f0-a4ab-4f15-a779-5f1a6db9912b@FreeBSD.org> <8022afad-9cee-4ade-8b56-ef5b7feb6e16@FreeBSD.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8022afad-9cee-4ade-8b56-ef5b7feb6e16@FreeBSD.org> X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=4.0.2 X-Spam-Checker-Version: SpamAssassin 4.0.2 (2025-08-27) on tom.home 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:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Queue-Id: 4fqFYq2C31z43ZG X-Spamd-Bar: ---- On Mon, Apr 06, 2026 at 07:25:18PM +0300, Dima Panov wrote: > > > On 06.04.2026 19:07, Konstantin Belousov wrote: > > On Mon, Apr 06, 2026 at 06:56:36PM +0300, Dima Panov wrote: > > > Hello! > > > > > > This breaks most of libm consumers > > > > > > llvm/flang: > > > =============== > > > FAILED: [code=1] bin/flang-20 > > > : && /usr/local/libexec/ccache/c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -fPIC -fno-semantic-interposition -fvisibility-inline > > > s-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-s > > > emi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupport > > > ed -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-deprecated-copy -Wno-string-conversion -Wno-ctad-maybe-unsupported -Wno-unused-command-line-argument -Wstring-conversion -Wcover > > > ed-switch-default -Wno-nested-anon-types -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -isystem /usr/local/include -DNDEBUG -Wl,--color-diagnostics -Wl,--expor > > > t-dynamic -Wl,-z,origin -Wl,--gc-sections -Xlinker --dependency-file=tools/flang/tools/flang-driver/CMakeFiles/flang.dir/link.d tools/flang/tools/flang-driver/CMakeFiles/flang.dir/driver.cpp.o tools/ > > > flang/tools/flang-driver/CMakeFiles/flang.dir/fc1_main.cpp.o -o bin/flang-20 -L/wrkdirs/usr/ports/devel/llvm20/work-default/.build/./lib -Wl,-rpath,"\$ORIGIN/../lib:/wrkdirs/usr/ports/devel/llvm20/work- > > > default/.build/./lib:/wrkdirs/usr/ports/devel/llvm20/work-default/.build/lib:" -lpthread lib/libflangFrontend.a lib/libflangFrontendTool.a lib/libFortranLower.a lib/libFortranSemantics.a lib/libFo > > > rtranSupport.a lib/libflangPasses.a lib/libHLFIRTransforms.a lib/libFIRTransforms.a lib/libFIROpenACCSupport.a lib/libFlangOpenMPTransforms.a lib/libFIRCodeGen.a lib/libFIRAnalysis.a lib/libFIRB > > > uilder.a lib/libCUFDialect.a lib/libFortranEvaluate.a lib/libFortranParser.a lib/libFortranCommon.a lib/libFortranDecimal.a lib/libFIRSupport.a lib/libHLFIRDialect.a lib/libFIRDialect.a lib/lib > > > FIRDialectSupport.a lib/libCUFAttrs.a lib/libclang-cpp.so.20.1 lib/libMLIR.so.20.1 lib/libLLVM.so.20.1 && : > > > ld: error: undefined symbol: feholdexcept > > > > This is strange. Could you show me the output of e.g. > > readelf --dyn_syms /lib/libm.so.5 | grep feholdexcept > > The best would be the output from the command like above for each missing > > symbol. > > missing :( > > FreeBSD 16.0-CURRENT #0 main-cf1f21572897: Mon Apr 6 13:45:02 MSK 2026 > > root@aarch64:/ # readelf --dyn-syms /lib/libm.so.5 | grep feholdexcept > root@aarch64:/ # Hm, ok, perhaps I understand. These symbols where never exported from libm, and it just happens that they were compiled into the binaries itself due to extern inline. So the proper fix for consumers that want the symbols is to export them from libm.so. > > full list of symbols: > > Symbol table '.dynsym' contains 306 entries: It is practically impossible to get the missed symbols from the list of present symbols. Try this, if there is something else missed, add the symbols to msun/aarch64/Symbol.map. I did not even tried to (cross-) compile. I will think how to get the complete list to export, meantime. This should also be problem on any arch that provides non-standard fenv functions. commit 7573286180010304ca982d09ce5a980740e1e35e Author: Konstantin Belousov Date: Mon Apr 6 19:41:23 2026 +0300 lib/msun: export arch-specific fenv methods diff --git a/lib/msun/Makefile b/lib/msun/Makefile index 5112337f6297..b6e77fed5d9c 100644 --- a/lib/msun/Makefile +++ b/lib/msun/Makefile @@ -115,6 +115,10 @@ LIBC_ARCH=${MACHINE_CPUARCH} CFLAGS+= -I${.CURDIR}/src -I${LIBC_SRCTOP}/include \ -I${LIBC_SRCTOP}/${LIBC_ARCH} SYM_MAPS+= ${.CURDIR}/Symbol.map +ARCH_MAP= ${.CURDIR}/${LIBC_ARCH}/Symbol.map +.if exists(${ARCH_MAP}) +SYM_MAPS+= ${ARCH_MAP} +.endif VERSION_DEF= ${LIBC_SRCTOP}/Versions.def SYMBOL_MAPS= ${SYM_MAPS} diff --git a/lib/msun/aarch64/Symbol.map b/lib/msun/aarch64/Symbol.map new file mode 100644 index 000000000000..d24d7820ba98 --- /dev/null +++ b/lib/msun/aarch64/Symbol.map @@ -0,0 +1,5 @@ +FBSD_1.9 { + fegetenv; + feholdexcept; + feraiseexcept; +};