• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/gcc/4.9.4/900-musl-support.patch
Thomas PetazzoniThomas Petazzoni committed 50c02bd72b103 Aug 2016
Raw file
Source viewDiff to previous
+  CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, MUSL_DYNAMIC_LINKER32)
 
1
Add musl support to gcc
2
​
3
This patch comes from the musl-cross project at
4
https://bitbucket.org/GregorR/musl-cross/src. Compared to the upstream version:
5
​
6
 * the config.sub modifications have been removed, because Buildroot
7
   already overwrites all config.sub with a more recent config.sub
8
   that has musl support.
9
​
10
 * change to ensure that a dummy dynamic linker path
11
   MUSL_DYNAMIC_LINKER<foo> is defined for all architectures,
12
   otherwise building gcc for architectures not supported by musl was
13
   causing build failure. Bug reported upstream at
14
   https://bitbucket.org/GregorR/musl-gcc-patches/issue/4/musl-gcc-patches-break-the-build-on.
15
​
16
 * change the USE_PT_GNU_EH_FRAME logic to keep the existing gcc logic
17
   and only add the musl one as an addition, not as a replacement. Not
18
   doing this breaks C++ exception handling with glibc, because
19
   USE_PT_GNU_EH_FRAME doesn't get defined due to the configure script
20
   not testing dl_iterate_phdr() on any system except Solaris.
21
​
22
[Gustavo: remove upstream applied gcc/config/sh/sh.c chunk for 4.9.1]
23
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
24
---
25
​
26
Index: b/fixincludes/mkfixinc.sh
27
===================================================================
28
--- a/fixincludes/mkfixinc.sh
29
+++ b/fixincludes/mkfixinc.sh
30
@@ -19,7 +19,8 @@
31
     powerpc-*-eabi*    | \
32
     powerpc-*-rtems*   | \
33
     powerpcle-*-eabisim* | \
34
-    powerpcle-*-eabi* )
35
+    powerpcle-*-eabi* | \
36
+    *-musl* )
37
    #  IF there is no include fixing,
38
    #  THEN create a no-op fixer and exit
39
    (echo "#! /bin/sh" ; echo "exit 0" ) > ${target}
40
Index: b/gcc/config.gcc
41
===================================================================
42
--- a/gcc/config.gcc
43
+++ b/gcc/config.gcc
44
@@ -594,7 +594,7 @@
45
 esac
46
 
47
 # Common C libraries.
48
-tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3"
49
+tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4"
50
 
51
 # 32-bit x86 processors supported by --with-arch=.  Each processor
52
 # MUST be separated by exactly one space.
53
@@ -719,6 +719,9 @@
54
     *-*-*uclibc*)
55
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
56
       ;;
57
+    *-*-*musl*)
58
+      tm_defines="$tm_defines DEFAULT_LIBC=LIBC_MUSL"
59
+      ;;
60
     *)
61
       tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
62
       ;;
63
@@ -2338,6 +2341,10 @@
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.