public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/13] Add musl support to GCC
@ 2015-04-20 18:49 Szabolcs Nagy
  2015-04-20 18:51 ` [PATCH 1/13] libitm fixes for musl support Szabolcs Nagy
                   ` (13 more replies)
  0 siblings, 14 replies; 83+ messages in thread
From: Szabolcs Nagy @ 2015-04-20 18:49 UTC (permalink / raw)
  To: gcc-patches; +Cc: Gregor Richards, Rich Felker, Szabolcs Nagy

This patch set adds musl libc[0] support to GCC.

The patches were originally developed by Gregor Richards[1][2],
who I believe have already done the FSF copyright assignment and agrees
with the changes I made (please verify).  I only did minor cleanups
to make the patches better suited for upstream.

Issues I don't have patches for:

* On powerpc it seems the only configure option to choose the default
long-double abi is --with-long-double-128, but that's the default with
sufficiently new glibc. (musl gets 64bit long-double because the glibc
version check fails, this is ok, because there is no ibm128 support in
musl, but it would be better if --with-long-double-64 could be set
explicitly or even ieee128 abi if gcc supports that).

* libcilkrts uses pthread_yield on linux instead of sched_yield by
default, but musl does not have the non-standard pthread_yield symbol.

Tests:

I only tested the C and C++ languages.  GCJ needs further patching,
I haven't tested gfortran nor Ada.  libsanitizer has to be disabled
for musl.  I built cross compilers for various targets musl supports
and ran x86_64-linux-musl cross compiler (musl target glibc host)
and native musl make check.  There were several errors, some of the
causes:

* libcilkrts.so has undefined ref to pthread_yield
* ifunc is not supported by musl
* ifunc is used in x86 libatomic.so for __atomic_store_16
* gcc stdatomic.h has some incompatible typedefs with musl stdint.h
* musl does not support unwind across libc calls or signal handlers
* splitstacks does not work (undef refs to __morestack* in libgcc)
* musl does not yet have __memcpy_chk etc.
* -fshort-wchar is not supported
* i've seen x86 specific avx failures
* atexit during exit fails with musl (some c++ destructor tests)

This fixes BZ 58446 and 55807 which requested musl support.

[0] http://www.musl-libc.org/
[1] https://github.com/GregorR/musl-gcc-patches
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58446

--
Changes:
 fixincludes/mkfixinc.sh                     |    3 +-
 gcc/config.gcc                              |    9 ++-
 gcc/config/aarch64/aarch64-linux.h          |    8 ++
 gcc/config/arm/linux-eabi.h                 |   17 +++++
 gcc/config/i386/linux.h                     |    1 +
 gcc/config/i386/linux64.h                   |    4 +
 gcc/config/i386/pmm_malloc.h                |    9 ++-
 gcc/config/linux.h                          |  105 +++++++++++++++++++++++----
 gcc/config/linux.opt                        |    4 +
 gcc/config/microblaze/linux.h               |   16 +++-
 gcc/config/mips/linux.h                     |    7 ++
 gcc/config/rs6000/linux64.h                 |   12 ++-
 gcc/config/rs6000/secureplt.h               |    1 +
 gcc/config/rs6000/sysv4.h                   |   16 +++-
 gcc/config/sh/linux.h                       |    7 ++
 gcc/configure                               |    7 ++
 gcc/configure.ac                            |    7 ++
 libgcc/unwind-dw2-fde-dip.c                 |    6 ++
 libgfortran/acinclude.m4                    |    2 +-
 libgfortran/configure                       |    2 +-
 libitm/config/arm/hwcap.cc                  |    2 +-
 libitm/config/linux/x86/tls.h               |    8 +-
 libstdc++-v3/config/os/generic/os_defines.h |    5 ++
 libstdc++-v3/configure.host                 |    3 +
 24 files changed, 227 insertions(+), 34 deletions(-)

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

end of thread, other threads:[~2015-10-15 19:06 UTC | newest]

