public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail
@ 2021-02-19  7:47 hsuhau617 at gmail dot com
  2021-02-19  9:46 ` [Bug libgcc/99157] " gcc-bugzilla at garstig dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: hsuhau617 at gmail dot com @ 2021-02-19  7:47 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

            Bug ID: 99157
           Summary: [ARM] libgcc -mcmse check always fail
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hsuhau617 at gmail dot com
  Target Milestone: ---

When checking -mcmse support, it will always fail.
Because it checks the return value with "$?", but in makefile it should be
"$$?".

I have a simple patch for the bug:

--- a/libgcc/config/arm/t-arm
+++ b/libgcc/config/arm/t-arm
@@ -4,7 +4,7 @@ LIB1ASMFUNCS = _thumb1_case_sqi _thumb1_case_uqi
_thumb1_case_shi \

 HAVE_CMSE:=$(findstring __ARM_FEATURE_CMSE,$(shell $(gcc_compile_bare) -dM -E
- </dev/null))
 HAVE_V81M:=$(findstring armv8.1-m.main,$(gcc_compile_bare))
-ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null
2>/dev/null; echo $?),0)
+ifeq ($(shell $(gcc_compile_bare) -E -mcmse - </dev/null >/dev/null
2>/dev/null; echo $$?),0)
 CMSE_OPTS:=-mcmse
 endif

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
@ 2021-02-19  9:46 ` gcc-bugzilla at garstig dot org
  2021-02-19 16:02 ` hsuhau617 at gmail dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: gcc-bugzilla at garstig dot org @ 2021-02-19  9:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

kratenko <gcc-bugzilla at garstig dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc-bugzilla at garstig dot org

--- Comment #1 from kratenko <gcc-bugzilla at garstig dot org> ---
Some cross links to this issue:

Original stackoverflow question:
https://stackoverflow.com/q/66240436/1358283

Question to arm embedded toolchain:
https://answers.launchpad.net/gcc-arm-embedded/+question/695596

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
  2021-02-19  9:46 ` [Bug libgcc/99157] " gcc-bugzilla at garstig dot org
@ 2021-02-19 16:02 ` hsuhau617 at gmail dot com
  2021-02-19 16:06 ` hsuhau617 at gmail dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hsuhau617 at gmail dot com @ 2021-02-19 16:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

--- Comment #2 from Hau Hsu <hsuhau617 at gmail dot com> ---
Created attachment 50221
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50221&action=edit
libgcc objdump result for gcc-7 and gcc-10

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
  2021-02-19  9:46 ` [Bug libgcc/99157] " gcc-bugzilla at garstig dot org
  2021-02-19 16:02 ` hsuhau617 at gmail dot com
@ 2021-02-19 16:06 ` hsuhau617 at gmail dot com
  2021-02-23 17:30 ` clyon at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hsuhau617 at gmail dot com @ 2021-02-19 16:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

--- Comment #3 from Hau Hsu <hsuhau617 at gmail dot com> ---
Here are some more info.

This check determines whether macro __ARM_FEATURE_CMSE is set to 3,
and affects CMSE support for function cmse_check_address_range():

void *
__attribute__ ((warn_unused_result))
cmse_check_address_range (void *p, size_t size, int flags)
{
...
#if __ARM_FEATURE_CMSE & 2
    case CMSE_MPU_NONSECURE:
      permb = cmse_TTA (pb);
      perme = singleCheck ? permb : cmse_TTA (pe);
      break;
    case CMSE_MPU_UNPRIV | CMSE_MPU_NONSECURE:
      permb = cmse_TTAT (pb);
      perme = singleCheck ? permb : cmse_TTAT (pe);
      break;
#endif
...
}

Since the check always fail, CMSE support for all multilibs are disabled.

The objdump results of v8-m.main libgcc for gcc-arm-none-eabi-7-2018-q2-update
and gcc-arm-none-eabi-10-2020-q4-major are attached.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
                   ` (2 preceding siblings ...)
  2021-02-19 16:06 ` hsuhau617 at gmail dot com
@ 2021-02-23 17:30 ` clyon at gcc dot gnu.org
  2021-02-24  2:01 ` hsuhau617 at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-02-23 17:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2021-02-23
           Assignee|unassigned at gcc dot gnu.org      |clyon at gcc dot gnu.org
     Ever confirmed|0                           |1
                 CC|                            |clyon at gcc dot gnu.org

