1
0

sync with Debian

version: 14.3.0-7 (UNRELEASED)
commit: 39ea76304d57617bd92674237f1fc91c5c12ccd5
This commit is contained in:
2025-09-07 18:09:24 +03:00
parent 08abd3e546
commit e7e0fc078c
14 changed files with 2804 additions and 50 deletions

19
debian/control vendored
View File

@@ -14,11 +14,11 @@ Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.14), g++-multilib [amd64 i38
gperf, bison, flex,
gettext, nvptx-tools [amd64 arm64 ppc64el], amdgcn-tools-19 [amd64],
texinfo, locales-all, sharutils,
procps, gnat-14:native [!arc !ia64 !sh3 !sh3eb !sh4eb !m68k], g++-14:native [!m68k], gnat-13:native [m68k], g++-13:native [m68k], netbase, gdc-14:native [!alpha !arc !ia64 !m68k !sh4 !s390 !sparc64 !hurd-amd64 !hurd-i386], python3:any, cargo [!alpha !hppa !ia64 !m68k !sh4 !x32],
procps, gnat-13:native [!arc !ia64 !sh3 !sh3eb !sh4eb], g++-13:native, netbase, gdc-13:native [!alpha !arc !ia64 !m68k !sh4 !s390 !hurd-amd64 !hurd-i386], python3:any, cargo [!alpha !hppa !ia64 !m68k !sh4 !x32],
libisl-dev (>= 0.20), libmpc-dev (>= 1.0), libmpfr-dev (>= 3.0.0-9~), libgmp-dev (>= 2:5.0.1~), lib32z1-dev [amd64], lib64z1-dev [i386], unzip <!nocheck>,
dejagnu [!alpha !riscv64 !hurd-amd64 !hurd-i386] <!nocheck>, git [!alpha !riscv64 !hurd-amd64 !hurd-i386] <!nocheck>, coreutils, chrpath, lsb-release, quilt, time,
pkgconf, libgc-dev,
g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!alpha !arc !ia64 !m68k !sh4 !s390 !sparc64 !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!arc !ia64 !sh3 !sh3eb !sh4eb] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
g++-14-for-host <cross>, gobjc-14-for-host [!avr] <cross>, gfortran-14-for-host <cross>, gdc-14-for-host [!alpha !arc !ia64 !m68k !sh4 !s390 !hurd-amd64 !hurd-i386] <cross>, gccgo-14-for-host [!arc !avr !hppa !loong64 !m68k !sh4] <cross>, gnat-14-for-host [!arc !ia64 !sh3 !sh3eb !sh4eb] <cross>, gm2-14-for-host [!powerpc !ppc64 !sh4] <cross>,
Build-Depends-Indep: doxygen <!nodoc>, graphviz <!nodoc>, ghostscript <!nodoc>, texlive-latex-base <!nodoc>, xsltproc <!nodoc>, libxml2-utils <!nodoc>, docbook-xsl-ns <!nodoc>,
Homepage: http://gcc.gnu.org/
Vcs-Browser: https://git.krd.sh/trixie-backports/gcc-14
@@ -4432,6 +4432,17 @@ Description: GNU D compiler (version 2) for the sparc-linux-gnu architecture
.
This compiler supports D language version 2.
Package: gdc-14-sparc64-linux-gnu
Architecture: sparc64
Multi-Arch: foreign
Depends: gcc-14-base (>= ${gcc:SoftVersion}), g++-14-sparc64-linux-gnu (>= ${gcc:Version}), ${dep:gdccross}, ${dep:phobosdev}, ${shlibs:Depends}, ${misc:Depends}
Description: GNU D compiler (version 2) for the sparc64-linux-gnu architecture
This is the GNU D compiler for the sparc64-linux-gnu architecture,
which compiles D on platforms supported by gcc.
It uses the gcc backend to generate optimised code.
.
This compiler supports D language version 2.
Package: gdc-14-s390x-linux-gnu
Architecture: s390x
Multi-Arch: foreign
@@ -4585,7 +4596,7 @@ Description: GNU D compiler (version 2, multilib support)
Package: libgphobos-14-dev
X-DH-Build-For-Type: target
Architecture: amd64 arm64 armel armhf i386 x32 hppa mips mips64 mipsel mips64el mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el riscv64 s390x loong64 powerpc ppc64 ppc64el
Architecture: amd64 arm64 armel armhf hppa i386 loong64 mips mips64 mips64el mips64r6 mips64r6el mipsel mipsn32 mipsn32el mipsn32r6 mipsn32r6el mipsr6 mipsr6el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32
Multi-Arch: same
Section: libdevel
Depends: gcc-14-base (= ${gcc:Version}), libgphobos5 (>= ${gdc:Version}),
@@ -4645,7 +4656,7 @@ Description: Phobos D standard library (x32 development files)
Package: libgphobos5
X-DH-Build-For-Type: target
Section: libs
Architecture: amd64 arm64 armel armhf i386 x32 hppa mips mips64 mipsel mips64el mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el riscv64 s390x loong64 powerpc ppc64 ppc64el
Architecture: amd64 arm64 armel armhf hppa i386 loong64 mips mips64 mips64el mips64r6 mips64r6el mipsel mipsn32 mipsn32el mipsn32r6 mipsn32r6el mipsr6 mipsr6el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32
Multi-Arch: same
Depends: gcc-14-base (= ${gcc:Version}), ${shlibs:Depends}, ${misc:Depends}
Description: Phobos D standard library (runtime library)

