summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvonPalitroque2020-01-06 19:25:29 -0500
committervonPalitroque2020-01-06 19:25:29 -0500
commit41f5b9a237bfc797e7bd5f7db8dbe0b3ef4707a6 (patch)
tree999bf117787c40656dc6f279fcc90a1f0dac238b
parenta2bf3b08981b12ce5d913996755a990fe4c0b9c3 (diff)
downloadaur-41f5b9a237bfc797e7bd5f7db8dbe0b3ef4707a6.tar.gz
Update to match newlib release.
Update to match newlib release. Backported patch to dynamically add init_array sections.
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD20
-rw-r--r--gcc-use-init_array-if-needed.patch31
3 files changed, 51 insertions, 8 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ba3e53b576a7..553e64cb96e8 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = msp430-elf-gcc
pkgdesc = The GNU Compiler Collection for the msp430-elf target.
pkgver = 9.2.0
- pkgrel = 2
+ pkgrel = 3
url = http://gcc.gnu.org
arch = i686
arch = x86_64
@@ -23,10 +23,12 @@ pkgbase = msp430-elf-gcc
options = zipman
options = docs
options = !strip
- source = http://isl.gforge.inria.fr/isl-0.21.tar.xz
+ source = http://isl.gforge.inria.fr/isl-0.22.tar.xz
source = ftp://gcc.gnu.org/pub/gcc/releases/gcc-9.2.0/gcc-9.2.0.tar.xz
- sha256sums = 777058852a3db9500954361e294881214f6ecd4b594c00da5eee974cd6a54960
+ source = gcc-use-init_array-if-needed.patch
+ sha256sums = 6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa
sha256sums = ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+ sha256sums = 4dcec95ee660b2db78e8aaac6cfda48f6d10c3d016058514603b816819e722eb
pkgname = msp430-elf-gcc
diff --git a/PKGBUILD b/PKGBUILD
index 4446dce48362..e9bc19acc2c9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,8 +3,8 @@
_target="msp430-elf"
pkgname=${_target}-gcc
pkgver=9.2.0
-_islver=0.21
-pkgrel=2
+_islver=0.22
+pkgrel=3
pkgdesc="The GNU Compiler Collection for the ${_target} target."
arch=(i686 x86_64)
license=('GPL' 'LGPL')
@@ -16,9 +16,11 @@ replaces=("${_target}-gcc-stage1")
provides=("${_target}-gcc-stage1")
optdepends=("${_target}-libstdc++: C++ standard library support")
source=(http://isl.gforge.inria.fr/isl-${_islver}.tar.xz
- ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz)
-sha256sums=('777058852a3db9500954361e294881214f6ecd4b594c00da5eee974cd6a54960'
- 'ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206')
+ ftp://gcc.gnu.org/pub/gcc/releases/gcc-${pkgver}/gcc-${pkgver}.tar.xz
+ gcc-use-init_array-if-needed.patch)
+sha256sums=('6c8bc56c477affecba9c59e2c9f026967ac8bad01b51bdd07916db40a517b9fa'
+ 'ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206'
+ '4dcec95ee660b2db78e8aaac6cfda48f6d10c3d016058514603b816819e722eb')
prepare() {
@@ -28,6 +30,14 @@ prepare() {
[[ -d gcc-build ]] && rm -rf gcc-build
mkdir gcc-build
+
+ # From newlib 3.2.0 onwards, .init_array is used only if the required symbols
+ # are defined by gas. This functionality already exists in the current
+ # binutils (2.33.1) and is part of GCC 10. The idea is to be able to run the
+ # linker with --gc-sections and rid of the binary of initialization code that
+ # is not needed. The assembler gas will emit the necessary symbols if the
+ # code is actually needed. Backport the patch to the GCC 9.x series.
+ patch -p1 < ../gcc-use-init_array-if-needed.patch
}
build() {
diff --git a/gcc-use-init_array-if-needed.patch b/gcc-use-init_array-if-needed.patch
new file mode 100644
index 000000000000..8e2700cb307c
--- /dev/null
+++ b/gcc-use-init_array-if-needed.patch
@@ -0,0 +1,31 @@
+diff --git a/gcc/config.gcc b/gcc/config.gcc
+index 446a852ffe1..17ed1b876a1 100644
+--- a/gcc/config.gcc
++++ b/gcc/config.gcc
+@@ -2503,6 +2503,13 @@ msp430*-*-*)
+ cxx_target_objs="msp430-c.o"
+ tmake_file="${tmake_file} msp430/t-msp430"
+ extra_gcc_objs="driver-msp430.o"
++ # Enable .init_array unless it has been explicitly disabled (e.g. if
++ # the user is building using an old version of newlib.
++ # The MSPABI mandates .init_array, and the Newlib CRT code since
++ # mid-2019 expects it.
++ if test x${disable_initfini_array} != xyes; then
++ gcc_cv_initfini_array=yes
++ fi
+ ;;
+ nds32*-*-*)
+ target_cpu_default="0"
+diff --git a/gcc/config/msp430/msp430.h b/gcc/config/msp430/msp430.h
+index 1288b1a263d..ca7cf20e1d7 100644
+--- a/gcc/config/msp430/msp430.h
++++ b/gcc/config/msp430/msp430.h
+@@ -49,7 +49,7 @@ extern bool msp430x;
+
+ /* -lgcc is included because crtend.o needs __mspabi_func_epilog_1. */
+ #undef ENDFILE_SPEC
+-#define ENDFILE_SPEC "%{!minrt:crtend.o%s} %{minrt:crtn-minrt.o%s}%{!minrt:crtn.o%s} -lgcc"
++#define ENDFILE_SPEC "%{!minrt:crtend.o%s} %{minrt:%:if-exists(crtn-minrt.o%s)}%{!minrt:%:if-exists(crtn.o%s)} -lgcc"
+
+ #define ASM_SPEC "-mP " /* Enable polymorphic instructions. */ \
+ "%{mcpu=*:-mcpu=%*}%{!mcpu=*:%{mmcu=*:-mmcu=%*}} " /* Pass the CPU type on to the assembler. */ \