• Bug#1105170: unblock: glibc/2.41-8 (3/3)

    From Sebastian Ramacher@21:1/5 to Aurelien Jarno on Wed May 14 18:10:01 2025
    [continued from previous message]

    + &state->basic, sizeof (state->basic));
    +
    +- /* struct sigcontext is laid out so that starting at sc_fpkind mimics +- a struct i386_float_state. */
    +- _Static_assert (offsetof (struct sigcontext, sc_i386_float_state)
    +- % __alignof__ (struct i386_float_state) == 0,
    +- "sc_i386_float_state layout mismatch");
    +- ok = machine_get_state (ss->thread, state, i386_FLOAT_STATE,
    +- &state->fpu, &scp->sc_i386_float_state,
    +- sizeof (state->fpu));
    ++ scp->xstate = NULL;
    ++#ifdef i386_XFLOAT_STATE
    ++ if (xstate_size > 0)
    ++ {
    ++ mach_msg_type_number_t got = (xstate_size / sizeof (int));
    ++
    ++ ok = (! __thread_get_state (ss->thread, i386_XFLOAT_STATE,
    ++ (thread_state_t) stackframe->xstate, &got)
    ++ && got == (xstate_size / sizeof (int)));
    ++
    ++ if (((struct i386_xfloat_state*) stackframe->xstate)->fp_save_kind > 5)
    ++ /* We support up to XSAVES */
    ++ ok = 0;
    ++
    ++ if (ok)
    ++ {
    ++ scp->xstate = (struct i386_xfloat_state*) stackframe->xstate;
    ++ assert((uintptr_t)scp->xstate->hw_state % 64 == 0);
    ++ }
    ++ }
    ++ else
    ++#endif
    ++ ok = 0;
    ++ if (!ok)
    ++ {
    ++ /* struct sigcontext is laid out so that starting at sc_fpkind mimics
    ++ a struct i386_float_state. */
    ++ _Static_assert (offsetof (struct sigcontext, sc_i386_float_state) ++ % __alignof__ (struct i386_float_state) == 0,
    ++ "sc_i386_float_state layout mismatch");
    ++ ok = machine_get_state (ss->thread, state, i386_FLOAT_STATE,
    ++ &state->fpu, &scp->sc_i386_float_state,
    ++ sizeof (state->fpu));
    ++ }
    +
    + /* Set up the arguments for the signal handler. */
    + stackframe->signo = signo;
    +diff --git a/sysdeps/mach/hurd/x86_64/bits/sigcontext.h b/sysdeps/mach/hurd/x86_64/bits/sigcontext.h
    +index 7bac881176..d83795fcbc 100644
    +--- a/sysdeps/mach/hurd/x86_64/bits/sigcontext.h
    ++++ b/sysdeps/mach/hurd/x86_64/bits/sigcontext.h
    +@@ -96,6 +96,8 @@ struct sigcontext
    + struct i386_fp_save sc_fpsave;
    + struct i386_fp_regs sc_fpregs;
    + int sc_fpexcsr; /* FPSR including exception bits. */
    ++
    ++ struct i386_xfloat_state *xstate;
    + };
    +
    + /* Traditional BSD names for some members. */
    +diff --git a/sysdeps/mach/hurd/x86_64/sigreturn.c b/sysdeps/mach/hurd/x86_64/sigreturn.c
    +index 81a2d3ba74..dff8e76dc8 100644
    +--- a/sysdeps/mach/hurd/x86_64/sigreturn.c
    ++++ b/sysdeps/mach/hurd/x86_64/sigreturn.c
    +@@ -20,6 +20,8 @@
    + #include <hurd/msg.h>
    + #include <stdlib.h>
    +
    ++#include <cpuid.h>
    ++
    + /* This is run on the thread stack after restoring it, to be able to
    + unlock SS off sigstack. */
    + void
    +@@ -116,10 +118,32 @@ __sigreturn (struct sigcontext *scp)
    + if (scp->sc_onstack)
    + ss->sigaltstack.ss_flags &= ~SS_ONSTACK;
    +
    +- if (scp->sc_fpused)
    +- /* Restore the FPU state. Mach conveniently stores the state
    +- in the format the i387 `frstor' instruction uses to restore it. */ +- asm volatile ("frstor %0" : : "m" (scp->sc_fpsave));
    ++#ifdef i386_XFLOAT_STATE
    ++ if ((scp->xstate) && (scp->xstate->initialized))
    ++ {
    ++ unsigned eax, ebx, ecx, edx;
    ++ __cpuid_count(0xd, 0, eax, ebx, ecx, edx);
    ++ switch (scp->xstate->fp_save_kind)
    ++ {
    ++ case 0: // FNSAVE
    ++ asm volatile("frstor %0" : : "m" (scp->xstate->hw_state));
    ++ break;
    ++ case 1: // FXSAVE
    ++ asm volatile("fxrstor %0" : : "m" (scp->xstate->hw_state), \ ++ "a" (eax), "d" (edx));
    ++ break;
    ++ default: // XSAVE, XSAVEOPT, XSAVEC, XSAVES
    ++ asm volatile("xrstor %0" : : "m" (scp->xstate->hw_state), \ ++ "a" (eax), "d" (edx));
    ++ break;
    ++ }
    ++ }
    ++ else
    ++#endif
    ++ if (scp->sc_fpused)
    ++ /* Restore the FPU state. Mach conveniently stores the state
    ++ in the format the i387 `frstor' instruction uses to restore it. */
    ++ asm volatile ("frstor %0" : : "m" (scp->sc_fpsave));
    +
    + /* Copy the registers onto the user's stack, to be able to release the
    + altstack (by unlocking sigstate). Note that unless an altstack is used,
    diff --git a/debian/patches/hurd-i386/local-intr-msg-clobber.diff b/debian/patches/hurd-i386/local-intr-msg-clobber.diff
    deleted file mode 100644
    index d4a946fc..00000000
    --- a/debian/patches/hurd-i386/local-intr-msg-clobber.diff
    +++ /dev/null
    @@ -1,23 +0,0 @@
    -Force putting save_data on the stack rather than in SSE register
    -
    -The signal management does not yet properly save SSE state, so that save_data
    -would get overwritten by signal handlers, notably leading to `` shell -replacement getting empty content because then the io_read RPC retry gets an -MIG_BAD_ARGUMENTS error.
    -
    -XXX: This is only temporary to fix the common shll replacement issue, and is -waiting for proper SSE state restoration.
    -
    -Index: glibc-2.38/hurd/intr-msg.c -===================================================================
    ---- glibc-2.38.orig/hurd/intr-msg.c
    -+++ glibc-2.38/hurd/intr-msg.c
    -@@ -79,7 +79,7 @@ _hurd_intr_rpc_mach_msg (mach_msg_header
    - mach_msg_bits_t msgh_bits;
    - mach_port_t remote_port;
    - mach_msg_id_t msgid;
    -- struct clobber save_data;
    -+ volatile struct clobber save_data;
    -
    - if ((option & (MACH_SEND_MSG|MACH_RCV_MSG)) != (MACH_SEND_MSG|MACH_RCV_MSG)
    - || _hurd_msgport_thread == MACH_PORT_NULL)
    diff --git a/debian/patches/series b/debian/patches/series
    index f82a08aa..f45c42a2 100644
    --- a/debian/patches/series
    +++ b/debian/patches/series
    @@ -25,15 +25,19 @@ arm/local-arm-futex.diff

    # Commited for 2.42
    hurd-i386/git-proc_reauth.diff
    -
    -# Commited for 2.42
    hurd-i386/git-mig-strncpy.diff
    -hurd-i386/local-pthread_once.diff
    hurd-i386/git-pthread_sigmask_nothread.diff
    hurd-i386/git-rt-timedwait-realtime.diff
    hurd-i386/git-pthread_setcancel.diff
    +hurd-i386/git-dup-refcnt.diff
    +hurd-i386/git-xstate.diff
    +hurd-i386/git-utime-EINVAL.diff
    +hurd-i386/git-xstate-initialized.diff +hurd-i386/git-signal-fpe-exceptions.diff
    +hurd-i386/git-symlink-eexist.diff
    +
    +hurd-i386/local-pthread_once.diff

    -hurd-i386/local-intr-msg-clobber.diff
    hurd-i386/local-enable-ldconfig.diff
    hurd-i386/tg-sysvshm.diff
    hurd-i386/tg-thread-cancel.diff
    diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po
    index a9a29128..a13d5709 100644
    --- a/debian/po/pt_BR.po
    +++ b/debian/po/pt_BR.po
    @@ -3,17 +3,16 @@
    # This file is distributed under the same license as the glibc package.
    # Felipe Augusto van de Wiel (faw) <faw@debian.org>, 2007-2008.
    # Fernando Ike de Oliveira (fike) <fike@midstorm.org>, 2013.
    -# Adriano Rafael Gomes <adrianorg@debian.org>, 2014-2023.
    +# Adriano Rafael Gomes <adrianorg@debian.org>, 2014-2025.
    #
    msgid ""
    msgstr ""
    "Project-Id-Version: glibc\n"
    "Report-Msgid-Bugs-To: glibc@packages.debian.org\n"
    "POT-Creation-Date: 2025-01-02 16:30+0000\n"
    -"PO-Revision-Date: 2023-01-08 13:21-0300\n"
    +"PO-Revision-Date: 2025-03-21 14:35-0300\n"
    "Last-Translator: Adriano Rafael Gomes <adrianorg@debian.org>\n" -"Language-Team: Brazilian Portuguese <debian-l10n-" -"portuguese@lists.debian.org>\n"
    +"Language-Team: pt_BR <debian-l10n-portuguese@lists.debian.org>\n"
    "Language: pt_BR\n"
    "MIME-Version: 1.0\n"
    "Content-Type: text/plain; charset=UTF-8\n"
    @@ -62,6 +61,8 @@ msgid ""
    "Please note that the C, C.UTF-8 and POSIX locales are always available and "
    "do not need to be generated."
    msgstr ""
    +"Por favor, note que os locales C, C.UTF-8 e POSIX sempre estão disponíveis e "
    +"não precisam ser gerados."

    #. Type: select
    #. Choices
    diff --git a/debian/rules.d/debhelper.mk b/debian/rules.d/debhelper.mk
    index 5440e4ce..6da52d6e 100644
    --- a/debian/rules.d/debhelper.mk
    +++ b/debian/rules.d/debhelper.mk
    @@ -130,7 +130,6 @@ $(stamp)debhelper-common:
    -e 'BEGIN {open(IN, "debian/tmp/usr/share/i18n/SUPPORTED"); $$l = join("", grep { !/^C\.UTF-8/ } grep { /UTF-8/ } <IN>);} s/__PROVIDED_LOCALES__/$$l/g;' \
    -e 's#DEB_VERSION_UPSTREAM#$(DEB_VERSION_UPSTREAM)#g;' \
    -e 's#CURRENT_VER#$(DEB_VERSION)#g;' \
    - -e 's#LIBC#$(libc)#g;' \
    $$x > $$y ; \
    case $$y in \
    *.install) \
    diff --git a/debian/testsuite-xfail-debian.mk b/debian/testsuite-xfail-debian.mk
    index 60191e83..99fd1224 100644
    --- a/debian/testsuite-xfail-debian.mk
    +++ b/debian/testsuite-xfail-debian.mk
    @@ -306,17 +306,6 @@ test-xfail-tst-open-tmpfile = yes
    test-xfail-tst-closedir-leaks = yes
    test-xfail-tst-closedir-leaks-mem = yes

    -# Missing RLIMIT_AS/overcommit enforcement
    -tests-unsupported += tst-basic7
    -tests-unsupported += test-lfs
    -tests-unsupported += tst-asprintf-null
    -tests-unsupported += bug18240
    -tests-unsupported += tst-vfprintf-width-prec
    -tests-unsupported += tst-vfprintf-width-prec-mem
    -tests-unsupported += tst-vfprintf-width-prec-alloc
    -tests-unsupported += test-bz22786 tst-strtod-overflow
    -tests-unsupported += tst-tzset
    -
    # new in 2.22
    test-xfail-tst-prelink = yes

    @@ -443,6 +432,7 @@ test-xfail-tst-execstack-prog-noexecstack = yes
    test-xfail-tst-support-process_state = yes
    test-xfail-tst-audit12 = yes
    test-xfail-tst-audit28 = yes
    +test-xfail-tst-execstack-prog-static-tunable = yes

    # actually never succeded
    test-xfail-tst-create_format1 = yes


    --
    Sebastian Ramacher

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)