View File

@@ -14,7 +14,7 @@
#define INCLUDE_STRING
#include "config.h"
#include "system.h"
@@ -988,6 +993,113 @@ proper position among the other output f
@@ -988,6 +993,127 @@ proper position among the other output f
#define LINK_GCC_C_SEQUENCE_SPEC "%G %{!nolibc:%L %G}"
#endif
@@ -106,8 +106,22 @@
+# endif
+#endif
+
+/* Enable sframe support by default. */
+#ifndef SFRAME_SPEC
+# ifdef DIST_DEFAULT_SFRAME
+# define SFRAME_SPEC " %{!m16:%{!m32:%{!mx32:%{!ffreestanding:--gsframe}}}}"
+# else
+# define SFRAME_SPEC ""
+# endif
+#endif
+
+/* Don't enable any of those for the offload compilers,
+ unsupported. */
+#if !defined(DISTRO_DEFAULT_ASM_SPEC) && !defined(ACCEL_COMPILER)
+# define DISTRO_DEFAULT_ASM_SPEC SFRAME_SPEC
+#else
+# define DISTRO_DEFAULT_ASM_SPEC ""
+#endif
+#if !defined(DISTRO_DEFAULT_CPP_SPEC) && !defined(ACCEL_COMPILER)
+# define DISTRO_DEFAULT_CPP_SPEC TIMET64_SPEC FORTIFY_SOURCE_SPEC
+#else
@@ -128,7 +142,7 @@
#ifndef LINK_SSP_SPEC
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all" \
@@ -1044,7 +1156,7 @@ proper position among the other output f
@@ -1044,7 +1170,7 @@ proper position among the other output f
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
#ifndef LD_PIE_SPEC
@@ -137,7 +151,7 @@
#endif
#else
#define LD_PIE_SPEC ""
@@ -1161,6 +1273,7 @@ proper position among the other output f
@@ -1161,6 +1287,7 @@ proper position among the other output f
"%{flto|flto=*:%<fcompare-debug*} \
%{flto} %{fno-lto} %{flto=*} %l " LINK_PIE_SPEC \
"%{fuse-ld=*:-fuse-ld=%*} " LINK_COMPRESS_DEBUG_SPEC \
@@ -145,16 +159,17 @@
"%X %{o*} %{e*} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!r:%{!nostartfiles:%S}}} \
%{static|no-pie|static-pie:} %@{L*} %(link_libgcc) " \
@@ -1205,6 +1318,8 @@ static const char *cpp_spec = CPP_SPEC;
@@ -1205,6 +1332,9 @@ static const char *cpp_spec = CPP_SPEC;
static const char *cc1_spec = CC1_SPEC OS_CC1_SPEC;
static const char *cc1plus_spec = CC1PLUS_SPEC;
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
+static const char *distro_default_asm_spec = DISTRO_DEFAULT_ASM_SPEC;
+static const char *distro_default_cpp_spec = DISTRO_DEFAULT_CPP_SPEC;
+static const char *distro_default_spec = DISTRO_DEFAULT_SPEC;
static const char *link_ssp_spec = LINK_SSP_SPEC;
static const char *asm_spec = ASM_SPEC;
static const char *asm_final_spec = ASM_FINAL_SPEC;
@@ -1265,7 +1380,7 @@ static const char *cpp_options =
@@ -1265,7 +1395,7 @@ static const char *cpp_options =
"%(cpp_unique_options) %1 %{m*} %{std*&ansi&trigraphs} %{W*&pedantic*} %{w}\
%{f*} %{g*:%{%:debug-level-gt(0):%{g*}\
%{!fno-working-directory:-fworking-directory}}} %{O*}\
@@ -163,7 +178,15 @@
/* Pass -d* flags, possibly modifying -dumpdir, -dumpbase et al.
@@ -1459,9 +1574,9 @@ static const struct compiler default_com
@@ -1303,6 +1433,7 @@ static const char *asm_options =
to the assembler equivalents. */
"%{v} %{w:-W} %{I*} "
#endif
+DISTRO_DEFAULT_ASM_SPEC
"%(asm_debug_option)"
ASM_COMPRESS_DEBUG_SPEC
"%a %Y %{c:%W{o*}%{!o*:-o %w%b%O}}%{!c:-o %d%w%u%O}";
@@ -1459,9 +1590,9 @@ static const struct compiler default_com
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
@@ -175,7 +198,7 @@
%{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 1},
{"-",
"%{!E:%e-E or -x required when input is from standard input}\
@@ -1475,18 +1590,18 @@ static const struct compiler default_com
@@ -1475,18 +1606,18 @@ static const struct compiler default_com
%{save-temps*|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps*:%b.i} %{!save-temps*:%g.i} \n\
cc1 -fpreprocessed %{save-temps*:%b.i} %{!save-temps*:%g.i} \
@@ -197,11 +220,12 @@
{".s", "@assembler", 0, 0, 0},
{"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 0, 0},
@@ -1718,6 +1833,8 @@ static struct spec_list static_specs[] =
@@ -1718,6 +1849,9 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
INIT_STATIC_SPEC ("link_gcc_c_sequence", &link_gcc_c_sequence_spec),
+ INIT_STATIC_SPEC ("distro_defaults", &distro_default_spec),
+ INIT_STATIC_SPEC ("distro_defaults_asm", &distro_default_asm_spec),
+ INIT_STATIC_SPEC ("distro_defaults_cpp", &distro_default_cpp_spec),
INIT_STATIC_SPEC ("link_ssp", &link_ssp_spec),
INIT_STATIC_SPEC ("endfile", &endfile_spec),

View File

@@ -1,7 +1,7 @@
# DP: updates from the 14 branch upto 20250810 (documentation).
# DP: updates from the 14 branch upto 20250829 (documentation).
LANG=C git diff --no-renames --src-prefix=a/src/ --dst-prefix=b/src/ \
c9cd41fba9ebd288c4f101e4b99da934bcb96a11 959349ffd61a27c7d881374b682389a8d9d78a9d \
c9cd41fba9ebd288c4f101e4b99da934bcb96a11 591d04b6db957715fd88e9ebf5be4d96a5bc2caa \
| awk '/^diff .*\.texi/ {skip=0; print; next} /^diff / {skip=1; next} skip==0' \
| grep -v -E '^(diff|index)'
@@ -93,3 +93,15 @@ LANG=C git diff --no-renames --src-prefix=a/src/ --dst-prefix=b/src/ \
@item knl
Intel Knights Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
--- a/src/gcc/doc/sourcebuild.texi
+++ b/src/gcc/doc/sourcebuild.texi
@@ -2346,6 +2346,9 @@ whether it does so by default).
@itemx aarch64_sve1024_hw
@itemx aarch64_sve2048_hw
Like @code{aarch64_sve_hw}, but also test for an exact hardware vector length.
+@item aarch64_sme_hw
+AArch64 target that is able to generate and execute SME code (regardless of
+whether it does so by default).
@item aarch64_fjcvtzs_hw
AArch64 target that is able to generate and execute armv8.3-a FJCVTZS

File diff suppressed because it is too large Load Diff

20
debian/patches/libphobos-ppc64el.diff vendored Normal file
View File

@@ -0,0 +1,20 @@
# DP: build libphobos on ppc64el when configured --with-long-double-format=ieee
--- a/src/libphobos/configure.tgt
+++ b/src/libphobos/configure.tgt
@@ -48,6 +48,15 @@
power*-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
;;
+ powerpc64le-*-linux*)
+ LIBPHOBOS_SUPPORTED=yes
+ case "$ac_configure_args" in
+ *--with-long-double-format=ieee*)
+ ;;
+ *)
+ LIBDRUNTIME_ONLY=yes
+ esac
+ ;;
power*-*-linux*)
LIBPHOBOS_SUPPORTED=yes
LIBDRUNTIME_ONLY=yes

