public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
@ 2024-02-17 13:51 csfore at posteo dot net
  2024-02-17 22:18 ` [Bug target/113971] [14 Regression] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: csfore at posteo dot net @ 2024-02-17 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113971
           Summary: failure to build on arm64 musl (#error "Unsupported
                    AArch64 platform for heap trampolines")
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: csfore at posteo dot net
  Target Milestone: ---

Created attachment 57450
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57450&action=edit
build.log

Steps to reproduce:
1. Attempt to build latest snapshot on ARM64 with Musl
2. Failure to build with error below

Musl version: 1.2.3

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-gentoo-linux-musl/13/lto-wrapper
Target: aarch64-gentoo-linux-musl
Configured with:
/var/tmp/portage/sys-devel/gcc-13.2.1_p20240113-r1/work/gcc-13-20240113/configure
--host=aarch64-gentoo-linux-musl --build=aarch64-gentoo-linux-musl
--prefix=/usr --bindir=/usr/aarch64-gentoo-linux-musl/gcc-bin/13
--includedir=/usr/lib/gcc/aarch64-gentoo-linux-musl/13/include
--datadir=/usr/share/gcc-data/aarch64-gentoo-linux-musl/13
--mandir=/usr/share/gcc-data/aarch64-gentoo-linux-musl/13/man
--infodir=/usr/share/gcc-data/aarch64-gentoo-linux-musl/13/info
--with-gxx-include-dir=/usr/lib/gcc/aarch64-gentoo-linux-musl/13/include/g++-v13
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/aarch64-gentoo-linux-musl/13/python
--enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls
--disable-libunwind-exceptions --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo
13.2.1_p20240113-r1 p12' --with-gcc-major-version-only --enable-libstdcxx-time
--enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix
--enable-__cxa_atexit --disable-multilib --disable-fixed-point --enable-libgomp
--disable-libssp --disable-libada --disable-cet --disable-systemtap
--disable-valgrind-annotations --disable-vtable-verify --disable-libvtv
--without-zstd --without-isl --enable-default-pie --enable-default-ssp
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.2.1 20240113 (Gentoo 13.2.1_p20240113-r1 p12)

Error:
/var/tmp/portage/sys-devel/gcc-14.0.1_pre20240211-r1/work/gcc-14-20240211/libgcc/config/aarch64/heap-trampoline.c:53:2:
error: #error "Unsupported AArch64 platform for heap trampolines"
   53 | #error "Unsupported AArch64 platform for heap trampolines"
      |  ^~~~~
/var/tmp/portage/sys-devel/gcc-14.0.1_pre20240211-r1/work/gcc-14-20240211/libgcc/config/aarch64/heap-trampoline.c:
In function '__gcc_nested_func_ptr_created':
/var/tmp/portage/sys-devel/gcc-14.0.1_pre20240211-r1/work/gcc-14-20240211/libgcc/config/aarch64/heap-trampoline.c:146:30:
error: 'aarch64_trampoline_insns' undeclared (first use in this function); did
you mean 'aarch64_trampoline'?
  146 |   memcpy (trampoline->insns, aarch64_trampoline_insns,
      |                              ^~~~~~~~~~~~~~~~~~~~~~~~
      |                              aarch64_trampoline

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

* [Bug target/113971] [14 Regression] failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
  2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
@ 2024-02-17 22:18 ` pinskia at gcc dot gnu.org
  2024-02-17 23:27 ` iains at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-17 22:18 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |build
            Summary|failure to build on arm64   |[14 Regression] failure to
                   |musl (#error "Unsupported   |build on arm64 musl (#error
                   |AArch64 platform for heap   |"Unsupported AArch64
                   |trampolines")               |platform for heap
                   |                            |trampolines")
   Target Milestone|---                         |14.0
             Target|                            |aarch64-linux-musl

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

* [Bug target/113971] [14 Regression] failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
  2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
  2024-02-17 22:18 ` [Bug target/113971] [14 Regression] " pinskia at gcc dot gnu.org
