mirror of
https://github.com/thead-yocto-mirror/meta-riscv
synced 2026-09-18 13:12:34 +02:00
recipes-devtools: Rename folder to recipes-devtools
Rename the folder to recipes-devtools as most other layers call it. Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
This commit is contained in:
3
recipes-devtools/gdb/gdb-cross-canadian_riscv.bb
Normal file
3
recipes-devtools/gdb/gdb-cross-canadian_riscv.bb
Normal file
@@ -0,0 +1,3 @@
|
||||
require recipes-devtools/gdb/gdb-common.inc
|
||||
require recipes-devtools/gdb/gdb-cross-canadian.inc
|
||||
require gdb-${PV}.inc
|
||||
2
recipes-devtools/gdb/gdb-cross_riscv.bb
Normal file
2
recipes-devtools/gdb/gdb-cross_riscv.bb
Normal file
@@ -0,0 +1,2 @@
|
||||
require recipes-devtools/gdb/gdb-cross.inc
|
||||
require gdb-${PV}.inc
|
||||
10
recipes-devtools/gdb/gdb-riscv.inc
Normal file
10
recipes-devtools/gdb/gdb-riscv.inc
Normal file
@@ -0,0 +1,10 @@
|
||||
LICENSE = "GPLv2 & GPLv3 & LGPLv2 & LGPLv3"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \
|
||||
file://COPYING3;md5=d32239bcb673463ab874e80d47fae504 \
|
||||
file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6 \
|
||||
file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674"
|
||||
|
||||
SRCREV = "5b858aaab5a71268ac1d5da638de9d865addd38f"
|
||||
SRC_URI = "git://github.com/kraj/binutils-gdb;branch=oe/gdb-master;rebasable=1"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
27
recipes-devtools/gdb/gdb_riscv.bb
Normal file
27
recipes-devtools/gdb/gdb_riscv.bb
Normal file
@@ -0,0 +1,27 @@
|
||||
require recipes-devtools/gdb/gdb.inc
|
||||
require gdb-${PV}.inc
|
||||
|
||||
inherit python3-dir
|
||||
|
||||
EXTRA_OEMAKE_append_libc-musl = "\
|
||||
gt_cv_func_gnugettext1_libc=yes \
|
||||
gt_cv_func_gnugettext2_libc=yes \
|
||||
gl_cv_func_gettimeofday_clobber=no \
|
||||
"
|
||||
|
||||
do_configure_prepend() {
|
||||
if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
|
||||
cat > ${WORKDIR}/python << EOF
|
||||
#!/bin/sh
|
||||
case "\$2" in
|
||||
--includes) echo "-I${STAGING_INCDIR}/${PYTHON_DIR}${PYTHON_ABI}/" ;;
|
||||
--ldflags) echo "-Wl,-rpath-link,${STAGING_LIBDIR}/.. -Wl,-rpath,${libdir}/.. -lpthread -ldl -lutil -lm -lpython${PYTHON_BASEVERSION}${PYTHON_ABI}" ;;
|
||||
--exec-prefix) echo "${exec_prefix}" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x ${WORKDIR}/python
|
||||
fi
|
||||
}
|
||||
CFLAGS_append_libc-musl = " -Drpl_gettimeofday=gettimeofday"
|
||||
@@ -0,0 +1,144 @@
|
||||
From e3bb636048916b092b36f81f787399f4a4c76e41 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 10 Mar 2018 13:39:34 -0800
|
||||
Subject: [PATCH] prelink: Add RISC-V support
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
ChangeLog | 5 +++++
|
||||
src/elf.h | 25 ++++++++++++++++++++++++-
|
||||
src/rtld/dl-tls.c | 5 +++++
|
||||
src/rtld/rtld.c | 14 ++++++++++++++
|
||||
4 files changed, 48 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: git/ChangeLog
|
||||
===================================================================
|
||||
--- git.orig/ChangeLog
|
||||
+++ git/ChangeLog
|
||||
@@ -1,3 +1,8 @@
|
||||
+2018-03-10 Khem Raj <raj.khem@gmail.com>
|
||||
+ * src/elf.h: Add RISC-V defines
|
||||
+ * src/rtld/dl-tls.c: Add RISC-V support
|
||||
+ * src/rtld/rtld.c: Add RISC-V support
|
||||
+
|
||||
2017-06-20 Kyle Russell <bkylerussell@gmail.com>
|
||||
* src/rtld/rtld.c: Add missing DT_NEEDED DSOs to needed_list
|
||||
|
||||
Index: git/src/elf.h
|
||||
===================================================================
|
||||
--- git.orig/src/elf.h
|
||||
+++ git/src/elf.h
|
||||
@@ -254,7 +254,8 @@ typedef struct
|
||||
#define EM_TILEPRO 188 /* Tilera TILEPro */
|
||||
#define EM_MICROBLAZE 189 /* Xilinx MicroBlaze */
|
||||
#define EM_TILEGX 191 /* Tilera TILE-Gx */
|
||||
-#define EM_NUM 192
|
||||
+#define EM_RISCV 243 /* RISC-V */
|
||||
+#define EM_NUM 244
|
||||
|
||||
/* If it is necessary to assign new unofficial EM_* values, please
|
||||
pick large random numbers (0x8523, 0xa7f2, etc.) to minimize the
|
||||
@@ -3556,6 +3557,28 @@ enum
|
||||
|
||||
#define R_TILEGX_NUM 130
|
||||
|
||||
+/* RISC-V ELF Flags */
|
||||
+#define EF_RISCV_RVC 0x0001
|
||||
+#define EF_RISCV_FLOAT_ABI 0x0006
|
||||
+#define EF_RISCV_FLOAT_ABI_SOFT 0x0000
|
||||
+#define EF_RISCV_FLOAT_ABI_SINGLE 0x0002
|
||||
+#define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004
|
||||
+#define EF_RISCV_FLOAT_ABI_QUAD 0x0006
|
||||
+
|
||||
+/* RISC-V relocations. */
|
||||
+#define R_RISCV_NONE 0
|
||||
+#define R_RISCV_32 1
|
||||
+#define R_RISCV_64 2
|
||||
+#define R_RISCV_RELATIVE 3
|
||||
+#define R_RISCV_COPY 4
|
||||
+#define R_RISCV_JUMP_SLOT 5
|
||||
+#define R_RISCV_TLS_DTPMOD32 6
|
||||
+#define R_RISCV_TLS_DTPMOD64 7
|
||||
+#define R_RISCV_TLS_DTPREL32 8
|
||||
+#define R_RISCV_TLS_DTPREL64 9
|
||||
+#define R_RISCV_TLS_TPREL32 10
|
||||
+#define R_RISCV_TLS_TPREL64 11
|
||||
+#define R_RISCV_NUM 12
|
||||
|
||||
__END_DECLS
|
||||
|
||||
Index: git/src/rtld/dl-tls.c
|
||||
===================================================================
|
||||
--- git.orig/src/rtld/dl-tls.c
|
||||
+++ git/src/rtld/dl-tls.c
|
||||
@@ -138,6 +138,11 @@ rtld_determine_tlsoffsets (int e_machine
|
||||
tls_tcb_size = 8;
|
||||
break;
|
||||
|
||||
+ case EM_RISCV:
|
||||
+ tls_dtv_at_tp = 1;
|
||||
+ tls_tcb_size = 0;
|
||||
+ break;
|
||||
+
|
||||
default:
|
||||
/* Hope there's no TLS! */
|
||||
for (i = 0; i < search_list->r_nlist; i++)
|
||||
Index: git/src/rtld/rtld.c
|
||||
===================================================================
|
||||
--- git.orig/src/rtld/rtld.c
|
||||
+++ git/src/rtld/rtld.c
|
||||
@@ -224,6 +224,17 @@ parse_opt (int key, char *arg, struct ar
|
||||
* ELF_RTYPE_CLASS_PLT \
|
||||
| ((type) == R_MICROBLAZE_COPY) * ELF_RTYPE_CLASS_COPY)
|
||||
|
||||
+/* From glibc-2.27: sysdeps/riscv/dl-machine.h */
|
||||
+#define riscv_elf_machine_type_class(type) \
|
||||
+ ((ELF_RTYPE_CLASS_PLT * ((type) == R_RISCV_JUMP_SLOT \
|
||||
+ || ((type) == R_RISCV_TLS_DTPREL32) \
|
||||
+ || ((type) == R_RISCV_TLS_DTPMOD32) \
|
||||
+ || ((type) == R_RISCV_TLS_TPREL32) \
|
||||
+ || ((type) == R_RISCV_TLS_DTPREL64) \
|
||||
+ || ((type) == R_RISCV_TLS_DTPMOD64) \
|
||||
+ || ((type) == R_RISCV_TLS_TPREL64))) \
|
||||
+ | (ELF_RTYPE_CLASS_COPY * ((type) == R_RISCV_COPY)))
|
||||
+
|
||||
int
|
||||
elf_machine_type_class (int type, int machine)
|
||||
{
|
||||
@@ -254,6 +265,8 @@ elf_machine_type_class (int type, int ma
|
||||
return nios2_elf_machine_type_class(type);
|
||||
case EM_MICROBLAZE:
|
||||
return microblaze_elf_machine_type_class(type);
|
||||
+ case EM_RISCV:
|
||||
+ return riscv_elf_machine_type_class(type);
|
||||
|
||||
default:
|
||||
printf ("Unknown architecture!\n");
|
||||
@@ -296,6 +309,7 @@ machine_no_rela (int machine)
|
||||
case EM_SPARCV9:
|
||||
case EM_ALTERA_NIOS2:
|
||||
case EM_MICROBLAZE:
|
||||
+ case EM_RISCV:
|
||||
return 0;
|
||||
default:
|
||||
return 1;
|
||||
@@ -329,6 +343,8 @@ is_ldso_soname (const char *soname)
|
||||
|| ! strcmp (soname, "ld-linux-aarch64.so.1")
|
||||
|| ! strcmp (soname, "ld-linux-aarch64_be.so.1")
|
||||
|| ! strcmp (soname, "ld-linux-nios2.so.1")
|
||||
+ || ! strcmp (soname, "ld-linux-riscv64-lp64.so.1")
|
||||
+ || ! strcmp (soname, "ld-linux-riscv64-lp64d.so.1")
|
||||
)
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -1214,8 +1230,8 @@ main(int argc, char **argv)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
- load_ld_so_conf (gelf_getclass (dso->elf) == ELFCLASS64,
|
||||
- ( dso->ehdr.e_machine == EM_MIPS) && ( dso->ehdr.e_flags & EF_MIPS_ABI2 ) );
|
||||
+ load_ld_so_conf ((gelf_getclass (dso->elf) == ELFCLASS64) && (dso->ehdr.e_machine != EM_RISCV),
|
||||
+ (dso->ehdr.e_machine == EM_MIPS) && (dso->ehdr.e_flags & EF_MIPS_ABI2));
|
||||
|
||||
if (multiple)
|
||||
printf ("%s:\n", argv[remaining]);
|
||||
@@ -0,0 +1,107 @@
|
||||
From 564b0d7a21dc3b6eef3b3e7819910d9376e708ed Mon Sep 17 00:00:00 2001
|
||||
From: Kyle Russell <bkylerussell@gmail.com>
|
||||
Date: Thu, 25 Aug 2016 11:39:17 -0400
|
||||
Subject: [PATCH] rtld: Add missing DT_NEEDED DSOs to needed_list
|
||||
|
||||
prelink-rtld may report an "error while loading shared libraries" for
|
||||
the wrong library.
|
||||
|
||||
If some set of DT_NEEDED DSOs are not in the default search path, they
|
||||
may have a dso_list entry added, but no matching entry is added to the
|
||||
needed_list. This causes the linker to miscalculate the max number of
|
||||
dsos during build_local_scope(), which later causes find_needed() to not
|
||||
search the entire l_local_scope[0]->r_list during
|
||||
_dl_check_map_versions() (since the max from build_local_scope() becomes
|
||||
l_local_scope[0]->r_nlist).
|
||||
|
||||
Since find_needed() searches through the r_list, which would have the
|
||||
dso_list entries for the libraries that weren't found earlier, this cuts
|
||||
the search short, meaning libraries near the end of the local scope don't
|
||||
get included in the map version search.
|
||||
|
||||
As the comment in _dl_check_map_versions() suggests, if needed is NULL,
|
||||
that means a dependency was not found and no stub entry created, which
|
||||
should never happen.
|
||||
|
||||
Signed-off-by: Kyle Russell <bkylerussell@gmail.com>
|
||||
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
|
||||
---
|
||||
ChangeLog | 3 +++
|
||||
src/rtld/rtld.c | 36 ++++++++++++++++++++++--------------
|
||||
2 files changed, 25 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/ChangeLog b/ChangeLog
|
||||
index c72dca8..274b420 100644
|
||||
--- a/ChangeLog
|
||||
+++ b/ChangeLog
|
||||
@@ -1,3 +1,6 @@
|
||||
+2017-06-20 Kyle Russell <bkylerussell@gmail.com>
|
||||
+ * src/rtld/rtld.c: Add missing DT_NEEDED DSOs to needed_list
|
||||
+
|
||||
2017-06-20 Mark Hatle <mark.hatle@windriver.com>
|
||||
* doc/Makefile.am: Disable automatic generation of prelink.pdf
|
||||
|
||||
diff --git a/src/rtld/rtld.c b/src/rtld/rtld.c
|
||||
index 3196981..3024868 100644
|
||||
--- a/src/rtld/rtld.c
|
||||
+++ b/src/rtld/rtld.c
|
||||
@@ -698,6 +698,25 @@ find_lib_by_soname (const char *soname, struct dso_list *loader,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+static void
|
||||
+add_dso_to_needed (struct dso_list *cur_dso_ent, struct dso_list *new_dso_ent)
|
||||
+{
|
||||
+ if (!cur_dso_ent->needed)
|
||||
+ {
|
||||
+ cur_dso_ent->needed = malloc (sizeof (struct needed_list));
|
||||
+ cur_dso_ent->needed_tail = cur_dso_ent->needed;
|
||||
+ cur_dso_ent->needed_tail->ent = new_dso_ent;
|
||||
+ cur_dso_ent->needed_tail->next = NULL;
|
||||
+ }
|
||||
+ else if (!in_needed_list (cur_dso_ent->needed, new_dso_ent->name))
|
||||
+ {
|
||||
+ cur_dso_ent->needed_tail->next = malloc (sizeof (struct needed_list));
|
||||
+ cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->next;
|
||||
+ cur_dso_ent->needed_tail->ent = new_dso_ent;
|
||||
+ cur_dso_ent->needed_tail->next = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static struct dso_list *
|
||||
load_dsos (DSO *dso, int host_paths)
|
||||
{
|
||||
@@ -824,6 +843,8 @@ load_dsos (DSO *dso, int host_paths)
|
||||
dso_list_tail->canon_filename = strdup(soname);
|
||||
dso_list_tail->err_no = errno;
|
||||
|
||||
+ add_dso_to_needed(cur_dso_ent, new_dso_ent);
|
||||
+
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -866,20 +887,7 @@ load_dsos (DSO *dso, int host_paths)
|
||||
dso_list_tail->name = new_dso->soname;
|
||||
}
|
||||
|
||||
- if (!cur_dso_ent->needed)
|
||||
- {
|
||||
- cur_dso_ent->needed = malloc (sizeof (struct needed_list));
|
||||
- cur_dso_ent->needed_tail = cur_dso_ent->needed;
|
||||
- cur_dso_ent->needed_tail->ent = new_dso_ent;
|
||||
- cur_dso_ent->needed_tail->next = NULL;
|
||||
- }
|
||||
- else if (!in_needed_list (cur_dso_ent->needed, soname))
|
||||
- {
|
||||
- cur_dso_ent->needed_tail->next = malloc (sizeof (struct needed_list));
|
||||
- cur_dso_ent->needed_tail = cur_dso_ent->needed_tail->next;
|
||||
- cur_dso_ent->needed_tail->ent = new_dso_ent;
|
||||
- cur_dso_ent->needed_tail->next = NULL;
|
||||
- }
|
||||
+ add_dso_to_needed(cur_dso_ent, new_dso_ent);
|
||||
|
||||
continue;
|
||||
}
|
||||
--
|
||||
2.16.2
|
||||
|
||||
4
recipes-devtools/prelink/prelink_%.bbappend
Normal file
4
recipes-devtools/prelink/prelink_%.bbappend
Normal file
@@ -0,0 +1,4 @@
|
||||
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||
SRC_URI_append = " file://0001-rtld-Add-missing-DT_NEEDED-DSOs-to-needed_list.patch"
|
||||
SRC_URI_append = " file://0001-prelink-Add-RISC-V-support.patch"
|
||||
|
||||
26
recipes-devtools/qemu/qemu_riscv.bb
Normal file
26
recipes-devtools/qemu/qemu_riscv.bb
Normal file
@@ -0,0 +1,26 @@
|
||||
require recipes-devtools/qemu/qemu.inc
|
||||
|
||||
SRC_URI = "gitsm://github.com/riscv/riscv-qemu.git;destsuffix=${S};branch=master;rebaseable=1 \
|
||||
"
|
||||
SRCREV = "9cc7d0cf6a6dc300db4db25421eff782623d6b18"
|
||||
|
||||
SRC_URI_remove_class-native = "\
|
||||
file://fix-libcap-header-issue-on-some-distro.patch \
|
||||
file://cpus.c-qemu_cpu_kick_thread_debugging.patch \
|
||||
"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac"
|
||||
|
||||
QEMU_TARGETS = "riscv64 riscv32"
|
||||
|
||||
EXTRA_OECONF_remove = "--disable-numa --disable-lzo --disable-opengl --disable-gnutls --disable-static"
|
||||
|
||||
do_install() {
|
||||
export STRIP="true"
|
||||
autotools_do_install
|
||||
install -d ${D}${datadir}/qemu
|
||||
|
||||
# Prevent QA warnings about installed ${localstatedir}/run
|
||||
if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
|
||||
}
|
||||
COMPATIBLE_HOST_class-target = "(riscv64|riscv32).*-linux"
|
||||
365
recipes-devtools/riscv-tools/files/0001-add-acinclude.m4.patch
Normal file
365
recipes-devtools/riscv-tools/files/0001-add-acinclude.m4.patch
Normal file
@@ -0,0 +1,365 @@
|
||||
From c3c94f9356879c162b14f55a0fcd1facc0f4e36f Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Fri, 9 Mar 2018 02:00:47 -0800
|
||||
Subject: [PATCH] add acinclude.m4
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
acinclude.m4 | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 345 insertions(+)
|
||||
create mode 100644 acinclude.m4
|
||||
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
new file mode 100644
|
||||
index 0000000..15353f2
|
||||
--- /dev/null
|
||||
+++ b/acinclude.m4
|
||||
@@ -0,0 +1,345 @@
|
||||
+#=========================================================================
|
||||
+# Local Autoconf Macros
|
||||
+#=========================================================================
|
||||
+# This file contains the macros for the Modular C++ Build System and
|
||||
+# additional autoconf macros which developers can use in their
|
||||
+# configure.ac scripts. Please read the documentation in
|
||||
+# 'mcppbs-doc.txt' for more details on how the Modular C++ Build System
|
||||
+# works. The documenation for each macro should include information
|
||||
+# about the author, date, and copyright.
|
||||
+
|
||||
+#-------------------------------------------------------------------------
|
||||
+# MCPPBS_PROG_INSTALL
|
||||
+#-------------------------------------------------------------------------
|
||||
+# This macro will add an --enable-stow command line option to the
|
||||
+# configure script. When enabled, this macro will first check to see if
|
||||
+# the stow program is available and if so it will set the $stow shell
|
||||
+# variable to the binary name and the $enable_stow shell variable to
|
||||
+# "yes". These variables can be used in a makefile to conditionally use
|
||||
+# stow for installation.
|
||||
+#
|
||||
+# This macro uses two environment variables to help setup default stow
|
||||
+# locations. The $STOW_PREFIX is used for stowing native built packages.
|
||||
+# The packages are staged in $STOW_PREFIX/pkgs and then symlinks are
|
||||
+# created from within $STOW_PREFIX into the pkgs subdirectory. If you
|
||||
+# only do native builds then this is all you need to set. If you don't
|
||||
+# set $STOW_PREFIX then the default is just the normal default prefix
|
||||
+# which is almost always /usr/local.
|
||||
+#
|
||||
+# For non-native builds we probably want to install the packages in a
|
||||
+# different location which includes the host architecture name as part
|
||||
+# of the prefix. For these kind of builds, we can specify the $STOW_ROOT
|
||||
+# environment variable and the effective prefix will be
|
||||
+# $STOW_ROOT/${host_alias} where ${host_alias} is specified on the
|
||||
+# configure command line with "--host".
|
||||
+#
|
||||
+# Here is an example setup:
|
||||
+#
|
||||
+# STOW_ROOT="$HOME/install"
|
||||
+# STOW_ARCH="i386-macosx10.4"
|
||||
+# STOW_PREFIX="${STOW_ROOT}/${STOW_ARCH}"
|
||||
+#
|
||||
+
|
||||
+AC_DEFUN([MCPPBS_PROG_INSTALL],
|
||||
+[
|
||||
+
|
||||
+ # Configure command line option
|
||||
+
|
||||
+ AC_ARG_ENABLE(stow,
|
||||
+ AS_HELP_STRING(--enable-stow,[Enable stow-based install]),
|
||||
+ [enable_stow="yes"],[enable_stow="no"])
|
||||
+
|
||||
+ AC_SUBST([enable_stow])
|
||||
+
|
||||
+ # Environment variables
|
||||
+
|
||||
+ AC_ARG_VAR([STOW_ROOT], [Root for non-native stow-based installs])
|
||||
+ AC_ARG_VAR([STOW_PREFIX], [Prefix for stow-based installs])
|
||||
+
|
||||
+ # Check for install script
|
||||
+
|
||||
+ AC_PROG_INSTALL
|
||||
+
|
||||
+ # Deterimine if native build and set prefix appropriately
|
||||
+
|
||||
+ AS_IF([ test ${enable_stow} = "yes" ],
|
||||
+ [
|
||||
+ AC_CHECK_PROGS([stow],[stow],[no])
|
||||
+ AS_IF([ test ${stow} = "no" ],
|
||||
+ [
|
||||
+ AC_MSG_ERROR([Cannot use --enable-stow since stow is not available])
|
||||
+ ])
|
||||
+
|
||||
+ # Check if native or non-native build
|
||||
+
|
||||
+ AS_IF([ test "${build}" = "${host}" ],
|
||||
+ [
|
||||
+
|
||||
+ # build == host so this is a native build. Make sure --prefix not
|
||||
+ # set and $STOW_PREFIX is set, then set prefix=$STOW_PREFIX.
|
||||
+
|
||||
+ AS_IF([ test "${prefix}" = "NONE" && test -n "${STOW_PREFIX}" ],
|
||||
+ [
|
||||
+ prefix="${STOW_PREFIX}"
|
||||
+ AC_MSG_NOTICE([Using \$STOW_PREFIX from environment])
|
||||
+ AC_MSG_NOTICE([prefix=${prefix}])
|
||||
+ ])
|
||||
+
|
||||
+ ],[
|
||||
+
|
||||
+ # build != host so this is a non-native build. Make sure --prefix
|
||||
+ # not set and $STOW_ROOT is set, then set
|
||||
+ # prefix=$STOW_ROOT/${host_alias}.
|
||||
+
|
||||
+ AS_IF([ test "${prefix}" = "NONE" && test -n "${STOW_ROOT}" ],
|
||||
+ [
|
||||
+ prefix="${STOW_ROOT}/${host_alias}"
|
||||
+ AC_MSG_NOTICE([Using \$STOW_ROOT from environment])
|
||||
+ AC_MSG_NOTICE([prefix=${prefix}])
|
||||
+ ])
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+])
|
||||
+
|
||||
+#-------------------------------------------------------------------------
|
||||
+# MCPPBS_PROG_RUN
|
||||
+# -------------------------------------------------------------------------
|
||||
+# If we are doing a non-native build then we look for an isa simulator
|
||||
+# to use for running tests. We set the RUN substitution variable to be
|
||||
+# empty for native builds or to the name of the isa simulator for
|
||||
+# non-native builds. Thus a makefile can run compiled programs
|
||||
+# regardless if we are doing a native or non-native build like this:
|
||||
+#
|
||||
+# $(RUN) $(RUNFLAGS) ./test-program
|
||||
+#
|
||||
+
|
||||
+AC_DEFUN([MCPPBS_PROG_RUN],
|
||||
+[
|
||||
+ AS_IF([ test "${build}" != "${host}" ],
|
||||
+ [
|
||||
+ AC_CHECK_TOOLS([RUN],[isa-run run],[no])
|
||||
+ AS_IF([ test ${RUN} = "no" ],
|
||||
+ [
|
||||
+ AC_MSG_ERROR([Cannot find simulator for target ${target_alias}])
|
||||
+ ])
|
||||
+ ],[
|
||||
+ RUN=""
|
||||
+ ])
|
||||
+ AC_SUBST([RUN])
|
||||
+ AC_SUBST([RUNFLAGS])
|
||||
+])
|
||||
+
|
||||
+#-------------------------------------------------------------------------
|
||||
+# MCPPBS_SUBPROJECTS([ sproj1, sproj2, ... ])
|
||||
+#-------------------------------------------------------------------------
|
||||
+# The developer should call this macro with a list of the subprojects
|
||||
+# which make up this project. One should order the list such that any
|
||||
+# given subproject only depends on subprojects listed before it. The
|
||||
+# subproject names can also include an * suffix which indicates that
|
||||
+# this is an optional subproject. Optional subprojects are only included
|
||||
+# as part of the project build if enabled on the configure command line
|
||||
+# with a --enable-<subproject> flag. The user can also specify that all
|
||||
+# optional subprojects should be included in the build with the
|
||||
+# --enable-optional-subprojects flag.
|
||||
+#
|
||||
+# Subproject names can also include a ** suffix which indicates that it
|
||||
+# is an optional subproject, but there is a group with the same name.
|
||||
+# Thus the --enable-<sproj> command line option will enable not just the
|
||||
+# subproject sproj but all of the subprojects which are in the group.
|
||||
+# There is no error checking to make sure that if you use the ** suffix
|
||||
+# you actually define a group so be careful.
|
||||
+#
|
||||
+# Both required and optional subprojects should have a 'subproject.ac'
|
||||
+# file. The script's filename should be the abbreivated subproject name
|
||||
+# (assuming the subproject name is sproj then we would use 'sproj.ac')
|
||||
+# The MCPPBS_SUBPROJECTS macro includes the 'subproject.ac' files for
|
||||
+# enabled subprojects. Whitespace and newlines are allowed within the
|
||||
+# list.
|
||||
+#
|
||||
+# Author : Christopher Batten
|
||||
+# Date : September 10, 2008
|
||||
+
|
||||
+AC_DEFUN([MCPPBS_SUBPROJECTS],
|
||||
+[
|
||||
+
|
||||
+ # Add command line argument to enable all optional subprojects
|
||||
+
|
||||
+ AC_ARG_ENABLE(optional-subprojects,
|
||||
+ AS_HELP_STRING([--enable-optional-subprojects],
|
||||
+ [Enable all optional subprojects]))
|
||||
+
|
||||
+ # Loop through the subprojects given in the macro argument
|
||||
+
|
||||
+ m4_foreach([MCPPBS_SPROJ],[$1],
|
||||
+ [
|
||||
+
|
||||
+ # Determine if this is a required or an optional subproject
|
||||
+
|
||||
+ m4_define([MCPPBS_IS_REQ],
|
||||
+ m4_bmatch(MCPPBS_SPROJ,[\*+],[false],[true]))
|
||||
+
|
||||
+ # Determine if there is a group with the same name
|
||||
+
|
||||
+ m4_define([MCPPBS_IS_GROUP],
|
||||
+ m4_bmatch(MCPPBS_SPROJ,[\*\*],[true],[false]))
|
||||
+
|
||||
+ # Create variations of the subproject name suitable for use as a CPP
|
||||
+ # enabled define, a shell enabled variable, and a shell function
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_NORM],
|
||||
+ m4_normalize(m4_bpatsubsts(MCPPBS_SPROJ,[*],[])))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_DEFINE],
|
||||
+ m4_toupper(m4_bpatsubst(MCPPBS_SPROJ_NORM[]_ENABLED,[-],[_])))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_FUNC],
|
||||
+ m4_bpatsubst(_mpbp_[]MCPPBS_SPROJ_NORM[]_configure,[-],[_]))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_UNDERSCORES],
|
||||
+ m4_bpatsubsts(MCPPBS_SPROJ,[-],[_]))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_SHVAR],
|
||||
+ m4_bpatsubst(enable_[]MCPPBS_SPROJ_NORM[]_sproj,[-],[_]))
|
||||
+
|
||||
+ # Add subproject to our running list
|
||||
+
|
||||
+ subprojects="$subprojects MCPPBS_SPROJ_NORM"
|
||||
+
|
||||
+ # Process the subproject appropriately. If enabled add it to the
|
||||
+ # $enabled_subprojects running shell variable, set a
|
||||
+ # SUBPROJECT_ENABLED C define, and include the appropriate
|
||||
+ # 'subproject.ac'.
|
||||
+
|
||||
+ m4_if(MCPPBS_IS_REQ,[true],
|
||||
+ [
|
||||
+ AC_MSG_NOTICE([configuring default subproject : MCPPBS_SPROJ_NORM])
|
||||
+ AC_CONFIG_FILES(MCPPBS_SPROJ_NORM[].mk:MCPPBS_SPROJ_NORM[]/MCPPBS_SPROJ_NORM[].mk.in)
|
||||
+ MCPPBS_SPROJ_SHVAR="yes"
|
||||
+ subprojects_enabled="$subprojects_enabled MCPPBS_SPROJ_NORM"
|
||||
+ AC_DEFINE(MCPPBS_SPROJ_DEFINE,,
|
||||
+ [Define if subproject MCPPBS_SPROJ_NORM is enabled])
|
||||
+ m4_include(MCPPBS_SPROJ_NORM[]/MCPPBS_SPROJ_NORM[].ac)
|
||||
+ ],[
|
||||
+
|
||||
+ # For optional subprojects we capture the 'subproject.ac' as a
|
||||
+ # shell function so that in the MCPPBS_GROUP macro we can just
|
||||
+ # call this shell function instead of reading in 'subproject.ac'
|
||||
+ # again.
|
||||
+
|
||||
+ MCPPBS_SPROJ_FUNC ()
|
||||
+ {
|
||||
+ AC_MSG_NOTICE([configuring optional subproject : MCPPBS_SPROJ_NORM])
|
||||
+ AC_CONFIG_FILES(MCPPBS_SPROJ_NORM[].mk:MCPPBS_SPROJ_NORM[]/MCPPBS_SPROJ_NORM[].mk.in)
|
||||
+ MCPPBS_SPROJ_SHVAR="yes"
|
||||
+ subprojects_enabled="$subprojects_enabled MCPPBS_SPROJ_NORM"
|
||||
+ AC_DEFINE(MCPPBS_SPROJ_DEFINE,,
|
||||
+ [Define if subproject MCPPBS_SPROJ_NORM is enabled])
|
||||
+ m4_include(MCPPBS_SPROJ_NORM[]/MCPPBS_SPROJ_NORM[].ac)
|
||||
+ };
|
||||
+
|
||||
+ # Optional subprojects add --enable-subproject command line
|
||||
+ # options, _if_ the subproject name is not also a group name.
|
||||
+
|
||||
+ m4_if(MCPPBS_IS_GROUP,[false],
|
||||
+ [
|
||||
+ AC_ARG_ENABLE(MCPPBS_SPROJ_NORM,
|
||||
+ AS_HELP_STRING(--enable-MCPPBS_SPROJ_NORM,
|
||||
+ [Subproject MCPPBS_SPROJ_NORM]),
|
||||
+ [MCPPBS_SPROJ_SHVAR="yes"],[MCPPBS_SPROJ_SHVAR="no"])
|
||||
+
|
||||
+ AS_IF([test "$MCPPBS_SPROJ_SHVAR" = "yes"],
|
||||
+ [
|
||||
+ eval "MCPPBS_SPROJ_FUNC"
|
||||
+ ],[
|
||||
+ AC_MSG_NOTICE([processing optional subproject : MCPPBS_SPROJ_NORM])
|
||||
+ ])
|
||||
+
|
||||
+ ],[
|
||||
+
|
||||
+ # If the subproject name is also a group name then we need to
|
||||
+ # make sure that we set the shell variable for that subproject to
|
||||
+ # no so that the group code knows we haven't run it yet.
|
||||
+
|
||||
+ AC_MSG_NOTICE([processing optional subproject : MCPPBS_SPROJ_NORM])
|
||||
+ MCPPBS_SPROJ_SHVAR="no"
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+ # Always execute the subproject configure code if we are enabling
|
||||
+ # all subprojects.
|
||||
+
|
||||
+ AS_IF([ test "$enable_optional_subprojects" = "yes" \
|
||||
+ && test "$MCPPBS_SPROJ_SHVAR" = "no" ],
|
||||
+ [
|
||||
+ eval "MCPPBS_SPROJ_FUNC"
|
||||
+ ])
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+ # Output make variables
|
||||
+
|
||||
+ AC_SUBST([subprojects])
|
||||
+ AC_SUBST([subprojects_enabled])
|
||||
+
|
||||
+])
|
||||
+
|
||||
+#-------------------------------------------------------------------------
|
||||
+# MCPPBS_GROUP( [group-name], [ sproj1, sproj2, ... ] )
|
||||
+#-------------------------------------------------------------------------
|
||||
+# This macro creates a subproject group with the given group-name. When
|
||||
+# a user specifies --enable-<group-name> the listed subprojects will be
|
||||
+# enabled. Groups can have the same name as a subproject and in that
|
||||
+# case whenever a user specifies --enable-<subproject> the subprojects
|
||||
+# listed in the corresponding group will also be enabled. Groups are
|
||||
+# useful for specifying related subprojects which are usually enabled
|
||||
+# together, as well as for specifying that a specific optional
|
||||
+# subproject has dependencies on other optional subprojects.
|
||||
+#
|
||||
+# Author : Christopher Batten
|
||||
+# Date : September 10, 2008
|
||||
+
|
||||
+AC_DEFUN([MCPPBS_GROUP],
|
||||
+[
|
||||
+
|
||||
+ m4_define([MCPPBS_GROUP_NORM],
|
||||
+ m4_normalize([$1]))
|
||||
+
|
||||
+ m4_define([MCPPBS_GROUP_SHVAR],
|
||||
+ m4_bpatsubst(enable_[]MCPPBS_GROUP_NORM[]_group,[-],[_]))
|
||||
+
|
||||
+ AC_ARG_ENABLE(MCPPBS_GROUP_NORM,
|
||||
+ AS_HELP_STRING(--enable-MCPPBS_GROUP_NORM,
|
||||
+ [Group MCPPBS_GROUP_NORM: $2]),
|
||||
+ [MCPPBS_GROUP_SHVAR="yes"],[MCPPBS_GROUP_SHVAR="no"])
|
||||
+
|
||||
+ AS_IF([test "$MCPPBS_GROUP_SHVAR" = "yes" ],
|
||||
+ [
|
||||
+ AC_MSG_NOTICE([configuring optional group : MCPPBS_GROUP_NORM])
|
||||
+ ])
|
||||
+
|
||||
+ m4_foreach([MCPPBS_SPROJ],[$2],
|
||||
+ [
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_NORM],
|
||||
+ m4_normalize(MCPPBS_SPROJ))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_SHVAR],
|
||||
+ m4_bpatsubst(enable_[]MCPPBS_SPROJ_NORM[]_sproj,[-],[_]))
|
||||
+
|
||||
+ m4_define([MCPPBS_SPROJ_FUNC],
|
||||
+ m4_bpatsubst(_mpbp_[]MCPPBS_SPROJ_NORM[]_configure,[-],[_]))
|
||||
+
|
||||
+ AS_IF([ test "$MCPPBS_GROUP_SHVAR" = "yes" \
|
||||
+ && test "$MCPPBS_SPROJ_SHVAR" = "no" ],
|
||||
+ [
|
||||
+ eval "MCPPBS_SPROJ_FUNC"
|
||||
+ ])
|
||||
+
|
||||
+ ])
|
||||
+
|
||||
+])
|
||||
--
|
||||
2.16.2
|
||||
|
||||
12
recipes-devtools/riscv-tools/files/fesvr-makefile.patch
Normal file
12
recipes-devtools/riscv-tools/files/fesvr-makefile.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -rupN git/Makefile.in git-new/Makefile.in
|
||||
--- git/Makefile.in 2015-09-17 16:31:32.061178794 -0700
|
||||
+++ git-new/Makefile.in 2015-09-17 16:42:54.166647463 -0700
|
||||
@@ -99,7 +99,7 @@ comma := ,
|
||||
LD := $(CXX)
|
||||
LDFLAGS := @LDFLAGS@
|
||||
LIBS := @LIBS@
|
||||
-LINK := $(LD) -L. $(LDFLAGS) -Wl,-rpath,$(install_libs_dir) $(patsubst -L%,-Wl$(comma)-rpath$(comma)%,$(filter -L%,$(LDFLAGS)))
|
||||
+LINK := $(LD) -L. $(LDFLAGS)
|
||||
|
||||
# Library creation
|
||||
|
||||
12
recipes-devtools/riscv-tools/files/spike-makefile.patch
Normal file
12
recipes-devtools/riscv-tools/files/spike-makefile.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff -rupN git/Makefile.in git-new/Makefile.in
|
||||
--- git/Makefile.in 2015-09-17 01:12:32.219540348 -0700
|
||||
+++ git-new/Makefile.in 2015-09-26 18:55:54.162112314 -0700
|
||||
@@ -99,7 +99,7 @@ comma := ,
|
||||
LD := $(CXX)
|
||||
LDFLAGS := @LDFLAGS@
|
||||
LIBS := @LIBS@
|
||||
-LINK := $(LD) -L. $(LDFLAGS) -Wl,-rpath,$(install_libs_dir) $(patsubst -L%,-Wl$(comma)-rpath$(comma)%,$(filter -L%,$(LDFLAGS)))
|
||||
+LINK := $(LD) -L. $(LDFLAGS)
|
||||
|
||||
# Library creation
|
||||
|
||||
26
recipes-devtools/riscv-tools/riscv-fesvr.bb
Normal file
26
recipes-devtools/riscv-tools/riscv-fesvr.bb
Normal file
@@ -0,0 +1,26 @@
|
||||
SUMMARY = "RISC-V Front-end Server"
|
||||
DESCRIPTION = "RISC-V Front-end Server"
|
||||
LICENSE = "GPLv2+"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
SRCREV = "68c12d06ebbdfe20856b886570822fe66804fd26"
|
||||
SRC_URI = "git://github.com/riscv/riscv-fesvr.git \
|
||||
file://fesvr-makefile.patch"
|
||||
|
||||
inherit autotools gettext cross-canadian
|
||||
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_configure_prepend () {
|
||||
if [ ! -e ${S}/acinclude.m4 ]; then
|
||||
cp ${S}/aclocal.m4 ${S}/acinclude.m4
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_append () {
|
||||
# Make install doesn't properly install these
|
||||
oe_libinstall -so libfesvr ${D}${libdir}
|
||||
}
|
||||
49
recipes-devtools/riscv-tools/riscv-pk.bb
Normal file
49
recipes-devtools/riscv-tools/riscv-pk.bb
Normal file
@@ -0,0 +1,49 @@
|
||||
SUMMARY = "RISC-V Proxy Kernel"
|
||||
DESCRIPTION = "RISC-V Proxy Kernel"
|
||||
LICENSE = "GPLv2+"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
SRCREV = "2bbd8e1a1bccae13ec87882baf423abfc6ef76fd"
|
||||
SRC_URI = "git://github.com/riscv/riscv-pk.git \
|
||||
file://0001-add-acinclude.m4.patch \
|
||||
"
|
||||
|
||||
LDFLAGS_append = " -Wl,--build-id=none"
|
||||
|
||||
inherit autotools
|
||||
|
||||
EXTRA_OECONF += "--enable-logo --with-payload=${DEPLOY_DIR_IMAGE}/${RISCV_BBL_PAYLOAD}"
|
||||
|
||||
INHIBIT_PACKAGE_STRIP = "1"
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
DEPENDS = "virtual/kernel"
|
||||
|
||||
do_install_prepend () {
|
||||
install -d ${D}${datadir}/riscv-pk
|
||||
install -m 755 ${WORKDIR}/build/bbl ${D}${datadir}/riscv-pk
|
||||
}
|
||||
|
||||
do_install_append() {
|
||||
rm -rf ${D}${exec_prefix}/riscv64-unknown-elf
|
||||
}
|
||||
|
||||
do_install_append_freedom-u540() {
|
||||
${OBJCOPY} -S -O binary --change-addresses -0x80000000 \
|
||||
${WORKDIR}/build/bbl ${WORKDIR}/build/bbl.bin
|
||||
}
|
||||
|
||||
do_deploy () {
|
||||
install -d ${DEPLOY_DIR_IMAGE}
|
||||
install -m 755 ${WORKDIR}/build/bbl ${DEPLOY_DIR_IMAGE}/bbl
|
||||
}
|
||||
|
||||
do_deploy_append_freedom-u540() {
|
||||
install -m 755 ${WORKDIR}/build/bbl.bin ${DEPLOY_DIR_IMAGE}/bbl.bin
|
||||
}
|
||||
addtask deploy before do_build after do_install
|
||||
|
||||
SECURITY_CFLAGS = "${SECURITY_NOPIE_CFLAGS}"
|
||||
SECURITY_LDFLAGS = ""
|
||||
24
recipes-devtools/riscv-tools/riscv-spike.bb
Normal file
24
recipes-devtools/riscv-tools/riscv-spike.bb
Normal file
@@ -0,0 +1,24 @@
|
||||
SUMMARY = "RISC-V Spike ISA Simulator"
|
||||
DESCRIPTION = "RISC-V Spike ISA Simulator"
|
||||
LICENSE = "GPLv2+"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
|
||||
|
||||
SRCREV = "9d1e10a36e771bf8cfbf515e07e856e021c1007a"
|
||||
SRC_URI = "git://github.com/riscv/riscv-isa-sim.git \
|
||||
file://spike-makefile.patch"
|
||||
|
||||
DEPENDS = "riscv-fesvr dtc-native"
|
||||
RDEPENDS_nativesdk-riscv-spike = "nativesdk-riscv-fesvr"
|
||||
|
||||
inherit autotools cross-canadian
|
||||
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
do_configure_prepend () {
|
||||
touch ${S}/softfloat/softfloat.ac
|
||||
if [ ! -e ${S}/acinclude.m4 ]; then
|
||||
cp ${S}/aclocal.m4 ${S}/acinclude.m4
|
||||
fi
|
||||
}
|
||||
BBCLASSEXTEND = "native nativesdk"
|
||||
3
recipes-devtools/rpm/rpm_%.bbappend
Normal file
3
recipes-devtools/rpm/rpm_%.bbappend
Normal file
@@ -0,0 +1,3 @@
|
||||
DEPENDS_append_class-target = " beecrypt"
|
||||
EXTRA_OECONF_append_class-target = " --with-crypto=beecrypt"
|
||||
|
||||
Reference in New Issue
Block a user