12
debian/patches/libphobos-sparc64.diff vendored Normal file
View File

@@ -0,0 +1,12 @@
--- a/src/libphobos/configure.tgt
+++ b/src/libphobos/configure.tgt
@@ -61,6 +61,9 @@ case "${target}" in
s390*-linux*)
LIBPHOBOS_SUPPORTED=yes
;;
+ sparc64-*-linux*)
+ LIBPHOBOS_SUPPORTED=yes
+ ;;
x86_64-*-freebsd* | i?86-*-freebsd*)
LIBPHOBOS_SUPPORTED=yes
;;

23
debian/patches/newlib-p2.diff vendored Normal file
View File

@@ -0,0 +1,23 @@
commit f13e8e21599ff12ea76980d6a8b19b0a5ebe9bed
Author: Andrew Stubbs <ams@baylibre.com>
Date: Thu Aug 7 13:09:41 2025 +0000
amdgcn, libm: fix infinite loop
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_fmod.c
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_fmod.c
@@ -70,8 +70,11 @@ DEF_VS_MATH_FUNC (v64sf, fmodf, v64sf x, v64sf y)
v64si iy;
VECTOR_IF (hy < 0x00800000, cond) // subnormal y
iy = VECTOR_INIT (-126);
- for (v64si i = (hy << 8); !ALL_ZEROES_P (cond & (i >= 0)); i <<= 1)
- VECTOR_COND_MOVE (iy, iy - 1, cond & (i >= 0));
+ for (v64si i = (hy << 8); !ALL_ZEROES_P (cond & (i >= 0)); /* i <<= 1 */)
+ {
+ VECTOR_COND_MOVE (iy, iy - 1, cond & (i >= 0));
+ VECTOR_COND_MOVE (i, i << 1, cond & (i >= 0));
+ }
VECTOR_ELSE (cond)
VECTOR_COND_MOVE (iy, (hy >> 23) - 127, cond);
VECTOR_ENDIF

