source: clfs-embedded/patches/gcc-4.7.3-musl-1.patch@ c11e150

Last change on this file since c11e150 was c01e552, checked in by Andrew Bradford <andrew@…>, 11 years ago

Add musl patches for gcc and binutils

  • Property mode set to 100644
File size: 26.0 KB
  • libstdc++-v3/configure.host

    Submitted By: Andrew Bradford <andrew@bradfordembedded.com>
    Date: 2013-10-14
    Initial Package Version: 4.7.3
    Origin: Gregor Richards' musl-cross
    Upstream Status: None
    Description: Patches to gcc to build for musl-libc.
    
    # HG changeset patch
    # Parent f50bb54f331f73405131a30b4f353cfda1c70304
    Use the generic implementation of libstdc++ primitives when we're on musl, not the glibc one.
    
    diff -r f50bb54f331f libstdc++-v3/configure.host
    a b  
    264264    os_include_dir="os/bsd/freebsd"
    265265    ;;
    266266  gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
     267    # check for musl by target
     268    case "${host_os}" in
     269      *-musl*)
     270        os_include_dir="os/generic"
     271        ;;
     272      *)
     273
    267274    if [ "$uclibc" = "yes" ]; then
    268275      os_include_dir="os/uclibc"
    269276    elif [ "$bionic" = "yes" ]; then
     
    272279      os_include_dir="os/gnu-linux"
    273280    fi
    274281    ;;
     282
     283    esac
     284    ;;
    275285  hpux*)
    276286    os_include_dir="os/hpux"
    277287    ;;
  • gcc/config.gcc

    # HG changeset patch
    # Parent 8cd76d5f6674f04c31523971d1dfc81c91388c38
    Adding -mmusl as a musl libc specifier, and the necessary hacks for it to know how to find musl's dynamic linker.
    
    diff -r 8cd76d5f6674 gcc/config.gcc
    a b  
    522522esac
    523523
    524524# Common C libraries.
    525 tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
     525tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
    526526
    527527# Common parts for widely ported systems.
    528528case ${target} in
     
    625625    *-*-*uclibc*)
    626626      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
    627627      ;;
     628    *-*-*musl*)
     629      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
     630      ;;
    628631    *)
    629632      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
    630633      ;;
  • gcc/config/linux.h

    diff -r 8cd76d5f6674 gcc/config/linux.h
    a b  
    3333#define OPTION_GLIBC  (DEFAULT_LIBC == LIBC_GLIBC)
    3434#define OPTION_UCLIBC (DEFAULT_LIBC == LIBC_UCLIBC)
    3535#define OPTION_BIONIC (DEFAULT_LIBC == LIBC_BIONIC)
     36#define OPTION_MUSL   (DEFAULT_LIBC == LIBC_MUSL)
    3637#else
    3738#define OPTION_GLIBC  (linux_libc == LIBC_GLIBC)
    3839#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
    3940#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
     41#define OPTION_MUSL   (linux_libc == LIBC_MUSL)
    4042#endif
    4143
    4244#define GNU_USER_TARGET_OS_CPP_BUILTINS()                       \
     
    5456   uClibc or Bionic is the default C library and whether
    5557   -muclibc or -mglibc or -mbionic has been passed to change the default.  */
    5658
    57 #define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3)      \
    58   "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
     59#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LIBC4, LD1, LD2, LD3, LD4)  \
     60  "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:%{" LIBC4 ":" LD4 ";:" LD1 "}}}"
    5961
    6062#if DEFAULT_LIBC == LIBC_GLIBC
    61 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \
    62   CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
     63#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
     64  CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", "mmusl", G, U, B, M)
    6365#elif DEFAULT_LIBC == LIBC_UCLIBC
    64 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \
    65   CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
     66#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
     67  CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", "mmusl", U, G, B, M)
    6668#elif DEFAULT_LIBC == LIBC_BIONIC
    67 #define CHOOSE_DYNAMIC_LINKER(G, U, B) \
    68   CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
     69#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
     70  CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", "mmusl", B, G, U, M)
     71#elif DEFAULT_LIBC == LIBC_MUSL
     72#define CHOOSE_DYNAMIC_LINKER(G, U, B, M) \
     73  CHOOSE_DYNAMIC_LINKER1 ("mmusl", "mglibc", "muclibc", "mbionic", M, G, U, B)
    6974#else
    7075#error "Unsupported DEFAULT_LIBC"
    7176#endif /* DEFAULT_LIBC */
     
    8590
    8691#define GNU_USER_DYNAMIC_LINKER                                         \
    8792  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER,   \
    88                          BIONIC_DYNAMIC_LINKER)
     93                         BIONIC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
    8994#define GNU_USER_DYNAMIC_LINKER32                                       \
    9095  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
    91                          BIONIC_DYNAMIC_LINKER32)
     96                         BIONIC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
    9297#define GNU_USER_DYNAMIC_LINKER64                                       \
    9398  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
    94                          BIONIC_DYNAMIC_LINKER64)
     99                         BIONIC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
    95100#define GNU_USER_DYNAMIC_LINKERX32                                      \
    96101  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERX32, UCLIBC_DYNAMIC_LINKERX32, \
    97                          BIONIC_DYNAMIC_LINKERX32)
     102                         BIONIC_DYNAMIC_LINKERX32, MUSL_DYNAMIC_LINKERX32)
    98103
    99104/* Determine whether the entire c99 runtime
    100105   is present in the runtime library.  */
    101106#undef TARGET_C99_FUNCTIONS
    102 #define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
     107#define TARGET_C99_FUNCTIONS (OPTION_GLIBC || OPTION_MUSL)
    103108
    104109/* Whether we have sincos that follows the GNU extension.  */
    105110#undef TARGET_HAS_SINCOS
     
    108113/* Whether we have Bionic libc runtime */
    109114#undef TARGET_HAS_BIONIC
    110115#define TARGET_HAS_BIONIC (OPTION_BIONIC)
     116
     117/* musl avoids problematic includes by rearranging the include directories.
     118 * Unfortunately, this is mostly duplicated from cppdefault.c */
     119#if DEFAULT_LIBC == LIBC_MUSL
     120#define INCLUDE_DEFAULTS_MUSL_GPP                       \
     121    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1,               \
     122      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },           \
     123    { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1,          \
     124      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 1 },           \
     125    { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1,      \
     126      GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 },
     127
     128#ifdef LOCAL_INCLUDE_DIR
     129#define INCLUDE_DEFAULTS_MUSL_LOCAL                     \
     130    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 },               \
     131    { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 },
     132#else
     133#define INCLUDE_DEFAULTS_MUSL_LOCAL
     134#endif
     135
     136#ifdef PREFIX_INCLUDE_DIR
     137#define INCLUDE_DEFAULTS_MUSL_PREFIX                    \
     138    { PREFIX_INCLUDE_DIR, 0, 0, 1, 0, 0},
     139#else
     140#define INCLUDE_DEFAULTS_MUSL_PREFIX
     141#endif
     142
     143#ifdef CROSS_INCLUDE_DIR
     144#define INCLUDE_DEFAULTS_MUSL_CROSS                     \
     145    { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0, 0},
     146#else
     147#define INCLUDE_DEFAULTS_MUSL_CROSS
     148#endif
     149
     150#ifdef TOOL_INCLUDE_DIR
     151#define INCLUDE_DEFAULTS_MUSL_TOOL                      \
     152    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0, 0},
     153#else
     154#define INCLUDE_DEFAULTS_MUSL_TOOL
     155#endif
     156
     157#ifdef NATIVE_SYSTEM_HEADER_DIR
     158#define INCLUDE_DEFAULTS_MUSL_NATIVE                    \
     159    { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 2 },        \
     160    { NATIVE_SYSTEM_HEADER_DIR, 0, 0, 0, 1, 0 },
     161#else
     162#define INCLUDE_DEFAULTS_MUSL_NATIVE
     163#endif
     164
     165#if defined (CROSS_DIRECTORY_STRUCTURE) && !defined (TARGET_SYSTEM_ROOT)
     166# undef INCLUDE_DEFAULTS_MUSL_LOCAL
     167# define INCLUDE_DEFAULTS_MUSL_LOCAL
     168# undef INCLUDE_DEFAULTS_MUSL_NATIVE
     169# define INCLUDE_DEFAULTS_MUSL_NATIVE
     170#else
     171# undef INCLUDE_DEFAULTS_MUSL_CROSS
     172# define INCLUDE_DEFAULTS_MUSL_CROSS
     173#endif
     174
     175#undef INCLUDE_DEFAULTS
     176#define INCLUDE_DEFAULTS                                \
     177  {                                                     \
     178    INCLUDE_DEFAULTS_MUSL_GPP                           \
     179    INCLUDE_DEFAULTS_MUSL_PREFIX                        \
     180    INCLUDE_DEFAULTS_MUSL_CROSS                         \
     181    INCLUDE_DEFAULTS_MUSL_TOOL                          \
     182    INCLUDE_DEFAULTS_MUSL_NATIVE                        \
     183    { GCC_INCLUDE_DIR, "GCC", 0, 1, 0, 0 },             \
     184    { 0, 0, 0, 0, 0, 0 }                                \
     185  }
     186#endif
  • gcc/config/linux.opt

    diff -r 8cd76d5f6674 gcc/config/linux.opt
    a b  
    3030muclibc
    3131Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) Negative(mbionic)
    3232Use uClibc C library
     33
     34mmusl
     35Target Report RejectNegative Var(linux_libc,LIBC_MUSL) Negative(mglibc)
     36Use musl C library
  • gcc/ginclude/stddef.h

    diff -r 8cd76d5f6674 gcc/ginclude/stddef.h
    a b  
    184184#ifndef _GCC_SIZE_T
    185185#ifndef _SIZET_
    186186#ifndef __size_t
     187#ifndef __DEFINED_size_t /* musl */
    187188#define __size_t__      /* BeOS */
    188189#define __SIZE_T__      /* Cray Unicos/Mk */
    189190#define _SIZE_T
     
    200201#define ___int_size_t_h
    201202#define _GCC_SIZE_T
    202203#define _SIZET_
     204#define __DEFINED_size_t /* musl */
    203205#if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
    204206  || defined(__FreeBSD_kernel__)
    205207/* __size_t is a typedef on FreeBSD 5, must not trash it. */
     
    215217typedef long ssize_t;
    216218#endif /* __BEOS__ */
    217219#endif /* !(defined (__GNUG__) && defined (size_t)) */
     220#endif /* __DEFINED_size_t */
    218221#endif /* __size_t */
    219222#endif /* _SIZET_ */
    220223#endif /* _GCC_SIZE_T */
  • libgomp/config/posix/time.c

    # HG changeset patch
    # Parent 2b94537ce2496c88e7e797c617e5b95e8d7e4785
    A fix for libgomp to correctly request a POSIX version for time support.
    
    diff -r 2b94537ce249 libgomp/config/posix/time.c
    a b  
    2828   The following implementation uses the most simple POSIX routines.
    2929   If present, POSIX 4 clocks should be used instead.  */
    3030
     31#define _POSIX_C_SOURCE 199309L /* for clocks */
     32
    3133#include "libgomp.h"
    3234#include <unistd.h>
    3335#if TIME_WITH_SYS_TIME
  • libgcc/unwind-dw2-fde-dip.c

    diff -r 2ebb44d1e6f1 libgcc/unwind-dw2-fde-dip.c
    a b  
    4747#include "unwind-compat.h"
    4848#include "gthr.h"
    4949
    50 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
    51     && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
    52         || (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
     50#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) && defined(TARGET_DL_ITERATE_PHDR)
    5351# define USE_PT_GNU_EH_FRAME
    54 #endif
    55 
    56 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
    57     && defined(__FreeBSD__) && __FreeBSD__ >= 7
    58 # define ElfW __ElfN
    59 # define USE_PT_GNU_EH_FRAME
    60 #endif
    61 
    62 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
    63     && defined(__OpenBSD__)
    64 # define ElfW(type) Elf_##type
    65 # define USE_PT_GNU_EH_FRAME
    66 #endif
    67 
    68 #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
    69     && defined(TARGET_DL_ITERATE_PHDR) \
    70     && defined(__sun__) && defined(__svr4__)
    71 # define USE_PT_GNU_EH_FRAME
     52# ifdef __OpenBSD__
     53#  define ElfW(type) Elf_##typ
     54# elif defined(__FreeBSD__) && __FreeBSD__ >= 7
     55#  define ElfW __ElfN
     56# endif
    7257#endif
    7358
    7459#if defined(USE_PT_GNU_EH_FRAME)
  • gcc/configure

    diff -r 75d9c38318a7 gcc/configure
    a b  
    2673626736else
    2673726737  gcc_cv_libc_provides_ssp=no
    2673826738    case "$target" in
     26739       *-*-musl*)
     26740         # All versions of musl provide stack protector
     26741         gcc_cv_libc_provides_ssp=yes;;
    2673926742       *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
    2674026743      # glibc 2.4 and later provides __stack_chk_fail and
    2674126744      # either __stack_chk_guard, or TLS access to stack guard canary.
     
    2676926772         # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
    2677026773         # simply assert that glibc does provide this, which is true for all
    2677126774         # realistically usable GNU/Hurd configurations.
     26775         # All supported versions of musl provide it as well
    2677226776         gcc_cv_libc_provides_ssp=yes;;
    2677326777       *-*-darwin* | *-*-freebsd*)
    2677426778         ac_fn_c_check_func "$LINENO" "__stack_chk_fail" "ac_cv_func___stack_chk_fail"
     
    2685126855      gcc_cv_target_dl_iterate_phdr=no
    2685226856    fi
    2685326857    ;;
     26858  *-linux-musl*)
     26859    gcc_cv_target_dl_iterate_phdr=yes
     26860    ;;
    2685426861esac
    2685526862
    2685626863if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
  • gcc/configure.ac

    diff -r 75d9c38318a7 gcc/configure.ac
    a b  
    47194719      gcc_cv_libc_provides_ssp,
    47204720      [gcc_cv_libc_provides_ssp=no
    47214721    case "$target" in
     4722       *-*-musl*)
     4723         # All versions of musl provide stack protector
     4724         gcc_cv_libc_provides_ssp=yes;;
    47224725       *-*-linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu)
    47234726      [# glibc 2.4 and later provides __stack_chk_fail and
    47244727      # either __stack_chk_guard, or TLS access to stack guard canary.
     
    47524755         # <http://gcc.gnu.org/ml/gcc/2008-10/msg00130.html>) and for now
    47534756         # simply assert that glibc does provide this, which is true for all
    47544757         # realistically usable GNU/Hurd configurations.
     4758         # All supported versions of musl provide it as well
    47554759         gcc_cv_libc_provides_ssp=yes;;
    47564760       *-*-darwin* | *-*-freebsd*)
    47574761         AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
     
    48174821      gcc_cv_target_dl_iterate_phdr=no
    48184822    fi
    48194823    ;;
     4824  *-linux-musl*)
     4825    gcc_cv_target_dl_iterate_phdr=yes
     4826    ;;
    48204827esac
    48214828GCC_TARGET_TEMPLATE([TARGET_DL_ITERATE_PHDR])
    48224829if test x$gcc_cv_target_dl_iterate_phdr = xyes; then
  • fixincludes/mkfixinc.sh

    # HG changeset patch
    # Parent 94e435662aff38e86c9ca0dff4bbf451e0190b34
    Get rid of ever-broken fixincludes on musl.
    
    
    diff -r 94e435662aff -r e27957848dc8 fixincludes/mkfixinc.sh
    a b  
    1919    powerpc-*-eabi*    | \
    2020    powerpc-*-rtems*   | \
    2121    powerpcle-*-eabisim* | \
    22     powerpcle-*-eabi* )
     22    powerpcle-*-eabi* | \
     23    *-musl* )
    2324        #  IF there is no include fixing,
    2425        #  THEN create a no-op fixer and exit
    2526        (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
  • config.sub

    # HG changeset patch
    # Parent 65cd23493c45f2a531ca15ffea563d6110143cdd
    New config.sub for GCC versions too early for the update.
    
    
    diff -r 65cd23493c45 -r 355cec477536 config.sub
    a b  
    44#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
    55#   2011 Free Software Foundation, Inc.
    66
    7 timestamp='2011-10-29'
     7timestamp='2011-03-23'
    88
    99# This file is (in principle) common to ALL GNU software.
    1010# The presence of a machine in this file suggests that SOME GNU software
     
    125125maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
    126126case $maybe_os in
    127127  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
     128  linux-musl* | \
    128129  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
    129130  knetbsd*-gnu* | netbsd*-gnu* | \
    130131  kopensolaris*-gnu* | \
     
    251252        | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
    252253        | am33_2.0 \
    253254        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
    254         | be32 | be64 \
    255255        | bfin \
    256256        | c4x | clipper \
    257257        | d10v | d30v | dlx | dsp16xx \
    258         | epiphany \
    259258        | fido | fr30 | frv \
    260259        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
    261         | hexagon \
    262260        | i370 | i860 | i960 | ia64 \
    263261        | ip2k | iq2000 \
    264         | le32 | le64 \
    265262        | lm32 \
    266263        | m32c | m32r | m32rle | m68000 | m68k | m88k \
    267264        | maxq | mb | microblaze | mcore | mep | metag \
     
    295292        | pdp10 | pdp11 | pj | pjl \
    296293        | powerpc | powerpc64 | powerpc64le | powerpcle \
    297294        | pyramid \
    298         | rl78 | rx \
     295        | rx \
    299296        | score \
    300297        | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
    301298        | sh64 | sh64le \
     
    304301        | spu \
    305302        | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
    306303        | ubicom32 \
    307         | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
     304        | v850 | v850e \
    308305        | we32k \
    309306        | x86 | xc16x | xstormy16 | xtensa \
    310307        | z8k | z80)
     
    361358        | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
    362359        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    363360        | avr-* | avr32-* \
    364         | be32-* | be64-* \
    365361        | bfin-* | bs2000-* \
    366362        | c[123]* | c30-* | [cjt]90-* | c4x-* \
    367363        | clipper-* | craynv-* | cydra-* \
     
    370366        | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
    371367        | h8300-* | h8500-* \
    372368        | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
    373         | hexagon-* \
    374369        | i*86-* | i860-* | i960-* | ia64-* \
    375370        | ip2k-* | iq2000-* \
    376         | le32-* | le64-* \
    377371        | lm32-* \
    378372        | m32c-* | m32r-* | m32rle-* \
    379373        | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
     
    407401        | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
    408402        | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
    409403        | pyramid-* \
    410         | rl78-* | romp-* | rs6000-* | rx-* \
     404        | romp-* | rs6000-* | rx-* \
    411405        | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
    412406        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    413407        | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
     
    415409        | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
    416410        | tahoe-* \
    417411        | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
    418         | tile*-* \
     412        | tile-* | tilegx-* \
    419413        | tron-* \
    420414        | ubicom32-* \
    421         | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
    422         | vax-* \
     415        | v850-* | v850e-* | vax-* \
    423416        | we32k-* \
    424417        | x86-* | x86_64-* | xc16x-* | xps100-* \
    425418        | xstormy16-* | xtensa*-* \
     
    820813                basic_machine=i370-ibm
    821814                os=-mvs
    822815                ;;
    823         nacl)
    824                 basic_machine=le32-unknown
    825                 os=-nacl
    826                 ;;
    827816        ncr3000)
    828817                basic_machine=i486-ncr
    829818                os=-sysv4
     
    11321121                basic_machine=t90-cray
    11331122                os=-unicos
    11341123                ;;
     1124        # This must be matched before tile*.
     1125        tilegx*)
     1126                basic_machine=tilegx-unknown
     1127                os=-linux-gnu
     1128                ;;
    11351129        tile*)
    1136                 basic_machine=$basic_machine-unknown
     1130                basic_machine=tile-unknown
    11371131                os=-linux-gnu
    11381132                ;;
    11391133        tx39)
     
    13461340              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
    13471341              | -mingw32* | -linux-gnu* | -linux-android* \
    13481342              | -linux-newlib* | -linux-uclibc* \
     1343              | -linux-musl* \
    13491344              | -uxpv* | -beos* | -mpeix* | -udk* \
    13501345              | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
    13511346              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
  • gcc/config/i386/linux.h

    # HG changeset patch
    # Parent 3ea10cd626cb7abdfd56d3fe8d2c9ed58a82797b
    Support for i386-linux-musl and x86_64-linux-musl.
    
    diff -r 3ea10cd626cb gcc/config/i386/linux.h
    a b  
    2121
    2222#define GNU_USER_LINK_EMULATION "elf_i386"
    2323#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
     24#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-i386.so.1"
  • gcc/config/i386/linux64.h

    diff -r 3ea10cd626cb gcc/config/i386/linux64.h
    a b  
    3030#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
    3131#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
    3232#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
     33
     34#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-i386.so.1"
     35#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-x86_64.so.1"
     36#define MUSL_DYNAMIC_LINKERX32 "/lib/ld-musl-x32.so.1"
  • libitm/config/linux/x86/tls.h

    diff -r 3ea10cd626cb libitm/config/linux/x86/tls.h
    a b  
    2525#ifndef LIBITM_X86_TLS_H
    2626#define LIBITM_X86_TLS_H 1
    2727
    28 #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
     28#if defined(__GLIBC_PREREQ)
     29#if __GLIBC_PREREQ(2, 10)
    2930/* Use slots in the TCB head rather than __thread lookups.
    3031   GLIBC has reserved words 10 through 13 for TM.  */
    3132#define HAVE_ARCH_GTM_THREAD 1
    3233#define HAVE_ARCH_GTM_THREAD_DISP 1
    3334#endif
     35#endif
    3436
    3537#include "config/generic/tls.h"
    3638
    37 #if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10)
     39#if defined(__GLIBC_PREREQ)
     40#if __GLIBC_PREREQ(2, 10)
    3841namespace GTM HIDDEN {
    3942
    4043#ifdef __x86_64__
     
    101104
    102105} // namespace GTM
    103106#endif /* >= GLIBC 2.10 */
     107#endif
    104108
    105109#endif // LIBITM_X86_TLS_H
  • gcc/config/arm/linux-eabi.h

    Support for arm-linux-musl.
    
    diff -r 8801a3f6d050 gcc/config/arm/linux-eabi.h
    a b  
    6464#undef  GLIBC_DYNAMIC_LINKER
    6565#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
    6666
     67/* For ARM musl currently supports four dynamic linkers:
     68   - ld-musl-arm.so.1 - for the EABI-derived soft-float ABI
     69   - ld-musl-armhf.so.1 - for the EABI-derived hard-float ABI
     70   - ld-musl-armeb.so.1 - for the EABI-derived soft-float ABI, EB
     71   - ld-musl-armebhf.so.1 - for the EABI-derived hard-float ABI, EB
     72   musl does not support the legacy OABI mode.
     73   All the dynamic linkers live in /lib.
     74   We default to soft-float, EL. */
     75#undef  MUSL_DYNAMIC_LINKER
     76#if TARGET_BIG_ENDIAN_DEFAULT
     77#define MUSL_DYNAMIC_LINKER_E "%{mlittle-endian:;:eb}"
     78#else
     79#define MUSL_DYNAMIC_LINKER_E "%{mbig-endian:eb}"
     80#endif
     81#define MUSL_DYNAMIC_LINKER \
     82  "/lib/ld-musl-arm" MUSL_DYNAMIC_LINKER_E "%{mfloat-abi=hard:hf}.so.1"
     83
    6784/* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
    6885   use the GNU/Linux version, not the generic BPABI version.  */
    6986#undef  LINK_SPEC
  • libitm/config/arm/hwcap.cc

    diff -r 8801a3f6d050 libitm/config/arm/hwcap.cc
    a b  
    4040
    4141#ifdef __linux__
    4242#include <unistd.h>
     43#ifdef __GLIBC__
    4344#include <sys/fcntl.h>
     45#else
     46#include <fcntl.h>
     47#endif
    4448#include <elf.h>
    4549
    4650static void __attribute__((constructor))
  • gcc/config/mips/linux.h

    # HG changeset patch
    # Parent 4618ad6f036f1e944a5262ae5875dcdf62c41f8b
    Support for mips-linux-musl.
    
    diff -r 4618ad6f036f gcc/config/mips/linux.h
    a b  
    1818<http://www.gnu.org/licenses/>.  */
    1919
    2020#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
     21
     22#if TARGET_ENDIAN_DEFAULT == 0 /* LE */
     23#define MUSL_DYNAMIC_LINKER_E "%{EB:;:el}"
     24#else
     25#define MUSL_DYNAMIC_LINKER_E "%{EL:el}"
     26#endif
     27#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-mips" MUSL_DYNAMIC_LINKER_E ".so.1"
  • gcc/config.gcc

    # HG changeset patch
    # Parent 2ffe76b215fdb082cbbc262536077627757fa9bf
    Support for powerpc-linux-musl.
    
    diff -r 2ffe76b215fd gcc/config.gcc
    a b  
    21122112            powerpc*-*-linux*paired*)
    21132113                tm_file="${tm_file} rs6000/750cl.h" ;;
    21142114        esac
     2115        case ${target} in
     2116            *-linux*-musl*)
     2117                enable_secureplt=yes ;;
     2118        esac
    21152119        if test x${enable_secureplt} = xyes; then
    21162120                tm_file="rs6000/secureplt.h ${tm_file}"
    21172121        fi
  • gcc/config/rs6000/linux64.h

    diff -r 2ffe76b215fd gcc/config/rs6000/linux64.h
    a b  
    364364#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
    365365#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
    366366#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
     367#define MUSL_DYNAMIC_LINKER32 "/lib/ld-musl-powerpc.so.1"
     368#define MUSL_DYNAMIC_LINKER64 "/lib/ld-musl-powerpc64.so.1"
    367369#if DEFAULT_LIBC == LIBC_UCLIBC
    368 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
     370#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
    369371#elif DEFAULT_LIBC == LIBC_GLIBC
    370 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
     372#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
     373#elif DEFAULT_LIBC == LIBC_MUSL
     374#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
    371375#else
    372376#error "Unsupported DEFAULT_LIBC"
    373377#endif
    374378#define GNU_USER_DYNAMIC_LINKER32 \
    375   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
     379  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
    376380#define GNU_USER_DYNAMIC_LINKER64 \
    377   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
     381  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, MUSL_DYNAMIC_LINKER64)
    378382
    379383
    380384#define LINK_OS_LINUX_SPEC32 "-m elf32ppclinux %{!shared: %{!static: \
  • gcc/config/rs6000/secureplt.h

    diff -r 2ffe76b215fd gcc/config/rs6000/secureplt.h
    a b  
    1818<http://www.gnu.org/licenses/>.  */
    1919
    2020#define CC1_SECURE_PLT_DEFAULT_SPEC "-msecure-plt"
     21#define LINK_SECURE_PLT_DEFAULT_SPEC "--secure-plt"
  • gcc/config/rs6000/sysv4.h

    diff -r 2ffe76b215fd gcc/config/rs6000/sysv4.h
    a b  
    551551#ifndef CC1_SECURE_PLT_DEFAULT_SPEC
    552552#define CC1_SECURE_PLT_DEFAULT_SPEC ""
    553553#endif
     554#ifndef LINK_SECURE_PLT_DEFAULT_SPEC
     555#define LINK_SECURE_PLT_DEFAULT_SPEC ""
     556#endif
    554557
    555558/* Pass -G xxx to the compiler and set correct endian mode.  */
    556559#define CC1_SPEC "%{G*} %(cc1_cpu) \
     
    611614%{mlittle: --oformat elf32-powerpcle } %{mlittle-endian: --oformat elf32-powerpcle } \
    612615%{!mlittle: %{!mlittle-endian: %{!mbig: %{!mbig-endian: \
    613616    %{mcall-i960-old: --oformat elf32-powerpcle} \
    614   }}}}"
     617  }}}} \
     618%{!mbss-plt: %{!msecure-plt: %(link_secure_plt_default)}}"
    615619
    616620/* Any specific OS flags.  */
    617621#define LINK_OS_SPEC "\
     
    789793
    790794#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
    791795#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
     796#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-powerpc.so.1"
    792797#if DEFAULT_LIBC == LIBC_UCLIBC
    793 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
     798#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{mmusl:" M ";:" U "}}"
     799#elif DEFAULT_LIBC == LIBC_MUSL
     800#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{mglibc:" G ";:%{muclibc:" U ";:" M "}}"
    794801#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
    795 #define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
     802#define CHOOSE_DYNAMIC_LINKER(G, U, M) "%{muclibc:" U ";:%{mmusl:" M ";:" G "}}"
    796803#else
    797804#error "Unsupported DEFAULT_LIBC"
    798805#endif
    799806#define GNU_USER_DYNAMIC_LINKER \
    800   CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
     807  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, MUSL_DYNAMIC_LINKER)
    801808
    802809#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \
    803810  %{rdynamic:-export-dynamic} \
     
    923930  { "cc1_endian_little",        CC1_ENDIAN_LITTLE_SPEC },               \
    924931  { "cc1_endian_default",       CC1_ENDIAN_DEFAULT_SPEC },              \
    925932  { "cc1_secure_plt_default",   CC1_SECURE_PLT_DEFAULT_SPEC },          \
     933  { "link_secure_plt_default",  LINK_SECURE_PLT_DEFAULT_SPEC },         \
    926934  { "cpp_os_ads",               CPP_OS_ADS_SPEC },                      \
    927935  { "cpp_os_yellowknife",       CPP_OS_YELLOWKNIFE_SPEC },              \
    928936  { "cpp_os_mvme",              CPP_OS_MVME_SPEC },                     \
Note: See TracBrowser for help on using the repository browser.