Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] cross-arm-none-eabi*: update to 9.2, rework to include libgcc.a and libstdc++
@ 2019-12-27 22:56 voidlinux-github
  2019-12-28  1:19 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: voidlinux-github @ 2019-12-27 22:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1183 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/q66/void-packages arm-none-eabi
https://github.com/void-linux/void-packages/pull/17827

cross-arm-none-eabi*: update to 9.2, rework to include libgcc.a and libstdc++
For `cross-arm-none-eabi-gcc`:

I've reworked this to make it possible to include `libgcc.a`, rather than just the compiler itself. However, as `libstdc++` requires `newlib` to be built and present (which requires the gcc to build), skip building `libstdc++` at this stage. Instead, move it into a separate package.

I figured out the necessary changes mostly by reading the Arch pkgbuild.

For `cross-arm-none-eabi-libstdc++`:

As the gcc cannot include libstdc++ because of its newlib requirement, build it as a separate package. This is achieved by taking the gcc source tree, installing our previously built gcc as well as newlib (which was already packaged) and building libstdc++ on its own. I've successfully compiled things with this.

Currently doing one more rebuild and test of everything.

@sirikid 

A patch file from https://github.com/void-linux/void-packages/pull/17827.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-arm-none-eabi-17827.patch --]
[-- Type: text/x-diff, Size: 8460 bytes --]

From 3431827866c57d1118f91c4a5ca699a27ab5227d Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 27 Dec 2019 23:40:18 +0100
Subject: [PATCH 1/3] cross-arm-none-eabi-gcc: update to 9.2.0 + build libgcc

This does other reworking, such as building in a separate directory
like is recommended by the project.

By importing some changes from Arch, I managed to fix building of
libgcc, which further enables building the rest of the toolchain.

However, building libstdc++ is skipped, as that requires newlib
to build, which itself is not available at this point. Newlib on
the other hand requires a built toolchain to compile. We solve
this by building gcc (complete but without libstdc++) first,
followed by building newlib, followed by building just libstdc++
on its own.
---
 srcpkgs/cross-arm-none-eabi-gcc/template | 117 +++++++++++++----------
 1 file changed, 67 insertions(+), 50 deletions(-)

diff --git a/srcpkgs/cross-arm-none-eabi-gcc/template b/srcpkgs/cross-arm-none-eabi-gcc/template
index 0e636b75773..e32e89f0c81 100644
--- a/srcpkgs/cross-arm-none-eabi-gcc/template
+++ b/srcpkgs/cross-arm-none-eabi-gcc/template
@@ -1,55 +1,13 @@
-# Template file for 'cross-${_triplet}-${_pkgname}'
+# Template file for 'cross-${_triplet}-gcc'
 _triplet=arm-none-eabi
 _pkgname=gcc
-pkgname=cross-${_triplet}-${_pkgname}
-version=9.1.0
+pkgname=cross-${_triplet}-gcc
+version=9.2.0
 revision=1
-wrksrc="${_pkgname}-${version}"
+wrksrc="gcc-${version}"
+build_wrksrc=build
 build_style=gnu-configure
-configure_args="
- --disable-decimal-float
- --disable-libffi
- --disable-libgomp
- --disable-libmudflap
- --disable-libquadmath
- --disable-libssp
- --disable-libstdcxx-pch
- --disable-nls
- --disable-shared
- --disable-threads
- --disable-tls
- --disable-werror
- --enable-__cxa_atexit
- --enable-c99
- --enable-gnu-indirect-function
- --enable-interwork
- --enable-languages=c,c++
- --enable-long-long
- --enable-multilib
- --enable-plugins
- --host=${XBPS_CROSS_TRIPLET}
- --libdir=/usr/lib
- --libexecdir=/usr/lib
- --prefix=/usr
- --target=${_triplet}
- --with-gmp
- --with-gnu-as
- --with-gnu-ld
- --with-headers=/usr/${_triplet}/include
- --with-host-libstdcxx='-static-libgcc'
- --with-isl
- --with-libelf
- --with-mpc
- --with-mpfr
- --with-multilib-list=rmprofile
- --with-native-system-header-dir=/include
- --with-newlib
- --with-python-dir=share/${_pkgname}-${_triplet}
- --with-sysroot=/usr/${_triplet}
- --with-system-zlib
-"
-make_build_target="all-gcc"
-make_install_target="install-gcc"
+make_build_args="INHIBIT_LIBC_CFLAGS='-DUSE_TM_CLONE_REGISTRY=0'"
 hostmakedepends="autoconf automake cross-arm-none-eabi-binutils bison flex perl"
 makedepends="gmp-devel isl15-devel libmpc-devel mpfr-devel zlib-devel"
 depends="cross-arm-none-eabi-binutils"
