Add package with PRU linker scripts and headers

Include the gnuprumcu package in PRU cross toolchain.
Toolchain is somewhat useless without device specs and
linker scripts for the various SoCs.

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
This commit is contained in:
Dimitar Dimitrov 2021-01-15 20:23:10 +02:00
parent c800bc8c82
commit e7d0485ca2
7 changed files with 143 additions and 0 deletions

View File

@ -0,0 +1,2 @@
# gnuprumcu config file
## depends on ARCH_PRU

View File

@ -0,0 +1,41 @@
From b045b2c65e26153813abadc2d065afdd52612fb0 Mon Sep 17 00:00:00 2001
From: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Fri, 15 Jan 2021 18:52:09 +0200
Subject: [PATCH] HACK: Fix paths for crosstool-ng
For some reason crosstool-ng modifies the default
binutils/ld path for ldscripts. Align our respective
path.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
ldscripts/Makefile.am | 2 +-
ldscripts/Makefile.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ldscripts/Makefile.am b/ldscripts/Makefile.am
index 23c5903..b6984d5 100644
--- a/ldscripts/Makefile.am
+++ b/ldscripts/Makefile.am
@@ -47,4 +47,4 @@ dist_pru_DATA = \
pruelf-tda4vm.icssg1.tx_pru1.x
-prudir = $(exec_prefix)/$(target_alias)/lib
+prudir = $(libdir)
diff --git a/ldscripts/Makefile.in b/ldscripts/Makefile.in
index b58975f..b7aecd2 100644
--- a/ldscripts/Makefile.in
+++ b/ldscripts/Makefile.in
@@ -300,7 +300,7 @@ dist_pru_DATA = \
pruelf-tda4vm.icssg1.tx_pru0.x \
pruelf-tda4vm.icssg1.tx_pru1.x
-prudir = $(exec_prefix)/$(target_alias)/lib
+prudir = $(libdir)
all: all-am
.SUFFIXES:
--
2.20.1

4
packages/gnuprumcu/0.5.0/chksum vendored Normal file
View File

@ -0,0 +1,4 @@
md5 gnuprumcu-0.5.0.tar.gz ee6110995491dac1a834ca7045931391
sha1 gnuprumcu-0.5.0.tar.gz 94eb2aeb88f5654fa041bed07c2fb7860af95047
sha256 gnuprumcu-0.5.0.tar.gz 917043152188ad4626f888dbb620e816a523c0599f9a758230a7d687daf915af
sha512 gnuprumcu-0.5.0.tar.gz cc3071913db9c364c2e3966ab580b703700c85a3d292e230b5536df45b54e0137dc1e83a2fae80947e3c1ad178e5b6b6d8319a3d576653b423178c443386bd17

0
packages/gnuprumcu/0.5.0/version.desc vendored Normal file
View File

View File

@ -0,0 +1,6 @@
origin='dinux.eu'
repository='git https://github.com/dinuxbg/gnuprumcu.git'
bootstrap='autoreconf -vfi'
relevantpattern='*.*.*'
archive_formats='.tar.gz'
mirrors='https://github.com/dinuxbg/gnuprumcu/releases/download/v${CT_GNUPRUMCU_VERSION}'

View File

@ -12,4 +12,5 @@ CT_LIBC_NEWLIB_EXTRA_SECTIONS=y
CT_LIBC_NEWLIB_NANO_MALLOC=y
CT_LIBC_NEWLIB_NANO_FORMATTED_IO=y
CT_CC_LANG_CXX=y
CT_COMP_LIBS_GNUPRUMCU=y
CT_COMP_TOOLS_MAKE=y

View File

@ -0,0 +1,89 @@
# Build script for gnuprumcu
do_gnuprumcu_get() { :; }
do_gnuprumcu_extract() { :; }
do_gnuprumcu_for_build() { :; }
do_gnuprumcu_for_host() { :; }
do_gnuprumcu_for_target() { :; }
if [ "${CT_COMP_LIBS_GNUPRUMCU}" = "y" ]; then
do_gnuprumcu_get() {
CT_Fetch GNUPRUMCU
}
do_gnuprumcu_extract() {
CT_ExtractPatch GNUPRUMCU
}
do_gnuprumcu_for_target() {
local -a gnuprumcu_opts
CT_DoStep INFO "Installing gnuprumcu for the target"
CT_mkdir_pushd "${CT_BUILD_DIR}/build-gnuprumcu-target-${CT_TARGET}"
gnuprumcu_opts+=( "destdir=${CT_SYSROOT_DIR}" )
gnuprumcu_opts+=( "host=${CT_HOST}" )
gnuprumcu_opts+=( "cflags=${CT_ALL_TARGET_CFLAGS}" )
gnuprumcu_opts+=( "prefix=${CT_PREFIX_DIR}" )
do_gnuprumcu_backend "${gnuprumcu_opts[@]}"
CT_Popd
CT_EndStep
}
# Build gnuprumcu
# Parameter : description : type : default
# destdir : out-of-tree install dir : string : /
# host : machine to run on : tuple : (none)
# prefix : prefix to install into : dir : (none)
# cflags : cflags to use : string : (empty)
# ldflags : ldflags to use : string : (empty)
# shared : also buils shared lib : bool : n
do_gnuprumcu_backend() {
local destdir="/"
local host
local prefix
local cflags
local ldflags
local shared
local -a extra_config
local arg
for arg in "$@"; do
eval "${arg// /\\ }"
done
CT_DoLog EXTRA "Configuring gnuprumcu"
CT_DoExecLog CFG \
CC="${host}-gcc" \
RANLIB="${host}-ranlib" \
CFLAGS="${cflags}" \
LDFLAGS="${ldflags}" \
${CONFIG_SHELL} \
"${CT_SRC_DIR}/gnuprumcu/configure" \
--build=${CT_BUILD} \
--host=${host} \
--target=${CT_TARGET} \
--prefix="${prefix}" \
"${extra_config[@]}"
CT_DoLog EXTRA "Building gnuprumcu"
CT_DoExecLog ALL make
CT_DoLog EXTRA "Installing gnuprumcu"
# Guard against $destdir$prefix == //
# which is a UNC path on Cygwin/MSYS2
if [[ ${destdir} == / ]] && [[ ${prefix} == /* ]]; then
destdir=
fi
CT_DoExecLog ALL make instroot="${destdir}" install
}
fi # CT_COMP_LIBS_GNUPRUMCU