301
debian/patches/newlib-p3.diff vendored Normal file
View File

@@ -0,0 +1,301 @@
commit bd409f3c12e28e1464dec7fd0d45db30280f1e56
Author: Andrew Stubbs <ams@baylibre.com>
Date: Wed Aug 27 10:11:25 2025 +0000
amdgcn, libm: fix vector ilogb bugs (bug 33272)
--- a/newlib/libm/machine/amdgcn/amdgcn_veclib.h
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/amdgcn_veclib.h
@@ -267,7 +267,15 @@ do { \
__tmp; \
})
-#define VECTOR_WHILE(cond, cond_var, prev_cond_var) \
+#define VECTOR_WHILE(cond, cond_var) \
+{ \
+ __auto_type cond_var = __mask; \
+ for (;;) { \
+ cond_var &= __builtin_convertvector (cond, __typeof (cond_var)); \
+ if (ALL_ZEROES_P (cond_var)) \
+ break;
+
+#define VECTOR_WHILE2(cond, cond_var, prev_cond_var) \
{ \
__auto_type cond_var = prev_cond_var; \
for (;;) { \
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64df_fmod.c
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64df_fmod.c
@@ -61,17 +61,19 @@ DEF_VD_MATH_FUNC (v64df, fmod, v64df x, v64df y)
v64si ix;
VECTOR_IF (hx < 0x00100000, cond) // subnormal x
VECTOR_IF2 (hx == 0, cond2, cond)
- ix = VECTOR_INIT (-1043);
- for (v64si i = __builtin_convertvector (lx, v64si);
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-1043), cond2);
+ v64si i = __builtin_convertvector (lx, v64si);
+ VECTOR_WHILE2 (i > 0, cond3, cond2);
+ VECTOR_COND_MOVE (ix, ix - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ELSE2 (cond2, cond)
- ix = VECTOR_INIT (-1022);
- for (v64si i = __builtin_convertvector (hx << 11, v64si);
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-1022), cond2);
+ v64si i = __builtin_convertvector (hx << 11, v64si);
+ VECTOR_WHILE2 (i > 0, cond3, cond2)
+ VECTOR_COND_MOVE (ix, ix - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ENDIF
VECTOR_ELSE (cond)
VECTOR_COND_MOVE (ix, (hx >> 20) - 1023, cond);
@@ -81,17 +83,19 @@ DEF_VD_MATH_FUNC (v64df, fmod, v64df x, v64df y)
v64si iy;
VECTOR_IF (hy < 0x00100000, cond) // subnormal y
VECTOR_IF2 (hy == 0, cond2, cond)
- iy = VECTOR_INIT (-1043);
- for (v64si i = __builtin_convertvector (ly, v64si);
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (iy, iy - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (iy, VECTOR_INIT (-1043), cond2);
+ v64si i = __builtin_convertvector (ly, v64si);
+ VECTOR_WHILE2 (i > 0, cond3, cond2);
+ VECTOR_COND_MOVE (iy, iy - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ELSE2 (cond2, cond)
- iy = VECTOR_INIT (-1022);
- for (v64si i = __builtin_convertvector (hy << 11, v64si);
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (iy, iy - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (iy, VECTOR_INIT (-1022), cond2);
+ v64si i = __builtin_convertvector (hy << 11, v64si);
+ VECTOR_WHILE2 (i > 0, cond3, cond2);
+ VECTOR_COND_MOVE (iy, iy - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ENDIF
VECTOR_ELSE (cond)
VECTOR_COND_MOVE (iy, (hy >> 20) - 1023, cond);
@@ -130,29 +134,26 @@ DEF_VD_MATH_FUNC (v64df, fmod, v64df x, v64df y)
/* fix point fmod */
v64si n = ix - iy;
- v64si cond = n != 0;
- while (!ALL_ZEROES_P (cond))
- {
- hz = hx - hy;
- lz = lx - ly;
- VECTOR_IF2 (lx < ly, cond2, cond)
- VECTOR_COND_MOVE (hz, hz - 1, cond2);
- VECTOR_ENDIF
- VECTOR_IF2 (hz < 0, cond2, cond)
- VECTOR_COND_MOVE (hx, hx + hx + (__builtin_convertvector(lx, v64usi) >> 31), cond2);
- VECTOR_COND_MOVE (lx, lx + lx, cond2);
- VECTOR_ELSE2 (cond2, cond)
- VECTOR_IF2 ((hz | lz) == 0, cond3, cond2) // return sign(x)*0
- VECTOR_RETURN (zeroes, cond3);
- VECTOR_ENDIF
- VECTOR_COND_MOVE (hx, hz + hz + (__builtin_convertvector(lz, v64usi) >> 31), cond2);
- VECTOR_COND_MOVE (lx, lz + lz, cond2);
+ VECTOR_WHILE (n != 0, cond)
+ hz = hx - hy;
+ lz = lx - ly;
+ VECTOR_IF2 (lx < ly, cond2, cond)
+ VECTOR_COND_MOVE (hz, hz - 1, cond2);
+ VECTOR_ENDIF
+ VECTOR_IF2 (hz < 0, cond2, cond)
+ VECTOR_COND_MOVE (hx, hx + hx + (__builtin_convertvector(lx, v64usi) >> 31), cond2);
+ VECTOR_COND_MOVE (lx, lx + lx, cond2);
+ VECTOR_ELSE2 (cond2, cond)
+ VECTOR_IF2 ((hz | lz) == 0, cond3, cond2) // return sign(x)*0
+ VECTOR_RETURN (zeroes, cond3);
VECTOR_ENDIF
+ VECTOR_COND_MOVE (hx, hz + hz + (__builtin_convertvector(lz, v64usi) >> 31), cond2);
+ VECTOR_COND_MOVE (lx, lz + lz, cond2);
+ VECTOR_ENDIF
- n += cond; // Active lanes should be -1
- cond &= (n != 0);
- }
+ VECTOR_COND_MOVE (n, n - 1, cond);
+ VECTOR_ENDWHILE
hz = hx - hy;
lz = lx - ly;
@@ -164,15 +165,11 @@ DEF_VD_MATH_FUNC (v64df, fmod, v64df x, v64df y)
/* convert back to floating value and restore the sign */
VECTOR_RETURN (zeroes, (hx | lx) == 0); // return sign(x)*0
- cond = hx < 0x00100000;
- while (!ALL_ZEROES_P (cond)) // normalize x
- {
- VECTOR_COND_MOVE (hx, hx + hx + (lx >> 31), cond);
- VECTOR_COND_MOVE (lx, lx + lx, cond);
- iy += cond; // Active lanes should be -1
-
- cond &= (hx < 0x00100000);
- }
+ VECTOR_WHILE (hx < 0x00100000, cond) // normalize x
+ VECTOR_COND_MOVE (hx, hx + hx + (lx >> 31), cond);
+ VECTOR_COND_MOVE (lx, lx + lx, cond);
+ VECTOR_COND_MOVE (iy, iy - 1, cond);
+ VECTOR_ENDWHILE
VECTOR_IF (iy >= -1022, cond) // normalize output
VECTOR_COND_MOVE (hx, (hx - 0x00100000) | ((iy + 1023) << 20), cond);
INSERT_WORDS (x, hx | sx, lx, cond);
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64df_ilogb.c
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64df_ilogb.c
@@ -36,17 +36,19 @@ DEF_VD_MATH_PRED (v64si, ilogb, v64df x)
VECTOR_IF (hx < 0x00100000, cond)
VECTOR_RETURN (VECTOR_INIT (-__INT_MAX__), cond & ((hx | lx) == 0)); // FP_ILOGB0
VECTOR_IF2 (hx == 0, cond2, cond)
- ix = VECTOR_INIT (-1043);
- for (v64si i = lx;
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-1043), cond2);
+ v64si i = lx;
+ VECTOR_WHILE2 (i > 0, cond3, cond2)
+ VECTOR_COND_MOVE (ix, ix - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ELSE2 (cond2, cond)
- ix = VECTOR_INIT (-1022);
- for (v64si i = (hx << 11);
- !ALL_ZEROES_P (cond2 & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond2 & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-1022), cond2);
+ v64si i = (hx << 11);
+ VECTOR_WHILE2 (i > 0, cond3, cond2)
+ VECTOR_COND_MOVE (ix, ix - 1, cond3);
+ VECTOR_COND_MOVE (i, i << 1, cond3);
+ VECTOR_ENDWHILE
VECTOR_ENDIF
VECTOR_RETURN (ix, cond);
VECTOR_ENDIF
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_fmod.c
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_fmod.c
@@ -57,11 +57,12 @@ DEF_VS_MATH_FUNC (v64sf, fmodf, v64sf x, v64sf y)
/* determine ix = ilogb(x) */
v64si ix;
VECTOR_IF (hx < 0x00800000, cond) // subnormal x
- ix = VECTOR_INIT (-126);
- for (v64si i = (hx << 8);
- !ALL_ZEROES_P (cond & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-126), cond);
+ v64si i = hx << 8;
+ VECTOR_WHILE2 (i > 0, cond2, cond)
+ VECTOR_COND_MOVE (ix, ix - 1, cond2);
+ VECTOR_COND_MOVE (i, i << 1, cond2);
+ VECTOR_ENDWHILE
VECTOR_ELSE (cond)
VECTOR_COND_MOVE (ix, (hx >> 23) - 127, cond);
VECTOR_ENDIF
@@ -69,12 +70,12 @@ DEF_VS_MATH_FUNC (v64sf, fmodf, v64sf x, v64sf y)
/* determine iy = ilogb(y) */
v64si iy;
VECTOR_IF (hy < 0x00800000, cond) // subnormal y
- iy = VECTOR_INIT (-126);
- for (v64si i = (hy << 8); !ALL_ZEROES_P (cond & (i >= 0)); /* i <<= 1 */)
- {
- VECTOR_COND_MOVE (iy, iy - 1, cond & (i >= 0));
- VECTOR_COND_MOVE (i, i << 1, cond & (i >= 0));
- }
+ VECTOR_COND_MOVE (iy, VECTOR_INIT (-126), cond);
+ v64si i = (hy << 8);
+ VECTOR_WHILE2 (i >= 0, cond2, cond)
+ VECTOR_COND_MOVE (iy, iy - 1, cond2);
+ VECTOR_COND_MOVE (i, i << 1, cond2);
+ VECTOR_ENDWHILE
VECTOR_ELSE (cond)
VECTOR_COND_MOVE (iy, (hy >> 23) - 127, cond);
VECTOR_ENDIF
@@ -99,24 +100,21 @@ DEF_VS_MATH_FUNC (v64sf, fmodf, v64sf x, v64sf y)
/* fix point fmod */
v64si n = ix - iy;
- v64si cond = n != 0;
- while (!ALL_ZEROES_P (cond))
- {
- hz = hx - hy;
- VECTOR_IF2 (hz < 0, cond2, cond)
- VECTOR_COND_MOVE (hx, hx + hx, cond2);
- VECTOR_ELSE2 (cond2, cond)
- VECTOR_IF2 (hz == 0, cond3, cond2) // return sign(x)*0
- VECTOR_RETURN (zeroes, cond3);
- VECTOR_ELSE2 (cond3, cond2)
- VECTOR_COND_MOVE (hx, hz + hz, cond2);
- VECTOR_ENDIF
+ VECTOR_WHILE (n != 0, cond)
+ hz = hx - hy;
+ VECTOR_IF2 (hz < 0, cond2, cond)
+ VECTOR_COND_MOVE (hx, hx + hx, cond2);
+ VECTOR_ELSE2 (cond2, cond)
+ VECTOR_IF2 (hz == 0, cond3, cond2) // return sign(x)*0
+ VECTOR_RETURN (zeroes, cond3);
+ VECTOR_ELSE2 (cond3, cond2)
+ VECTOR_COND_MOVE (hx, hz + hz, cond2);
VECTOR_ENDIF
+ VECTOR_ENDIF
- n += cond; // Active lanes should be -1
- cond &= (n != 0);
- }
+ n += cond; // Active lanes should be -1
+ VECTOR_ENDWHILE
hz = hx - hy;
VECTOR_COND_MOVE (hx, hz, hz >= 0);
@@ -124,14 +122,10 @@ DEF_VS_MATH_FUNC (v64sf, fmodf, v64sf x, v64sf y)
/* convert back to floating value and restore the sign */
VECTOR_RETURN (zeroes, hx == 0); // return sign(x)*0
- cond = hx < 0x00800000;
- while (!ALL_ZEROES_P (cond)) // normalize x
- {
+ VECTOR_WHILE (hx < 0x00800000, cond) // normalize x
VECTOR_COND_MOVE (hx, hx + hx, cond);
iy += cond; // Active lanes should be -1
-
- cond &= (hx < 0x00800000);
- }
+ VECTOR_ENDWHILE
VECTOR_IF (iy >= -126, cond) // normalize output
VECTOR_COND_MOVE (hx, (hx - 0x00800000) | ((iy + 127) << 23), cond);
SET_FLOAT_WORD (x, hx | sx, cond);
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_ilogb.c
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/v64sf_ilogb.c
@@ -38,11 +38,12 @@ DEF_VS_MATH_FUNC (v64si, ilogbf, v64sf x)
VECTOR_RETURN (VECTOR_INIT (-__INT_MAX__), cond); // FP_ILOGB0
VECTOR_ENDIF
VECTOR_IF (FLT_UWORD_IS_SUBNORMAL (hx), cond)
- ix = VECTOR_INIT (-126);
- for (v64si i = (hx << 8);
- !ALL_ZEROES_P (cond & (i > 0));
- i <<= 1)
- VECTOR_COND_MOVE (ix, ix - 1, cond & (i > 0));
+ VECTOR_COND_MOVE (ix, VECTOR_INIT (-126), cond);
+ v64si i = (hx << 8);
+ VECTOR_WHILE2 (i > 0, cond2, cond)
+ VECTOR_COND_MOVE (ix, ix - 1, cond2);
+ VECTOR_COND_MOVE (i, i << 1, cond2);
+ VECTOR_ENDWHILE
VECTOR_RETURN (ix, cond);
VECTOR_ELSEIF (~FLT_UWORD_IS_FINITE (hx), cond)
VECTOR_RETURN (VECTOR_INIT (__INT_MAX__), cond);

43
debian/patches/newlib-pr119325.diff vendored Normal file
View File

@@ -0,0 +1,43 @@
From 2ef1a37e7823b21eda524972c006e0e8c26f97b3 Mon Sep 17 00:00:00 2001
From: Andrew Stubbs <ams@baylibre.com>
Date: Thu, 20 Mar 2025 09:32:31 +0000
Subject: [PATCH] Fix GCN SIMD libm bug
Since January, GCC has been miscompiling Newlib libm on AMD GCN due to
undefined behaviour in the RESIZE_VECTOR macro. It was "working" but expanding
the size of a vector would no longer zero the additional lanes, as it expected.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119325
---
newlib/libm/machine/amdgcn/amdgcn_veclib.h | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--- a/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/amdgcn_veclib.h
+++ b/newlib-4.5.0.20241231/newlib/libm/machine/amdgcn/amdgcn_veclib.h
@@ -85,8 +85,21 @@ typedef union {
#define RESIZE_VECTOR(to_t, from) \
({ \
- __auto_type __from = (from); \
- *((to_t *) &__from); \
+ to_t __to; \
+ if (VECTOR_WIDTH (to_t) < VECTOR_WIDTH (__typeof (from))) \
+ asm ("; no-op cast %0" : "=v"(__to) : "0"(from)); \
+ else \
+ { \
+ unsigned long __mask = -1L; \
+ int lanes = VECTOR_WIDTH (__typeof (from)); \
+ __mask <<= lanes; \
+ __builtin_choose_expr ( \
+ V_SF_SI_P (to_t), \
+ ({asm ("v_mov_b32 %0, 0" : "=v"(__to) : "0"(from), "e"(__mask));}), \
+ ({asm ("v_mov_b32 %H0, 0\n\t" \
+ "v_mov_b32 %L0, 0" : "=v"(__to) : "0"(from), "e"(__mask));})); \
+ } \
+ __to; \
})
/* Bit-wise cast vector FROM to type TO_T. */
--
2.43.5

7
debian/rules.conf vendored
View File

@@ -202,8 +202,10 @@ else
BINUTILSBDV = 2.36
else ifneq (,$(filter $(distrelease),jammy))
BINUTILSBDV = 2.38
else
else ifneq (,$(filter $(distrelease),$(no_sframe_distreleases)))
BINUTILSBDV = 2.39
else
BINUTILSBDV = 2.45
endif
endif
ifeq ($(DEB_CROSS),yes)
@@ -539,6 +541,9 @@ else ifneq (,$(filter $(distrelease), bullseye hirsute jammy))
else ifneq (,$(filter $(distrelease), impish))
gnat_build_dep := gnat-11$(NT) [$(ada_no_archs)], g++-11$(NT)
gdc_build_dep := gdc-11$(NT) [$(d_no_archs)]
else ifneq (,$(filter $(distrelease), forky questing))
gnat_build_dep := gnat-13$(NT) [$(ada_no_archs)], g++-13$(NT)
gdc_build_dep := gdc-13$(NT) [$(d_no_archs)]
else ifneq (,$(filter $(distrelease), trixie forky))
# FIXME: bump to 14 on all archs before release
gnat_build_dep := gnat-14$(NT) [$(ada_no_archs) !m68k], g++-14$(NT) [!m68k], gnat-13$(NT) [m68k], g++-13$(NT) [m68k]

33
debian/rules.defs vendored
View File

@@ -386,6 +386,10 @@ ifneq ($(trunk_build),yes)
ifneq (,$(filter $(DEB_HOST_ARCH), alpha hppa ia64 m68k mips mipsel mips64el sh4 sparc64 hurd-amd64 hurd-i386))
with_lto_build :=
endif
# Slow builders in Debian
ifeq ($(distribution)-$(DEB_HOST_ARCH),Debian-riscv64)
with_lto_build :=
endif
# FIXME: newer binutils needed?
ifneq (,$(filter $(distrelease),stretch precise trusty xenial bionic focal))
@@ -556,6 +560,20 @@ else ifneq (,$(filter $(DEB_TARGET_ARCH), arm armel))
float_abi := soft
endif
sframe_archs = amd64 arm64
no_sframe_distreleases = jessy stretch buster bullseye bookworm trixie \
forky \
precise trusty xenial bionic focal jammy kinetic lunar mantic \
noble oracular plucky questing
ifneq (,$(filter $(DEB_TARGET_ARCH), $(sframe_archs)))
ifeq (,$(filter $(distrelease),$(no_sframe_distreleases)))
with_sframe = yes
endif
endif
ppc64el_ibm128_distreleases = jessie stretch buster bullseye bookworm trixie \
precise xenial bionic focal jammy noble oracular plucky
# -------------------------------------------------------------------
# basic config
@@ -1046,7 +1064,7 @@ endif
# D ---------------------------
d_no_cross := yes
d_no_snap :=
d_no_cpus := alpha arc ia64 m68k sh4 s390 sparc64
d_no_cpus := alpha arc ia64 m68k sh4 s390
d_no_systems := gnu
ifneq ($(separate_lang),yes)
@@ -1076,14 +1094,21 @@ ifeq ($(with_base_only),yes)
endif
ifeq ($(with_d),yes)
druntime_only_archs = powerpc ppc64 ppc64el
phobos_archs = amd64 arm64 armel armhf i386 x32
phobos_archs =
druntime_only_archs = powerpc ppc64
ifneq (,$(filter $(distrelease),$(ppc64el_ibm128_distreleases)))
druntime_only_archs += ppc64el
else
phobos_archs += ppc64el
endif
phobos_archs += amd64 arm64 armel armhf i386 x32
phobos_archs += hppa
phobos_archs += mips mips64 mipsel mips64el
phobos_archs += mipsn32 mipsn32el
phobos_archs += mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el
phobos_archs += riscv64 s390x loong64
phobos_archs += riscv64 s390x loong64 sparc64
phobos_archs += $(druntime_only_archs)
phobos_archs := $(sort $(phobos_archs))
ifneq (,$(filter $(DEB_TARGET_ARCH), $(phobos_archs)))
with_phobos := yes
endif

6
debian/rules.patch vendored
View File

@@ -77,6 +77,8 @@ debian_patches += \
libphobos-unittest \
pr118045 \
binutils-pr32491 \
libphobos-ppc64el \
libphobos-sparc64 \
# see https://bugs.debian.org/1108322
ifneq (,$(filter $(DEB_TARGET_ARCH),hppa m68k powerpc))
@@ -370,6 +372,10 @@ endif
ifeq ($(with_timet64),yes)
echo '#define DIST_DEFAULT_TIMET64 1' \
>> $(srcdir)/gcc/distro-defaults.h
endif
ifeq ($(with_sframe),yes)
echo '#define DIST_DEFAULT_SFRAME 1' \
>> $(srcdir)/gcc/distro-defaults.h
endif
echo '#endif' \
>> $(srcdir)/gcc/distro-defaults.h

3
debian/rules.unpack vendored
View File

@@ -186,6 +186,9 @@ $(unpack_stamp)-$(newlib_tarball): $(newlib_tarpath) $(unpack_stamp)-$(gcc_tarba
mkdir -p $(stampdir)
: # rm -rf $(newlib_srcdir)
tar -x -f $(newlib_tarpath)
patch -p1 < debian/patches/newlib-pr119325.diff
patch -p1 < debian/patches/newlib-p2.diff
patch -p1 < debian/patches/newlib-p3.diff
echo "$(newlib_tarball) unpacked." > $@
endif

31
debian/rules2 vendored
View File

@@ -650,21 +650,11 @@ ifeq ($(DEB_TARGET_ARCH_OS),linux)
endif
endif
ifneq (,$(filter $(derivative),Ubuntu))
ifneq (,$(filter $(DEB_TARGET_ARCH), ppc64el))
ifneq (,$(filter $(distrelease),precise xenial bionic focal jammy noble oracular plucky))
# ieee default
else
CONFARGS += --with-long-double-format=ieee
endif
endif
else ifneq (,$(filter $(derivative),Debian))
ifneq (,$(filter $(DEB_TARGET_ARCH), ppc64el))
ifneq (,$(filter $(distrelease),jessie stretch buster bullseye bookworm trixie))
# ieee default
else
CONFARGS += --with-long-double-format=ieee
endif
ifneq (,$(filter $(DEB_TARGET_ARCH), ppc64el))
ifneq (,$(filter $(distrelease), $(ppc64el_ibm128_distreleases)))
# default to IBM double
else
CONFARGS += --with-long-double-format=ieee
endif
endif
@@ -698,6 +688,17 @@ ifneq (,$(filter $(DEB_TARGET_ARCH), amd64 i386))
endif
endif
ifneq (,$(filter $(derivative),Ubuntu))
ifeq ($(DEB_TARGET_ARCH),amd64)
# only passed in the environment by dpkg-buildpackage
ifeq ($(DEB_HOST_ARCH_VARIANT),amd64v3)
CONFARGS += --with-arch-64=x86-64-v3
else ifeq ($(DEB_HOST_ARCH_VARIANT),amd64v4)
CONFARGS += --with-arch-64=x86-64-v4
endif
endif
endif
ifeq ($(DEB_TARGET_ARCH),amd64)
CONFARGS += --with-abi=m64
endif