@@ -57,11 +15,70 @@ short_desc="GNU Compiler Collection"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="GFDL-1.2-or-later, GPL-3.0-or-later, LGPL-2.1-or-later"
 homepage="https://gcc.gnu.org"
-distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}/${_pkgname}-${version}.tar.xz"
-checksum=79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
 alternatives="arm-none-eabi:/usr/bin/arm-none-eabi-cc:/usr/bin/arm-none-eabi-gcc"
 nocross=yes
 nopie=yes
+nostrip_files="libgcc.a libgcov.a"
+
+post_extract() {
+	mkdir -p build
+}
+
+pre_configure() {
+	export CFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
+	export CXXFLAGS_FOR_TARGET="-g -Os -ffunction-sections -fdata-sections"
+}
+
+do_configure() {
+	../configure \
+		--disable-decimal-float \
+		--disable-libffi \
+		--disable-libgomp \
+		--disable-libmudflap \
+		--disable-libquadmath \
+		--disable-libssp \
+		--disable-libstdcxx-pch \
+		--disable-libstdc__-v3 \
+		--disable-nls \
+		--disable-shared \
+		--disable-threads \
+		--disable-tls \
+		--disable-werror \
+		--enable-__cxa_atexit \
+		--enable-c99 \
+		--enable-gnu-indirect-function \
+		--enable-interwork \
+		--enable-languages=c,c++ \
+		--enable-long-long \
+		--enable-multilib \
+		--enable-plugins \
+		--host=${XBPS_CROSS_TRIPLET} \
+		--libdir=/usr/lib \
+		--libexecdir=/usr/lib \
+		--prefix=/usr \
+		--target=${_triplet} \
+		--with-gmp \
+		--with-gnu-as \
+		--with-gnu-ld \
+		--with-headers=/usr/${_triplet}/include \
+		--with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' \
+		--with-isl \
+		--with-libelf \
+		--with-mpc \
+		--with-mpfr \
+		--with-multilib-list=rmprofile \
+		--with-native-system-header-dir=/include \
+		--with-newlib \
+		--with-python-dir=share/gcc-${_triplet} \
+		--with-sysroot=/usr/${_triplet} \
+		--with-system-zlib
+}
+
+pre_build() {
+	pre_configure
+}
 
 post_install() {
 	rm -fr ${DESTDIR}/usr/share/{info,man/man7}

From 666361c662ebaf158c3ab52765ecd9480facf818 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 27 Dec 2019 23:42:08 +0100
Subject: [PATCH 2/3] New package: cross-arm-none-eabi-libstdc++

This completes the basic bare metal C/C++ toolchain by adding
libstdc++. As this requires newlib to build, we need to make it
into a separate package in order to avoid a dependency cycle.
---
 .../cross-arm-none-eabi-libstdc++/template    | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 srcpkgs/cross-arm-none-eabi-libstdc++/template

diff --git a/srcpkgs/cross-arm-none-eabi-libstdc++/template b/srcpkgs/cross-arm-none-eabi-libstdc++/template
new file mode 100644
index 00000000000..c9d8318ff16
--- /dev/null
+++ b/srcpkgs/cross-arm-none-eabi-libstdc++/template
@@ -0,0 +1,49 @@
+# Template file for 'cross-${_triplet}-libstdc++'
+_triplet=arm-none-eabi
+pkgname=cross-${_triplet}-libstdc++
+version=9.2.0
+revision=1
+wrksrc="gcc-${version}"
+build_wrksrc=build
+# gnu-configure implicitly passes stuff we don't want
+build_style=configure
+configure_args="
+ --disable-libstdcxx-pch --disable-libstdcxx-threads
+ --disable-nls --disable-shared --disable-tls --disable-werror
+ --enable-multilib --host=${_triplet} --target=${_triplet}
+ --libdir=/usr/${_triplet}/lib --prefix=/usr/${_triplet}
+ --with-gnu-ld --with-gxx-include-dir=/usr/${_triplet}/include/${version}
+ --with-newlib --with-python-dir=share/gcc-${_triplet}"
+configure_script="../libstdc++-v3/configure"
+make_build_args="INHIBIT_LIBC_CFLAGS='-DUSE_TM_CLONE_REGISTRY=0'"
+hostmakedepends="autoconf automake cross-arm-none-eabi-binutils
+ cross-arm-none-eabi-gcc cross-arm-none-eabi-newlib bison flex perl"
+makedepends="gmp-devel isl15-devel libmpc-devel mpfr-devel zlib-devel"
+depends="cross-arm-none-eabi-gcc"
+short_desc="GNU Compiler Collection - Standard C++ Library"
+maintainer="q66 <daniel@octaforge.org>"
+license="GPL-3.0-or-later"
+homepage="https://gcc.gnu.org"
+distfiles="${GNU_SITE}/gcc/gcc-${version}/gcc-${version}.tar.xz"
+checksum=ea6ef08f121239da5695f76c9b33637a118dcf63e24164422231917fa61fb206
+nocross=yes
+nopie=yes
+nostrip=yes
+
+post_extract() {
+	mkdir -p build
+}
+
+pre_configure() {
+	export CFLAGS="-g -Os -ffunction-sections -fdata-sections"
+	export CXXFLAGS="-g -Os -ffunction-sections -fdata-sections"
+	export CC=arm-none-eabi-gcc
+	export CXX=arm-none-eabi-g++
+	export CPP=arm-none-eabi-cpp
+	export AR=arm-none-eabi-ar
+	export AS=arm-none-eabi-as
+}
+
+pre_build() {
+	pre_configure
+}

From c0bc8ad05c8f82f41eae77001420ff38e00a3418 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 27 Dec 2019 23:43:03 +0100
Subject: [PATCH 3/3] cross-arm-none-eabi: add libstdc++ dependency

[ci skip]
---
 srcpkgs/cross-arm-none-eabi/template | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/cross-arm-none-eabi/template b/srcpkgs/cross-arm-none-eabi/template
index 4cae46f9b08..8a6b7573ebe 100644
--- a/srcpkgs/cross-arm-none-eabi/template
+++ b/srcpkgs/cross-arm-none-eabi/template
@@ -1,10 +1,11 @@
 # Template file for 'cross-arm-none-eabi'
 _triplet=arm-none-eabi
 pkgname=cross-arm-none-eabi
-version=0.4
+version=0.5
 revision=1
 build_style=meta
-depends="cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc cross-arm-none-eabi-newlib"
+depends="cross-arm-none-eabi-binutils cross-arm-none-eabi-gcc
+ cross-arm-none-eabi-libstdc++ cross-arm-none-eabi-newlib"
 short_desc="GNU cross bare metal toolchain"
 maintainer="Ivan Sokolov <ivan-p-sokolov@ya.ru>"
 license="metapackage"

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

end of thread, other threads:[~2020-01-04  1:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 22:56 [PR PATCH] cross-arm-none-eabi*: update to 9.2, rework to include libgcc.a and libstdc++ voidlinux-github
2019-12-28  1:19 ` [PR PATCH] [Updated] " voidlinux-github
2019-12-28  1:22 ` voidlinux-github
2019-12-28 15:24 ` [PR PATCH] [Updated] [wip] " voidlinux-github
2019-12-28 16:28 ` [PR PATCH] [Updated] [wip] cross-arm-none-eabi*: update to 9.2, rework to include libgcc.a and libstdc++, newlib: build nano voidlinux-github
2019-12-28 16:39 ` voidlinux-github
2019-12-28 16:39 ` voidlinux-github
2019-12-28 20:51 ` voidlinux-github
2019-12-28 21:55 ` voidlinux-github
2019-12-28 22:02 ` voidlinux-github
2019-12-28 23:49 ` voidlinux-github
2020-01-04  1:21 ` [PR PATCH] [Merged]: " voidlinux-github

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 NNTP newsgroup(s).