bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27397] CET autodetection fails configure on i486 and i586


From: slyfox at inbox dot ru
Subject: [Bug binutils/27397] CET autodetection fails configure on i486 and i586 targets
Date: Fri, 12 Feb 2021 10:58:44 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27397

--- Comment #3 from Sergei Trofimovich <slyfox at inbox dot ru> ---
Created attachment 13219
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13219&action=edit
binutils-gdb-fix-cet.patch

We debugged it in https://bugs.gentoo.org/attachment.cgi?id=686394 a bit more
and managed to work around the failure with: binutils-gdb-fix-cet.patch

But it's not a correct patch.

Revised explanation of failure mode:

1. toolchain does not support sse2 (good, intended)
2. That leads to enable_cet=no autodetection (good, intended)
3. Then '# Check whether -fcf-protection=none -Wl,-z,ibt,-z,shstk work.' test
is ran. 'endbr' instructions are injected (via PLT stubs for shstk?).
4 That makes the test fail with SIGILL when ran on pre-SSE CPUs.
5. have_cet=yes is raised (UNINTENDED). O think 'have_cet=' is shightly
misleading. I suggest renaming it to 'requires_cet='.
6 ./configure fails with:

    if test x$enable_cet = xno -a x$have_cet = xyes; then
      AC_MSG_ERROR([Intel CET must be enabled on Intel CET enabled host])
    fi

Another possibility is to turn have_cet=yes to a positive test: if CET can run
successfully then enable it (attached patch tries to do it, but incorrectly)
(or if disabled CET makes minimal binaries crash?).

But it requires more work as './configure --disable-cet' fails with it.

Or slightly change your patch to do similar disabling on AC_TRY_RUN side
instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]