--- Comment #4 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Confirmed.
The proposed fix works.

I sent the patch to the gcc-patches list:
https://gcc.gnu.org/pipermail/gcc-patches/2021-February/565732.html

Hau Hsu, can you confirm your name and email address are OK in the ChangeLog
entry?

Thanks

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
                   ` (3 preceding siblings ...)
  2021-02-23 17:30 ` clyon at gcc dot gnu.org
@ 2021-02-24  2:01 ` hsuhau617 at gmail dot com
  2021-02-24 16:00 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hsuhau617 at gmail dot com @ 2021-02-24  2:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

--- Comment #5 from Hau Hsu <hsuhau617 at gmail dot com> ---
Hi Christophe,
The name and email are OK.
Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
                   ` (4 preceding siblings ...)
  2021-02-24  2:01 ` hsuhau617 at gmail dot com
@ 2021-02-24 16:00 ` cvs-commit at gcc dot gnu.org
  2021-02-24 16:03 ` cvs-commit at gcc dot gnu.org
  2021-02-24 16:04 ` clyon at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 16:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Christophe Lyon <clyon@gcc.gnu.org>:

https://gcc.gnu.org/g:be30dd89926d5dd19d72f90c1586b0e2557fde43

commit r11-7361-gbe30dd89926d5dd19d72f90c1586b0e2557fde43
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Wed Feb 24 15:51:52 2021 +0000

    arm: Fix CMSE support detection in libgcc (PR target/99157)

    As discussed in the PR, the Makefile fragment lacks a double '$' to
    get the return-code from GCC invocation, resulting is CMSE support
    missing from multilibs.

    I checked that the simple patch proposed in the PR fixes the problem.

    2021-02-23  Christophe Lyon  <christophe.lyon@linaro.org>
                Hau Hsu  <hsuhau617@gmail.com>

            PR target/99157
            libgcc/
            * config/arm/t-arm: Fix cmse support detection.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
                   ` (5 preceding siblings ...)
  2021-02-24 16:00 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 16:03 ` cvs-commit at gcc dot gnu.org
  2021-02-24 16:04 ` clyon at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-02-24 16:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Christophe Lyon
<clyon@gcc.gnu.org>:

https://gcc.gnu.org/g:fcfd5cc0f428262fcce874a4c3b41e06d1296901

commit r10-9388-gfcfd5cc0f428262fcce874a4c3b41e06d1296901
Author: Christophe Lyon <christophe.lyon@linaro.org>
Date:   Wed Feb 24 15:51:52 2021 +0000

    arm: Fix CMSE support detection in libgcc (PR target/99157)

    As discussed in the PR, the Makefile fragment lacks a double '$' to
    get the return-code from GCC invocation, resulting is CMSE support
    missing from multilibs.

    I checked that the simple patch proposed in the PR fixes the problem.

    2021-02-23  Christophe Lyon  <christophe.lyon@linaro.org>
                Hau Hsu  <hsuhau617@gmail.com>

            PR target/99157
            libgcc/
            * config/arm/t-arm: Fix cmse support detection.

    (cherry picked from commit be30dd89926d5dd19d72f90c1586b0e2557fde43)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug libgcc/99157] [ARM] libgcc -mcmse check always fail
  2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
                   ` (6 preceding siblings ...)
  2021-02-24 16:03 ` cvs-commit at gcc dot gnu.org
@ 2021-02-24 16:04 ` clyon at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: clyon at gcc dot gnu.org @ 2021-02-24 16:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99157

Christophe Lyon <clyon at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #8 from Christophe Lyon <clyon at gcc dot gnu.org> ---
Now fixed on trunk and gcc-10.

Thanks for the report & patch.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-24 16:04 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19  7:47 [Bug libgcc/99157] New: [ARM] libgcc -mcmse check always fail hsuhau617 at gmail dot com
2021-02-19  9:46 ` [Bug libgcc/99157] " gcc-bugzilla at garstig dot org
2021-02-19 16:02 ` hsuhau617 at gmail dot com
2021-02-19 16:06 ` hsuhau617 at gmail dot com
2021-02-23 17:30 ` clyon at gcc dot gnu.org
2021-02-24  2:01 ` hsuhau617 at gmail dot com
2021-02-24 16:00 ` cvs-commit at gcc dot gnu.org
2021-02-24 16:03 ` cvs-commit at gcc dot gnu.org
2021-02-24 16:04 ` clyon at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).