Bug 1726636 - Request a backport of fixes for SVE Vector PCS on AArch64 (gcc part)
Summary: Request a backport of fixes for SVE Vector PCS on AArch64 (gcc part)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: gcc
Version: 8.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Marek Polacek
QA Contact: Alexandra Petlanová Hájková
URL:
Whiteboard:
Depends On:
Blocks: 1746913 1755139
TreeView+ depends on / blocked
 
Reported: 2019-07-03 10:37 UTC by Nick Clifton
Modified: 2023-07-18 14:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-12-02 15:29:44 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1724130 1 None None None 2023-07-18 14:19:32 UTC
Red Hat Issue Tracker RHELPLAN-26606 0 None None None 2021-08-27 22:40:33 UTC

Description Nick Clifton 2019-07-03 10:37:33 UTC
Clone of #1724130, created for the gcc component.

Description of problem:

Arm has introduced a vector PCS for SVE and Advanced SIMD. This showed a problem with lazy binding on SVE vector PCS while testing the qemu implementation of SVE primarily to do with saving and restoring the additional callee saved register state in the new vector PCS when lazily resolving SVE functions. 

The draft text for fixing the ABI for this is at
https://sourceware.org/ml/libc-alpha/2019-05/msg00501.html

It requires the marking of vector functions in the symbol table so the dynamic linker can bind them early. For this the symbol marking has to be propagated from the compiler to the final dynamic linked binary.


Running an executable with vector pcs turned on for SVE. Note that such binaries could be generated by other commercial toolchains as well.


This has been fixed by a series of patches for gcc
binutils and glibc. These need to be backported on systems
that run on SVE hardware to support binaries with extern
SVE calls and to support compiling code with SVE or AdvSIMD
vector calls.

Without the glibc backport, the dynamic linker clobbers
SVE call argument registers in the lazy binding entry code
when the function is first called. So binaries with extern
SVE calls will misbehave at runtime.

Without the binutils backport, the bfd linker silently
drops symbol markings at link time, creating broken
binaries that misbehave even with an updated glibc.
Without the binutils backport, the assembler fails to
assemble code with SVE or AdvSIMD calls because it does
not understand the new .variant_pcs directive.

Without the gcc backport, gcc-9 emits AdvSIMD vector calls
without marking them with .variant_pcs and thus they won't
follow the new ABI. This is unlikely to cause runtime
problems now as AdvSIMD registers are unlikely to be
corrupted by the dynamic linker, but the marking is an ABI
requirement and will be necessary to support LD_AUDIT or
arbitrary ifunc resolvers for AdvSIMD vector calls among
other features.

We plan to backport the patches below to gcc-9, binutils-2.32
and several glibc release branches.

patches:

gcc:

commit 779640c76d37b32f4d8a7b97637ed9e345d750b4
Commit:     nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
CommitDate: 2019-06-03 13:50:53 +0000

    aarch64: emit .variant_pcs for aarch64_vector_pcs symbol references
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271869 138bc75d-0d04-0410-961f-82ee72b054a4

commit d403a7711c2cf9a7a4892d76b875a1c99a690f89
Commit:     nsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>
CommitDate: 2019-06-04 16:16:52 +0000

    aarch64: fix asm visibility for extern symbols
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@271913 138bc75d-0d04-0410-961f-82ee72b054a4


Note You need to log in before you can comment on or make changes to this bug.