@ 2024-02-17 23:27 ` iains at gcc dot gnu.org
  2024-02-18 16:28 ` iains at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2024-02-17 23:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Iain Sandoe <iains at gcc dot gnu.org> ---
the intent was not to enable this feature for platforms we could not test.
but libgcc/config.host has "aarch64*-*-linux*" so we have inadvertently enabled
it for aarch64-linux-musl.


assuming linux-musl defines __linux__ ... something like:

diff --git a/libgcc/config/aarch64/heap-trampoline.c
b/libgcc/config/aarch64/heap-trampoline.c
index 9d5b19983b1..1e3460b1601 100644
--- a/libgcc/config/aarch64/heap-trampoline.c
+++ b/libgcc/config/aarch64/heap-trampoline.c
@@ -29,7 +29,7 @@ void *allocate_trampoline_page (void);
 void __gcc_nested_func_ptr_created (void *chain, void *func, void *dst);
 void __gcc_nested_func_ptr_deleted (void);

-#if defined(__gnu_linux__)
+#if defined(__linux__)
 static const uint32_t aarch64_trampoline_insns[] = {
   0xd503245f, /* hint    34 */
   0x580000b1, /* ldr     x17, .+20 */
@@ -82,7 +82,7 @@ allocate_trampoline_page (void)
 {
   void *page;

-#if defined(__gnu_linux__)
+#if defined(__linux__)
   page = mmap (0, getpagesize (), PROT_WRITE | PROT_EXEC,
               MAP_ANON | MAP_PRIVATE, 0, 0);
 #elif __APPLE__

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

* [Bug target/113971] [14 Regression] failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
  2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
  2024-02-17 22:18 ` [Bug target/113971] [14 Regression] " pinskia at gcc dot gnu.org
  2024-02-17 23:27 ` iains at gcc dot gnu.org
@ 2024-02-18 16:28 ` iains at gcc dot gnu.org
  2024-02-20 15:03 ` cvs-commit at gcc dot gnu.org
  2024-02-20 15:06 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2024-02-18 16:28 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-02-18

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
Created attachment 57456
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57456&action=edit
patch to allow heap trampolines for all aarch64-linux

This has been tested so far on aarch64-linux-gnu and aarch64-darwin; I do not
have access to an aarch64-linux-muscl system to check that.

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

* [Bug target/113971] [14 Regression] failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
  2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
                   ` (2 preceding siblings ...)
  2024-02-18 16:28 ` iains at gcc dot gnu.org
@ 2024-02-20 15:03 ` cvs-commit at gcc dot gnu.org
  2024-02-20 15:06 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-20 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:61ab046a3277c256867f596e73ce5b5ee9041a9d

commit r14-9084-g61ab046a3277c256867f596e73ce5b5ee9041a9d
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Feb 18 06:49:26 2024 +0000

    aarch64: Allow aarch64-linux-muscl for heap trampolines [PR113971].

    This allows the same trampoline pattern to be used on all linux variants
    rather than restricting it to linux gnu.

            PR target/113971

    libgcc/ChangeLog:

            * config/aarch64/heap-trampoline.c: Allow all linux variants.

    Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

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

* [Bug target/113971] [14 Regression] failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines")
  2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
                   ` (3 preceding siblings ...)
  2024-02-20 15:03 ` cvs-commit at gcc dot gnu.org
@ 2024-02-20 15:06 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2024-02-20 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed on trunk

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

end of thread, other threads:[~2024-02-20 15:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-17 13:51 [Bug target/113971] New: failure to build on arm64 musl (#error "Unsupported AArch64 platform for heap trampolines") csfore at posteo dot net
2024-02-17 22:18 ` [Bug target/113971] [14 Regression] " pinskia at gcc dot gnu.org
2024-02-17 23:27 ` iains at gcc dot gnu.org
2024-02-18 16:28 ` iains at gcc dot gnu.org
2024-02-20 15:03 ` cvs-commit at gcc dot gnu.org
2024-02-20 15:06 ` iains 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).