From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 254123858C27; Mon, 13 Feb 2023 19:56:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 254123858C27 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676318192; bh=FIZGucNg01E4a7wwdERNCrkyQFyf7gs2RY7oz0tNC3I=; h=From:To:Subject:Date:From; b=GjoIKL0qXLX6Rnrn9vmv237hp3IdOi8Oj+1OPfsXo+VhAoSp9Yb3twnT+9g7PUjBW 1ZSskuMmhRN80KeZtxalsaxIUafhlnPi/pdwvPbi4nD9m/gbXCXaJl/XJO18V7mfZc bTQkSbQmdTt5uSFWWYkKCvP9jfdM+mT1d+iKqlvE= From: "zach-gcc at cs dot stanford.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/108779] New: No option to change thread-pointer location on AArch64 Date: Mon, 13 Feb 2023 19:56:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zach-gcc at cs dot stanford.edu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108779 Bug ID: 108779 Summary: No option to change thread-pointer location on AArch64 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: zach-gcc at cs dot stanford.edu Target Milestone: --- On AArch64, GCC uses tpidr_el0 (user-mode accessible) to access the thread-pointer for loading thread-local variables by default. There is no option to change this to tpidr_el1 (or tpidr_el2/tpidr_el3), which is neces= sary for using thread-local variables in kernel code (or any code that runs at a higher privilege level). Clang has the `-mtp` option for AArch64 (https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang= -mtp) that controls this, but it seems GCC does not. There is a GCC `-mtp` option= for ARM, but not AArch64. See also the original gcc-help message I sent here: https://gcc.gnu.org/pipermail/gcc-help/2023-February/142212.html Thanks!=