Thread overview: 83+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-20 18:49 [PATCH 0/13] Add musl support to GCC Szabolcs Nagy
2015-04-20 18:51 ` [PATCH 1/13] libitm fixes for musl support Szabolcs Nagy
2015-04-20 20:41   ` Jeff Law
2015-04-22 14:34     ` Kyrill Tkachov
2015-04-20 18:52 ` [PATCH 3/13] aarch64 " Szabolcs Nagy
2015-04-21 14:16   ` pinskia
2015-04-21 14:55     ` Szabolcs Nagy
2015-04-27 14:33     ` Szabolcs Nagy
2015-05-15 12:33       ` Szabolcs Nagy
2015-05-27 17:39       ` James Greenhalgh
2015-04-20 18:52 ` [PATCH 2/13] musl libc config Szabolcs Nagy
2015-04-22 13:16   ` Jeff Law
2015-04-22 14:34     ` Kyrill Tkachov
2015-04-22 15:27       ` Ilya Verbin
2015-04-22 15:37         ` Kyrill Tkachov
2015-04-22 15:42           ` Szabolcs Nagy
2015-04-27 14:30             ` Szabolcs Nagy
2015-04-27 19:27               ` Jeff Law
2015-04-28 23:50   ` Joseph Myers
2015-05-06 11:24     ` Szabolcs Nagy
2015-05-07 18:02       ` Jeff Law
2015-05-08  8:26         ` Kyrill Tkachov
2015-04-20 18:53 ` [PATCH 4/13] arm musl support Szabolcs Nagy
2015-05-15 12:43   ` Szabolcs Nagy
2015-05-27 13:49   ` Kyrill Tkachov
2015-04-20 18:54 ` [PATCH 6/13] mips " Szabolcs Nagy
2015-04-21 13:58   ` Matthew Fortune
2015-04-21 14:43     ` Rich Felker
2015-04-21 15:00       ` Matthew Fortune
2015-04-27 14:40         ` Szabolcs Nagy
2015-05-08 13:56           ` H.J. Lu
2015-05-08 14:27             ` Matthew Fortune
2015-05-08 14:40               ` Rich Felker
2015-05-08 14:41               ` Szabolcs Nagy
2015-05-08 14:47                 ` Matthew Fortune
2015-05-08 15:13                   ` Szabolcs Nagy
2015-05-08 15:17                     ` Kyrill Tkachov
2015-05-08 14:49                 ` Rich Felker
2015-05-08 16:50                   ` Joseph Myers
2015-05-08 17:03                     ` Rich Felker
2015-05-08 18:27                     ` Jeff Law
2015-05-08 18:56                       ` Matthew Fortune
2015-05-08 18:20               ` Jeff Law
2015-05-08 14:27             ` Szabolcs Nagy
2015-04-20 18:54 ` [PATCH 5/13] microblaze " Szabolcs Nagy
2015-04-27 14:35   ` Szabolcs Nagy
2015-04-29 13:23     ` Michael Eager
2015-04-29 14:06       ` Szabolcs Nagy
2015-05-06 11:25         ` Szabolcs Nagy
2015-10-15 19:00           ` [PING][PATCH " Szabolcs Nagy
2015-10-15 19:04             ` Michael Eager
2015-10-15 19:06               ` Szabolcs Nagy
2015-04-20 18:55 ` [PATCH 7/13] powerpc " Szabolcs Nagy
2015-04-27 14:58   ` Szabolcs Nagy
2015-04-20 18:56 ` [PATCH 8/13] sh " Szabolcs Nagy
2015-04-20 20:29   ` Oleg Endo
2015-04-27 14:50     ` Szabolcs Nagy
2015-04-20 18:57 ` [PATCH 9/13] x86 " Szabolcs Nagy
2015-04-27 14:52   ` Szabolcs Nagy
2015-05-15 12:34     ` Szabolcs Nagy
2015-05-15 12:45       ` Uros Bizjak
2015-05-15 13:39         ` Kyrill Tkachov
2015-04-20 18:58 ` [PATCH 11/13] unwind fix for musl Szabolcs Nagy
2015-04-22 13:20   ` Jeff Law
2015-04-22 14:35     ` Kyrill Tkachov
2015-04-20 18:58 ` [PATCH 10/13] fixincludes Szabolcs Nagy
2015-04-20 20:38   ` Jeff Law
2015-04-22 14:35     ` Kyrill Tkachov
2015-04-20 18:59 ` [PATCH 12/13] libstdc++, libgfortran gthr workaround for musl Szabolcs Nagy
2015-04-22 13:17   ` Jeff Law
2015-04-22 14:35     ` Kyrill Tkachov
2015-04-20 19:00 ` [PATCH 13/13] fix incompatible posix_memalign declaration on x86 Szabolcs Nagy
2015-05-15 12:36   ` Szabolcs Nagy
2015-05-15 13:04     ` Uros Bizjak
2015-05-15 15:18   ` H.J. Lu
2015-05-15 16:12     ` Szabolcs Nagy
2015-05-15 17:22       ` H.J. Lu
2015-04-28 23:50 ` [PATCH 0/13] Add musl support to GCC Joseph Myers
2015-04-29 13:42   ` Szabolcs Nagy
2015-04-30  0:13     ` Joseph Myers
2015-05-06 11:36       ` Szabolcs Nagy
2015-05-07 18:07         ` Jeff Law
2015-05-08  8:31           ` Kyrill Tkachov

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).