From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] cross-arm-none-eabi*: update to 9.2, rework to include libgcc.a and libstdc++
Date: Sat, 28 Dec 2019 02:19:29 +0100 [thread overview]
Message-ID: <20191228011929.RnMvdVDfMRXdFb5W9EJ5VnlbuHNmG0z6mN1XF5uIhp0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-17827@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]
There is an updated 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: 9240 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/4] 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 a6e9d0672cf11cfab0df0d81f0d23b8a7e736736 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Sat, 28 Dec 2019 02:18:41 +0100
Subject: [PATCH 2/4] cross-arm-none-eabi-newlib: rebuild with gcc 9.2
---
srcpkgs/cross-arm-none-eabi-newlib/template | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/srcpkgs/cross-arm-none-eabi-newlib/template b/srcpkgs/cross-arm-none-eabi-newlib/template
index 076c52c93f3..c00e167a0c7 100644
--- a/srcpkgs/cross-arm-none-eabi-newlib/template
+++ b/srcpkgs/cross-arm-none-eabi-newlib/template
@@ -3,7 +3,7 @@ _triplet=arm-none-eabi
_pkgname=newlib
pkgname=cross-${_triplet}-${_pkgname}
version=3.1.0.20181231
-revision=1
+revision=2
wrksrc="${_pkgname}-${version}"
build_style=gnu-configure
configure_args="
From 79c371aada869456f34ac16358092ea473416b36 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 27 Dec 2019 23:42:08 +0100
Subject: [PATCH 3/4] 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 2b7f857a51defe2a72334ea8b2fb30a8905cf11a Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Fri, 27 Dec 2019 23:43:03 +0100
Subject: [PATCH 4/4] 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"
next prev parent reply other threads:[~2019-12-28 1:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 22:56 [PR PATCH] " voidlinux-github
2019-12-28 1:19 ` voidlinux-github [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191228011929.RnMvdVDfMRXdFb5W9EJ5VnlbuHNmG0z6mN1XF5uIhp0@z \
--to=voidlinux-github@inbox.vuxu.org \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).