From nobody Mon Apr 6 16:58:37 2026 X-Original-To: dev-commits-src-main@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 4fqFsF3mB5z6YLjf; Mon, 06 Apr 2026 16:58:41 +0000 (UTC) (envelope-from fluffy@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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fqFsF1Q5dz45xn; Mon, 06 Apr 2026 16:58:41 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775494721; 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=p449E5QIpfHRBzBLOxPaBiBMIt9Ehxh0ddj0XkWjj3Y=; b=IIrM7xYfuVqutei+s4+kTdwZIkYw9JYdPG+EsQC0yGRT+XzOqHreJU++WEVeMn24lAdkt1 hC6NM0qrJujbFYG+jgrLNq7SBRw+MF6YUH6tQS1XU/FH5u9Qx4hIwH1JMgd7itpicbc+lP 7vH+kbD0Llq434VQA08b2KnyBOU0Alu1erekvrbD+psVAXCL2DNMEpZjP1tC0Xxyl+cBDd UG86Y/dHyWuEhHcW9vsyNm9wKCIOOjYkpMLyx0eXwyAx2OWm4x61Bqbco2sB3FMQpQzwX7 AvNbozp77ZKfCoj4xcUi0YFXFKM3/9GRtadjML1eMJbjPFsI+To7/5acxqmgfg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1775494721; a=rsa-sha256; cv=none; b=ej+//xBglfS3Ay834quX3t6alwpAp36Antc69oiWEKgbBv3DpMvUthV+hNmOcGHl4r/ewQ lIDhWHevKUiYY+BcC2MGmBCFaF/9D/yx0tLsEehRAaUM74IEQhlXi1nkj7iWViIgOD7zMn ZMKY3YoAHk5M6nBds0HZMT308zno8b4W02PngtHCFOnQ4EPJeTPit+Es3hQRCqa2p2yKwj KPDzyUEemyQGZRhS5ySCW7ucv5pbZhFDV+2Df1ULhFsrz0mGvf6HTAPUBTQAEmaSCmy98f aY3jGQa4kORic+tRE1w6dgmOF76TNKF6r2Mi513SKHgYbMZJLKuN33J3nkUyWA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1775494721; 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=p449E5QIpfHRBzBLOxPaBiBMIt9Ehxh0ddj0XkWjj3Y=; b=wh0tnhfn2842KrhWEhNoN2qrk7wFdOdMuNMf1LWl9iXfF2FirXEFuisyNNw6pNQfV3pgvw kHmJuNDTtqxNp6pY9upV70/mulZ5U3pw81eNaaRMC7C9fxMohhOrfjboJMeThmfA8sNgBm NS6ulPbOnFzrdQD+M1ldXEfpWdCBNXXsi/CJH8P2YT6ydD9/WyhV/Lw7i9tp08SK4o0wtW /CoJXqPhGiyPmtQG455Jr7O0B7m5UF8yJYWddfUE9q9JYbcaYUzyrFCq5tLEY3w2fxJWDR uSVXfZrnLlWeO/AIf5eVbaioAkvH3+hlPDWYRbTyjJimz44RtojSxlMj+qT7nQ== Received: from [2a05:3580:e727:cd00::10:0] (unknown [IPv6:2a05:3580:e727:cd00:6028:73dc:5e69:9ca0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: fluffy) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fqFsD3bR5z1CqG; Mon, 06 Apr 2026 16:58:40 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Date: Mon, 6 Apr 2026 19:58:37 +0300 From: Dima Panov To: Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Message-ID: In-Reply-To: References: <69caafbb.408c4.7b20a1e1@gitrepo.freebsd.org> <1f2ad4f0-a4ab-4f15-a779-5f1a6db9912b@FreeBSD.org> <8022afad-9cee-4ade-8b56-ef5b7feb6e16@FreeBSD.org> Subject: git: 3a01e1e1a50c - main - msun/aarch64: convert fenv functions to proper linkage List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="69d3e63d_2ae8944a_d4c2" --69d3e63d_2ae8944a_d4c2 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline On 06.04.2026 19:45, Konstantin Belousov wrote: > 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; > +}; May be better way is repeat map from msun/arm/Symbol.map? amd64 is also equal to it here. FBSD_1.9 { fesetexceptflag; feraiseexcept; fegetenv; feholdexcept; feupdateenv; feenableexcept; fedisableexcept; fegetexcept; }; Started build with your diff anyway, will see on result -- Sincerely, Dima (fluffy@FreeBSD.org, https://t.me/FluffyBSD, @fluffy:matrix-dev.freebsd.org) (desktop, kde, x11, office, ports-secteam)@FreeBSD team --69d3e63d_2ae8944a_d4c2 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline


On 06.04.2026 19:45, Konstantin Belousov wrote:
=
On Mon, Apr 06, 2026 at 07:25:18PM +0300, D= ima Panov wrote:


On 06.04.202= 6 19:07, Konstantin Belousov wrote:
On = Mon, Apr 06, 2026 at 06:56:36PM +0300, Dima Panov wrote:
Hello=21

This breaks most of libm consumers
llvm/flang:
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
= =46AILED: =5Bcode=3D1=5D bin/flang-20
: && /usr/local/libexec= /ccache/c++ -O2 -pipe -fstack-protector-strong -isystem /usr/local/includ= e -fno-strict-aliasing -isystem /usr/local/include -fPIC -fno-semantic-in= terposition -fvisibility-inline
s-hidden -Werror=3Ddate-time -Werror=3D= unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-st= rings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -= Wc++98-compat-extra-s
emi -Wimplicit-fallthrough -Wcovered-switch-def= ault -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsu= ggest-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-switc= h-default -Wno-nested-anon-types -O2 -pipe -fstack-protector-strong -isys= tem /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=3Dtools/flang/tools/flang-dri= ver/CMake=46iles/flang.dir/link.d tools/flang/tools/flang-driver/CMake=46= iles/flang.dir/driver.cpp.o tools/
flang/tools/flang-driver/CMake=46i= les/flang.dir/fc1=5Fmain.cpp.o -o bin/flang-20 -L/wrkdirs/usr/ports/devel= /llvm20/work-default/.build/./lib -Wl,-rpath,=22=5C=24ORIGIN/../lib:/wrkd= irs/usr/ports/devel/llvm20/work-
default/.build/./lib:/wrkdirs/usr/po= rts/devel/llvm20/work-default/.build/lib:=22 -lpthread lib/libflang=46ron= tend.a lib/libflang=46rontendTool.a lib/lib=46ortranLower.a lib/lib=46ort= ranSemantics.a lib/lib=46o
rtranSupport.a lib/libflangPasses.a lib/li= bHL=46IRTransforms.a lib/lib=46IRTransforms.a lib/lib=46IROpenACCSupport.= a lib/lib=46langOpenMPTransforms.a lib/lib=46IRCodeGen.a lib/lib=46IRAnal= ysis.a lib/lib=46IRB
uilder.a lib/libCU=46Dialect.a lib/lib=46ortranE= valuate.a lib/lib=46ortranParser.a lib/lib=46ortranCommon.a lib/lib=46ort= ranDecimal.a lib/lib=46IRSupport.a lib/libHL=46IRDialect.a lib/lib=46IRDi= alect.a lib/lib
=46IRDialectSupport.a lib/libCU=46Attrs.a lib/libclan= g-cpp.so.20.1 lib/libMLIR.so.20.1 lib/libLLVM.so.20.1 && :
ld= : error: undefined symbol: feholdexcept

This is str= ange. Could you show me the output of e.g.
readelf --dyn=5Fsyms /lib/= libm.so.5 =7C grep feholdexcept
The best would be the output from the= command like above for each missing
symbol.

mi= ssing :(

=46reeBSD 16.0-CURRENT =230 main-cf1f21572897: Mon Apr = 6 13:45:02 MSK 2026

root=40aarch64:/ =23 readelf --dyn-syms /lib= /libm.so.5 =7C grep feholdexcept
root=40aarch64:/ =23
Hm, ok, perhaps I understand.
These symbols where never exported fr= om libm, and it just happens that
they were compiled into the binarie= s itself due to extern inline.
So the proper fix for consumers that w= ant the symbols is to export them
from libm.so.


full list of symbols:

Symbol table '.dyns= ym' contains 306 entries:

It is practically impossi= ble to get the missed symbols from the list of
present symbols. Try t= his, if there is something else missed, add the
symbols to msun/aarch= 64/Symbol.map. I did not even tried to (cross-)
compile.

I w= ill think how to get the complete list to export, meantime.
This shou= ld also be problem on any arch that provides non-standard fenv
functi= ons.

commit 7573286180010304ca982d09ce5a980740e1e35e
Author:= Konstantin Belousov <kib=40=46reeBSD.org>
Date: Mon Apr 6 19:4= 1:23 2026 +0300

lib/msun: export arch-specific fenv methods
=
diff --git a/lib/msun/Makefile b/lib/msun/Makefile
index 5112337= f6297..b6e77fed5d9c 100644
--- a/lib/msun/Makefile
+++ b/lib/msun= /Makefile
=40=40 -115,6 +115,10 =40=40 LIBC=5FARCH=3D=24=7BMACHINE=5F= CPUARCH=7D
C=46LAGS+=3D -I=24=7B.CURDIR=7D/src -I=24=7BLIBC=5FSRCTOP=7D= /include =5C
-I=24=7BLIBC=5FSRCTOP=7D/=24=7BLIBC=5FARCH=7D
SYM=5F= MAPS+=3D =24=7B.CURDIR=7D/Symbol.map
+ARCH=5FMAP=3D =24=7B.CURDIR=7D/= =24=7BLIBC=5FARCH=7D/Symbol.map
+.if exists(=24=7BARCH=5FMAP=7D)
= +SYM=5FMAPS+=3D =24=7BARCH=5FMAP=7D
+.endif

VERSION=5FDE=46=3D= =24=7BLIBC=5FSRCTOP=7D/Versions.def
SYMBOL=5FMAPS=3D =24=7BSYM=5FMAP= S=7D
diff --git a/lib/msun/aarch64/Symbol.map b/lib/msun/aarch64/Symb= ol.map
new file mode 100644
index 000000000000..d24d7820ba98
= --- /dev/null
+++ b/lib/msun/aarch64/Symbol.map
=40=40 -0,0 +1,5 = =40=40
+=46BSD=5F1.9 =7B
+ fegetenv;
+ feholdexcept;
+ fe= raiseexcept;
+=7D;

May be better way is repeat = map from msun/arm/Symbol.map=3F amd64 is also equal to it here.
=46BS= D=5F1.9 =7B
fesetexceptflag;
feraiseexcept;
fegetenv;
= feholdexcept;
feupdateenv;
feenableexcept;
fedisableexcep= t;
fegetexcept;
=7D;


Started build with your diff = anyway, will see on result

--
Sincerely,
Dima (fluffy=40= =46reeBSD.org, https://t.me/=46luffyBSD, =40fluffy:matrix-dev.freebsd.org= )
(desktop, kde, x11, office, ports-secteam)=40=46reeBSD team
--69d3e63d_2ae8944a_d4c2--