From: Richard W.M. Jones Date: Fri, 12 Aug 2016 19:34:45 +0000 (+0100) Subject: Repo has MOVED to https://github.com/rwmjones/fedora-riscv X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=41d18f7eca349700f979c1fad944d5bd8d9fc551;p=fedora-riscv.git Repo has MOVED to https://github.com/rwmjones/fedora-riscv --- diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9594297..0000000 --- a/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -*~ -*.tar.gz -*.tar.lz -*.tar.xz -*.tgz -stamp-* - -.gdb_history - -/stage1-riscv-qemu/riscv-qemu.spec -/stage1-riscv-fesvr/riscv-fesvr.spec -/stage1-riscv-isa-sim/riscv-isa-sim.spec -/stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec -/stage2-riscv-pk/riscv-pk.spec -/stage3-kernel/linux-* -/stage3-chroot-original/ -/stage3-chroot/ -/stage3-disk.img -/stage3-disk.img.xz - -/bash-4.3/ -/beecrypt-4.2.1/ -/bzip2-1.0.6/ -/coreutils-8.25/ -/diffutils-3.4/ -/file-5.28/ -/findutils-4.6.0/ -/gawk-4.1.3/ -/gettext-0.19/ -/gmp-6.1.1/ -/grep-2.25/ -/gzip-1.8/ -/hostname/ -/less-481/ -/lua-5.3.3/ -/make-4.1/ -/mpc-1.0.3/ -/mpfr-3.1.4/ -/nano-2.6.2/ -/ncurses-6.0-20160730/ -/patch-2.7.5/ -/popt-1.16/ -/readline-6.3/ -/riscv-binutils-gdb-riscv-binutils-2.26/ -/riscv-gcc-riscv-gcc-6.1.0/ -/riscv-strace-f320e1897832fd07a62e18ed288e75d8e79f4c5b/ -/rpm-9571218/ -/sed-4.2/ -/tar-1.29/ -/util-linux-2.28/ -/vim74/ -/xz-5.2.2/ -/zlib-1.2.8/ diff --git a/0001-HACKS-TO-GET-GCC-TO-COMPILE.patch b/0001-HACKS-TO-GET-GCC-TO-COMPILE.patch deleted file mode 100644 index 60addba..0000000 --- a/0001-HACKS-TO-GET-GCC-TO-COMPILE.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 24fdf86d8b3839e261760db7603168abc337ff1b Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 10 Aug 2016 21:50:34 +0100 -Subject: [PATCH] HACKS TO GET GCC TO COMPILE - ---- - Makefile.in | 8 +++----- - libgcc/unwind-dw2.c | 14 +++++++------- - 2 files changed, 10 insertions(+), 12 deletions(-) - -diff --git a/Makefile.in b/Makefile.in -index 1522e39..d328543 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -38500,7 +38500,7 @@ configure-target-libgcc: stage_current - @if target-libgcc - maybe-configure-target-libgcc: configure-target-libgcc - configure-target-libgcc: -- @r=`${PWD_COMMAND}`; export r; \ -+ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ - echo "Checking multilib configuration for libgcc..."; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc; \ -@@ -38517,7 +38517,6 @@ configure-target-libgcc: - fi; \ - test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \ - $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc; \ -- $(NORMAL_TARGET_EXPORTS) \ - echo Configuring in $(TARGET_SUBDIR)/libgcc; \ - cd "$(TARGET_SUBDIR)/libgcc" || exit 1; \ - case $(srcdir) in \ -@@ -38819,11 +38818,10 @@ all-target-libgcc: stage_current - TARGET-target-libgcc=all - maybe-all-target-libgcc: all-target-libgcc - all-target-libgcc: configure-target-libgcc -- @r=`${PWD_COMMAND}`; export r; \ -+ r=`${PWD_COMMAND}`; export r; \ - s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ -- $(NORMAL_TARGET_EXPORTS) \ - (cd $(TARGET_SUBDIR)/libgcc && \ -- $(MAKE) $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) \ -+ $(MAKE) \ - $(TARGET-target-libgcc)) - @endif target-libgcc - -diff --git a/libgcc/unwind-dw2.c b/libgcc/unwind-dw2.c -index 1fb6026..4e6213c 100644 ---- a/libgcc/unwind-dw2.c -+++ b/libgcc/unwind-dw2.c -@@ -37,9 +37,9 @@ - #include "gthr.h" - #include "unwind-dw2.h" - --#ifdef HAVE_SYS_SDT_H --#include --#endif -+//#ifdef HAVE_SYS_SDT_H -+//#include -+//#endif - - #ifndef __USING_SJLJ_EXCEPTIONS__ - -@@ -1601,11 +1601,11 @@ _Unwind_DebugHook (void *cfa __attribute__ ((__unused__)), - { - /* We only want to use stap probes starting with v3. Earlier - versions added too much startup cost. */ --#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3 -- STAP_PROBE2 (libgcc, unwind, cfa, handler); --#else -+//#if defined (HAVE_SYS_SDT_H) && defined (STAP_PROBE2) && _SDT_NOTE_TYPE >= 3 -+// STAP_PROBE2 (libgcc, unwind, cfa, handler); -+//#else - asm (""); --#endif -+//#endif - } - - /* Install TARGET into CURRENT so that we can return to it. This is a --- -2.7.4 - diff --git a/0001-RISCV-64-bit-riscv64-support.patch b/0001-RISCV-64-bit-riscv64-support.patch deleted file mode 100644 index b00eaa8..0000000 --- a/0001-RISCV-64-bit-riscv64-support.patch +++ /dev/null @@ -1,94 +0,0 @@ -From abe2459b56723a1ee1366056be5e8546a1a8facb Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 9 Aug 2016 18:25:24 +0100 -Subject: [PATCH 1/4] RISCV 64-bit (riscv64) support. - -Based on Mark Salter's aarch64 support patch (commit 8e1ca16c58). - -Signed-off-by: Richard W.M. Jones ---- - installplatform | 6 ++++++ - rpmrc.in | 15 +++++++++++++++ - 2 files changed, 21 insertions(+) - -diff --git a/installplatform b/installplatform -index ebade42..12339fc 100755 ---- a/installplatform -+++ b/installplatform -@@ -174,6 +174,12 @@ for ARCH in noarch `grep ^arch_canon $RPMRC | cut -d: -f2`; do - CANONARCH=m68k - CANONCOLOR=0 - ;; -+ riscv64) -+ ISANAME=riscv -+ ISABITS=64 -+ CANONARCH=riscv64 -+ CANONCOLOR=3 -+ ;; - noarch) - CANONARCH=noarch - CANONCOLOR=0 -diff --git a/rpmrc.in b/rpmrc.in -index e888b0f..830b9ed 100644 ---- a/rpmrc.in -+++ b/rpmrc.in -@@ -99,6 +99,8 @@ optflags: sh4a -O2 -g -mieee - - optflags: aarch64 -O2 -g - -+optflags: riscv64 -O2 -g -+ - ############################################################# - # Architecture colors - -@@ -147,6 +149,8 @@ archcolor: sh4 1 - - archcolor: aarch64 2 - -+archcolor: riscv64 2 -+ - ############################################################# - # Canonical arch names and numbers - -@@ -243,6 +247,8 @@ arch_canon: mipsr6el: mipsr6el 20 - arch_canon: mips64r6: mips64r6 21 - arch_canon: mips64r6el: mips64r6el 21 - -+arch_canon: riscv: riscv64 22 -+ - ############################################################# - # Canonical OS names and numbers - -@@ -368,6 +374,9 @@ buildarchtranslate: sh4a: sh4 - - buildarchtranslate: aarch64: aarch64 - -+buildarchtranslate: riscv: riscv64 -+buildarchtranslate: riscv64: riscv64 -+ - ############################################################# - # Architecture compatibility - -@@ -473,6 +482,9 @@ arch_compat: sh4a: sh4 - - arch_compat: aarch64: noarch - -+arch_compat: riscv: noarch -+arch_compat: riscv64: noarch -+ - os_compat: IRIX64: IRIX - os_compat: solaris2.7: solaris2.3 solaris2.4 solaris2.5 solaris2.6 - os_compat: solaris2.6: solaris2.3 solaris2.4 solaris2.5 -@@ -506,6 +518,9 @@ buildarch_compat: ia64: noarch - - buildarch_compat: aarch64: noarch - -+buildarch_compat: riscv: noarch -+buildarch_compat: riscv64: noarch -+ - buildarch_compat: athlon: i686 - buildarch_compat: geode: i586 - buildarch_compat: pentium4: pentium3 --- -2.7.4 - diff --git a/0001-Update-riscv_regs-for-ptrace.h-from-Linux-4.1.x.patch b/0001-Update-riscv_regs-for-ptrace.h-from-Linux-4.1.x.patch deleted file mode 100644 index 6a8a671..0000000 --- a/0001-Update-riscv_regs-for-ptrace.h-from-Linux-4.1.x.patch +++ /dev/null @@ -1,59 +0,0 @@ -From a0532c147d0f725bb4dd84616243ce014426eaa0 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 9 Aug 2016 22:14:43 +0100 -Subject: [PATCH] Update riscv_regs for ptrace.h from Linux 4.1.x. - ---- - syscall.c | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -diff --git a/syscall.c b/syscall.c -index 0b7ba64..88ed9ba 100644 ---- a/syscall.c -+++ b/syscall.c -@@ -1571,7 +1571,7 @@ get_scno(struct tcb *tcp) - # elif defined(ARC) - scno = arc_regs.scratch.r8; - #elif defined(RISCV) -- scno = riscv_regs.a7; -+ scno = riscv_regs.a[7]; - #endif - - tcp->scno = scno; -@@ -1967,12 +1967,12 @@ get_syscall_args(struct tcb *tcp) - tcp->u_arg[i] = *arc_args--; - - #elif defined(RISCV) -- tcp->u_arg[0] = riscv_regs.a0; -- tcp->u_arg[1] = riscv_regs.a1; -- tcp->u_arg[2] = riscv_regs.a2; -- tcp->u_arg[3] = riscv_regs.a3; -- tcp->u_arg[4] = riscv_regs.a4; -- tcp->u_arg[5] = riscv_regs.a5; -+ tcp->u_arg[0] = riscv_regs.a[0]; -+ tcp->u_arg[1] = riscv_regs.a[1]; -+ tcp->u_arg[2] = riscv_regs.a[2]; -+ tcp->u_arg[3] = riscv_regs.a[3]; -+ tcp->u_arg[4] = riscv_regs.a[4]; -+ tcp->u_arg[5] = riscv_regs.a[5]; - #else /* Other architecture (32bits specific) */ - for (i = 0; i < nargs; ++i) - if (upeek(tcp->pid, i*4, &tcp->u_arg[i]) < 0) -@@ -2496,11 +2496,11 @@ get_error(struct tcb *tcp) - tcp->u_rval = arc_regs.scratch.r0; - } - #elif defined(RISCV) -- if (check_errno && is_negated_errno(riscv_regs.a0)) { -+ if (check_errno && is_negated_errno(riscv_regs.a[0])) { - tcp->u_rval = -1; -- u_error = -riscv_regs.a0; -+ u_error = -riscv_regs.a[0]; - } else { -- tcp->u_rval = riscv_regs.a0; -+ tcp->u_rval = riscv_regs.a[0]; - } - #endif - tcp->u_error = u_error; --- -2.7.4 - diff --git a/0002-rpmrc-Convert-uname.machine-riscv-to-riscv32-riscv64.patch b/0002-rpmrc-Convert-uname.machine-riscv-to-riscv32-riscv64.patch deleted file mode 100644 index 0c89ede..0000000 --- a/0002-rpmrc-Convert-uname.machine-riscv-to-riscv32-riscv64.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 331b0ac34a9767d1f0147daf3fd22b64e2e4e3af Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Thu, 11 Aug 2016 11:38:18 +0100 -Subject: [PATCH 2/4] rpmrc: Convert uname.machine == "riscv" to - "riscv32"/"riscv64"/"riscv128". - -On RISC-V, the kernel returns uname.machine == "riscv" (for all bit -sizes). GNU is using "riscv64". Convert the kernel uname machine -type to a more suitable value. - -This conversion is supposed to be done by the arch_canon table. -However the arch_canon table is not populated until after the -defaultMachine function is called for the first time, making it a bit -useless. In any case, arch_canon cannot take into account the bit -size of the architecture, but the C code here can. - -Signed-off-by: Richard W.M. Jones ---- - lib/rpmrc.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/lib/rpmrc.c b/lib/rpmrc.c -index f2e0f48..eb136d8 100644 ---- a/lib/rpmrc.c -+++ b/lib/rpmrc.c -@@ -1216,6 +1216,17 @@ static void defaultMachine(rpmrcCtx ctx, const char ** arch, const char ** os) - } - # endif /* arm*-linux */ - -+# if defined(__linux__) && defined(__riscv__) -+ if (rstreq(un.machine, "riscv")) { -+ if (sizeof(long) == 4) -+ strcpy(un.machine, "riscv32"); -+ else if (sizeof(long) == 8) -+ strcpy(un.machine, "riscv64"); -+ else if (sizeof(long) == 16) -+ strcpy(un.machine, "riscv128"); -+ } -+# endif /* riscv */ -+ - # if defined(__GNUC__) && defined(__alpha__) - { - unsigned long amask, implver; --- -2.7.4 - diff --git a/0003-build-fgetc-returns-int-not-char.patch b/0003-build-fgetc-returns-int-not-char.patch deleted file mode 100644 index ebcc4cf..0000000 --- a/0003-build-fgetc-returns-int-not-char.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 0c44e5cdbdc525cc1bf1063b6c561efa23d06b0d Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Wed, 10 Aug 2016 15:01:31 +0100 -Subject: [PATCH 3/4] build: fgetc returns int, not char. - -Returning the value into a char is a mistake on all platforms, but is -particularly bad on RISC-V. On that platform (like ARM) char is -unsigned. Therefore EOF (-1) is returned as 255, and the subsequent -test 'c == EOF' ('255 == -1') fails causing an infinite loop. - -Signed-off-by: Richard W.M. Jones ---- - build/parseSpec.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/build/parseSpec.c b/build/parseSpec.c -index 85b0ba3..28f00bc 100644 ---- a/build/parseSpec.c -+++ b/build/parseSpec.c -@@ -323,7 +323,7 @@ retry: - - /* Make sure we have something in the read buffer */ - if (!(ofi->readPtr && *(ofi->readPtr))) { -- char c; -+ int c; - int i = 0; - - while((c = fgetc(ofi->fp)) != EOF) { --- -2.7.4 - diff --git a/0004-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch b/0004-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch deleted file mode 100644 index e7e7553..0000000 --- a/0004-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 7a164577210693c1714c38398fe87270f62bb8c1 Mon Sep 17 00:00:00 2001 -From: "Richard W.M. Jones" -Date: Tue, 9 Aug 2016 18:21:57 +0100 -Subject: [PATCH 4/4] HACKS TO GET RPM TO CROSS-COMPILE - ---- - configure.ac | 28 ++++++++++++++++------------ - 1 file changed, 16 insertions(+), 12 deletions(-) - -diff --git a/configure.ac b/configure.ac -index e2d5ec3..3f94742 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -309,6 +309,8 @@ AC_SUBST(WITH_NSS_LIB) - WITH_MAGIC_INCLUDE= - WITH_MAGIC_LIB= - -+old_LIBS="$LIBS" -+LIBS="-lz" - AC_CHECK_HEADER([magic.h], [ - AC_CHECK_LIB(magic, magic_open, [ - WITH_MAGIC_INCLUDE= -@@ -319,6 +321,7 @@ AC_CHECK_HEADER([magic.h], [ - ],[ - AC_MSG_ERROR([missing required header magic.h]) - ]) -+LIBS="$old_LIBS" - - AC_SUBST(WITH_MAGIC_INCLUDE) - AC_SUBST(WITH_MAGIC_LIB) -@@ -369,18 +372,19 @@ AM_CONDITIONAL(WITH_ARCHIVE,[test "$with_archive" = yes]) - - #================= - # Check for elfutils libdw library with dwelf_elf_gnu_build_id. --AS_IF([test "$WITH_LIBELF" = yes],[ -- AC_CHECK_HEADERS([elfutils/libdwelf.h],[ -- AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [ -- AC_DEFINE(HAVE_LIBDW, 1, -- [Define to 1 if you have elfutils libdw library]) -- WITH_LIBDW_LIB="-ldw" -- WITH_LIBDW=yes -- ]) -- ]) -- AC_SUBST(WITH_LIBDW_LIB) -- AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes]) --]) -+dnl AS_IF([test "$WITH_LIBELF" = yes],[ -+dnl AC_CHECK_HEADERS([elfutils/libdwelf.h],[ -+dnl AC_CHECK_LIB(dw, dwelf_elf_gnu_build_id, [ -+dnl AC_DEFINE(HAVE_LIBDW, 1, -+dnl [Define to 1 if you have elfutils libdw library]) -+dnl WITH_LIBDW_LIB="-ldw" -+dnl WITH_LIBDW=yes -+dnl ]) -+dnl ]) -+dnl AC_SUBST(WITH_LIBDW_LIB) -+dnl AM_CONDITIONAL(LIBDW,[test "$WITH_LIBDW" = yes]) -+dnl ]) -+AM_CONDITIONAL(LIBDW,[false]) - - #================= - # Process --with/without-external-db --- -2.7.4 - diff --git a/Makefile b/Makefile deleted file mode 100644 index cdc9829..0000000 --- a/Makefile +++ /dev/null @@ -1,1064 +0,0 @@ -# Refer to the README file to understand how Fedora on RISC-V is -# bootstrapped. - -# Absolute path to the current directory. -ROOT := $(shell pwd) - -# Note these are chosen very specifically to ensure the different -# versions work together. Don't blindly update to the latest -# versions. See also: -# https://github.com/riscv/riscv-pk/issues/18#issuecomment-206115996 -RISCV_QEMU_COMMIT = 94f5eb73091fb4fe272db3e943f173ecc0f78ffd -RISCV_QEMU_SHORTCOMMIT = 94f5eb73 -RISCV_FESVR_COMMIT = 0f34d7ad311f78455a674224225f5b3056efba1d -RISCV_FESVR_SHORTCOMMIT = 0f34d7ad -RISCV_ISA_SIM_COMMIT = 3bfc00ef2a1b1f0b0472a39a866261b00f67027e -RISCV_ISA_SIM_SHORTCOMMIT = 3bfc00ef -RISCV_GNU_TOOLCHAIN_COMMIT = 728afcddcb0526a0f6560c4032da82805f054d58 -RISCV_GNU_TOOLCHAIN_SHORTCOMMIT = 728afcdd -RISCV_PK_COMMIT = 85ae17aa149b9ea114bdd70cc30ea7e73813fb48 -RISCV_PK_SHORTCOMMIT = 85ae17aa - -# For the correct versions, see -# riscv-gnu-toolchain/Makefile.in *_version variables -BINUTILS_VERSION = 2.25.1 -GLIBC_VERSION = 2.22 -GCC_VERSION = 5.3.0 -NEWLIB_VERSION = 2.2.0 - -# See linux-4.1.y-riscv branch of -# https://github.com/riscv/riscv-linux -KERNEL_VERSION = 4.1.26 - -# A local copy of Linux git repo so you don't have to keep downloading -# git commits (optional). -LOCAL_LINUX_GIT_COPY = $(HOME)/d/linux - -# The root packages (plus their dependencies) that we want to in the -# stage 3 chroot. This must include all the cross-compiled packages -# below, and may also include any noarch package we like. -STAGE3_PACKAGES = iso-codes \ -ncurses-devel readline-devel bash coreutils gmp-devel \ -mpfr-devel libmpc-devel binutils gcc gcc-c++ util-linux tar \ -gzip zlib-devel file-devel popt-devel beecrypt-devel \ -rpm rpm-build rpm-devel libdb-utils libdb-devel nano \ -grep less strace bzip2-devel make diffutils findutils \ -sed patch hostname gettext-devel lua-devel xz-devel gawk \ -vim - -# Versions of cross-compiled packages. -NCURSES_VERSION = 6.0-20160730 -READLINE_VERSION = 6.3 -BASH_VERSION = 4.3 -COREUTILS_VERSION = 8.25 -GMP_VERSION = 6.1.1 -MPFR_VERSION = 3.1.4 -MPC_VERSION = 1.0.3 -BINUTILS_X_VERSION = 2.26 -GCC_X_VERSION = 6.1.0 -UTIL_LINUX_VERSION = 2.28 -TAR_VERSION = 1.29 -GZIP_VERSION = 1.8 -ZLIB_VERSION = 1.2.8 -# Needs to match the version of 'file' installed (on host), otherwise: -# "Cannot use the installed version of file (xx) to cross-compile file yy" -# Also note that 5.25 is definitely broken (segfaults in libmagic:magic_close). -FILE_VERSION = 5.28 -POPT_VERSION = 1.16 -BEECRYPT_VERSION = 4.2.1 -RPM_COMMIT = 95712183458748ea6cafebac1bdd5daa097d9bee -RPM_SHORT_COMMIT = 9571218 -BDB_VERSION = 4.5.20 -NANO_VERSION = 2.6.2 -GREP_VERSION = 2.25 -LESS_VERSION = 481 -STRACE_COMMIT = f320e1897832fd07a62e18ed288e75d8e79f4c5b -STRACE_SHORT_COMMIT = f320e189 -BZIP2_VERSION = 1.0.6 -MAKE_VERSION = 4.1 -DIFFUTILS_VERSION = 3.4 -FINDUTILS_VERSION = 4.6.0 -SED_VERSION = 4.2 -PATCH_VERSION = 2.7.5 -HOSTNAME_VERSION = 3.15 -GETTEXT_VERSION = 0.19 -LUA_VERSION = 5.3.3 -XZ_VERSION = 5.2.2 -GAWK_VERSION = 4.1.3 -VIM_VERSION = 7.4 - -all: stage1 stage2 stage3 stage4 - -# Stage 1 - -stage1: stage1-riscv-qemu/riscv-qemu-$(RISCV_QEMU_SHORTCOMMIT).tar.gz \ - stage1-riscv-qemu/riscv-qemu.spec \ - stamp-riscv-qemu-installed \ - stage1-riscv-fesvr/riscv-fesvr-$(RISCV_FESVR_SHORTCOMMIT).tar.gz \ - stage1-riscv-fesvr/riscv-fesvr.spec \ - stamp-riscv-fesvr-installed \ - stage1-riscv-isa-sim/riscv-isa-sim-$(RISCV_ISA_SIM_SHORTCOMMIT).tar.gz \ - stage1-riscv-isa-sim/riscv-isa-sim.spec \ - stamp-riscv-isa-sim-installed - -stage1-riscv-qemu/riscv-qemu-$(RISCV_QEMU_SHORTCOMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t 'https://github.com/riscv/riscv-qemu/archive/$(RISCV_QEMU_COMMIT)/riscv-qemu-$(RISCV_QEMU_SHORTCOMMIT).tar.gz' - mv $@-t $@ - -stage1-riscv-qemu/riscv-qemu.spec: stage1-riscv-qemu/riscv-qemu.spec.in - sed -e 's/@COMMIT@/$(RISCV_QEMU_COMMIT)/g' \ - -e 's/@SHORTCOMMIT@/$(RISCV_QEMU_SHORTCOMMIT)/g' \ - < $^ > $@-t - mv $@-t $@ - -stamp-riscv-qemu-installed: - rm -f $@ - @rpm -q riscv-qemu >/dev/null || { \ - echo "ERROR: You must install riscv-qemu:"; \ - echo; \ - echo " dnf copr enable rjones/riscv"; \ - echo " dnf install riscv-qemu"; \ - echo; \ - echo "OR: you can build it yourself from the stage1-riscv-qemu directory."; \ - echo; \ - exit 1; \ - } - @qemu-system-riscv --version || { \ - echo "ERROR: qemu-system-riscv is not working."; \ - echo "Make sure you installed the riscv-qemu package."; \ - exit 1; \ - } - touch $@ - -stage1-riscv-fesvr/riscv-fesvr-$(RISCV_FESVR_SHORTCOMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t 'https://github.com/riscv/riscv-fesvr/archive/$(RISCV_FESVR_COMMIT)/riscv-fesvr-$(RISCV_FESVR_SHORTCOMMIT).tar.gz' - mv $@-t $@ - -stage1-riscv-fesvr/riscv-fesvr.spec: stage1-riscv-fesvr/riscv-fesvr.spec.in - sed -e 's/@COMMIT@/$(RISCV_FESVR_COMMIT)/g' \ - -e 's/@SHORTCOMMIT@/$(RISCV_FESVR_SHORTCOMMIT)/g' \ - < $^ > $@-t - mv $@-t $@ - -stamp-riscv-fesvr-installed: - rm -f $@ - @rpm -q riscv-fesvr >/dev/null || { \ - echo "ERROR: You must install riscv-fesvr:"; \ - echo; \ - echo " dnf copr enable rjones/riscv"; \ - echo " dnf install riscv-fesvr"; \ - echo; \ - echo "OR: you can build it yourself from the stage1-riscv-fesvr directory."; \ - echo; \ - exit 1; \ - } - touch $@ - -stage1-riscv-isa-sim/riscv-isa-sim-$(RISCV_ISA_SIM_SHORTCOMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t 'https://github.com/riscv/riscv-isa-sim/archive/$(RISCV_ISA_SIM_COMMIT)/riscv-isa-sim-$(RISCV_ISA_SIM_SHORTCOMMIT).tar.gz' - mv $@-t $@ - -stage1-riscv-isa-sim/riscv-isa-sim.spec: stage1-riscv-isa-sim/riscv-isa-sim.spec.in - sed -e 's/@COMMIT@/$(RISCV_ISA_SIM_COMMIT)/g' \ - -e 's/@SHORTCOMMIT@/$(RISCV_ISA_SIM_SHORTCOMMIT)/g' \ - < $^ > $@-t - mv $@-t $@ - -stamp-riscv-isa-sim-installed: - rm -f $@ - @rpm -q riscv-isa-sim >/dev/null || { \ - echo "ERROR: You must install riscv-isa-sim:"; \ - echo; \ - echo " dnf copr enable rjones/riscv"; \ - echo " dnf install riscv-isa-sim"; \ - echo; \ - echo "OR: you can build it yourself from the stage1-riscv-isa-sim directory."; \ - echo; \ - exit 1; \ - } - touch $@ - -# Stage 2 - -stage2: stage2-riscv-gnu-toolchain/riscv-gnu-toolchain-$(RISCV_GNU_TOOLCHAIN_SHORTCOMMIT).tar.gz \ - stage2-riscv-gnu-toolchain/binutils-$(BINUTILS_VERSION).tar.gz \ - stage2-riscv-gnu-toolchain/gcc-$(GCC_VERSION).tar.gz \ - stage2-riscv-gnu-toolchain/glibc-$(GLIBC_VERSION).tar.gz \ - stage2-riscv-gnu-toolchain/newlib-$(NEWLIB_VERSION).tar.gz \ - stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec \ - stamp-riscv-gnu-toolchain-installed \ - stage2-riscv-pk/riscv-pk-$(RISCV_PK_SHORTCOMMIT).tar.gz \ - stage2-riscv-pk/riscv-pk.spec \ - stamp-riscv-pk-installed - -stage2-riscv-gnu-toolchain/riscv-gnu-toolchain-$(RISCV_GNU_TOOLCHAIN_SHORTCOMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://github.com/lowRISC/riscv-gnu-toolchain/archive/$(RISCV_GNU_TOOLCHAIN_COMMIT)/riscv-gnu-toolchain-$(RISCV_GNU_TOOLCHAIN_SHORTCOMMIT).tar.gz - mv $@-t $@ - -stage2-riscv-gnu-toolchain/binutils-$(BINUTILS_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://mirrors.kernel.org/gnu/binutils/binutils-$(BINUTILS_VERSION).tar.gz - mv $@-t $@ - -# GCC 5 no longer compiles with GCC 6 unless we patch it. -# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69959 -stage2-riscv-gnu-toolchain/gcc-$(GCC_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VERSION)/gcc-$(GCC_VERSION).tar.gz - zcat $@-t | tar xf - - cd gcc-$(GCC_VERSION) && patch -p0 < ../stage2-riscv-gnu-toolchain/gcc-5-fix-compilation-with-gcc-6.patch - tar zcf $@-t gcc-$(GCC_VERSION) - rm -r gcc-$(GCC_VERSION) - mv $@-t $@ - -stage2-riscv-gnu-toolchain/glibc-$(GLIBC_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://mirrors.kernel.org/gnu/glibc/glibc-$(GLIBC_VERSION).tar.gz - mv $@-t $@ - -stage2-riscv-gnu-toolchain/newlib-$(NEWLIB_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://sourceware.org/pub/newlib/newlib-$(NEWLIB_VERSION).tar.gz - mv $@-t $@ - -stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec: stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec.in - sed -e 's/@COMMIT@/$(RISCV_GNU_TOOLCHAIN_COMMIT)/g' \ - -e 's/@SHORTCOMMIT@/$(RISCV_GNU_TOOLCHAIN_SHORTCOMMIT)/g' \ - -e 's/@BINUTILS_VERSION@/$(BINUTILS_VERSION)/g' \ - -e 's/@GCC_VERSION@/$(GCC_VERSION)/g' \ - -e 's/@GLIBC_VERSION@/$(GLIBC_VERSION)/g' \ - -e 's/@NEWLIB_VERSION@/$(NEWLIB_VERSION)/g' \ - < $^ > $@-t - mv $@-t $@ - -stamp-riscv-gnu-toolchain-installed: - rm -f $@ - @rpm -q riscv-gnu-toolchain >/dev/null || { \ - echo "ERROR: You must install riscv-gnu-toolchain:"; \ - echo; \ - echo " dnf copr enable rjones/riscv"; \ - echo " dnf install riscv-gnu-toolchain"; \ - echo; \ - echo "OR: you can build it yourself from the stage2-riscv-gnu-toolchain directory."; \ - echo; \ - exit 1; \ - } - @riscv64-unknown-elf-gcc --version || { \ - echo "ERROR: riscv64-unknown-elf-gcc (cross compiler) is not working."; \ - echo "Make sure you installed the riscv-gnu-toolchain package."; \ - exit 1; \ - } - touch $@ - -stage2-riscv-pk/riscv-pk-$(RISCV_PK_SHORTCOMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://github.com/lowRISC/riscv-pk/archive/$(RISCV_PK_COMMIT)/riscv-pk-$(RISCV_PK_SHORTCOMMIT).tar.gz - mv $@-t $@ - -stage2-riscv-pk/riscv-pk.spec: stage2-riscv-pk/riscv-pk.spec.in - sed -e 's/@COMMIT@/$(RISCV_PK_COMMIT)/g' \ - -e 's/@SHORTCOMMIT@/$(RISCV_PK_SHORTCOMMIT)/g' \ - < $^ > $@-t - mv $@-t $@ - -stamp-riscv-pk-installed: - rm -f $@ - @rpm -q riscv-pk >/dev/null || { \ - echo "ERROR: You must install riscv-pk:"; \ - echo; \ - echo " dnf copr enable rjones/riscv"; \ - echo " dnf install riscv-pk"; \ - echo; \ - echo "OR: you can build it yourself from the stage2-riscv-pk directory."; \ - echo; \ - exit 1; \ - } - touch $@ - -# Stage 3 - -stage3: stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \ - stage3-chroot-original/etc/fedora-release \ - stage3-chroot/etc/fedora-release \ - stage3-chroot/lib64/libc.so.6 \ - stage3-chroot/usr/bin/tic \ - stage3-chroot/usr/lib64/libhistory.so.6 \ - stage3-chroot/bin/bash \ - stage3-chroot/bin/ls \ - stage3-chroot/usr/lib64/libgmp.so.10 \ - stage3-chroot/usr/lib64/libmpfr.so.4 \ - stage3-chroot/usr/lib64/libmpc.so.3 \ - stage3-chroot/usr/bin/as \ - stage3-chroot/usr/bin/gcc \ - stage3-chroot/usr/bin/mount \ - stage3-chroot/usr/bin/tar \ - stage3-chroot/usr/bin/gzip \ - stage3-chroot/usr/lib64/libz.so \ - stage3-chroot/usr/bin/file \ - stage3-chroot/usr/lib64/libpopt.so \ - stage3-chroot/usr/lib64/libbeecrypt.so \ - stage3-chroot/usr/bin/nano \ - stage3-chroot/usr/bin/grep \ - stage3-chroot/usr/bin/less \ - stage3-chroot/usr/bin/strace \ - stage3-chroot/usr/bin/bzip2 \ - stage3-chroot/usr/bin/make \ - stage3-chroot/usr/bin/diff \ - stage3-chroot/usr/bin/find \ - stage3-chroot/usr/bin/sed \ - stage3-chroot/usr/bin/patch \ - stage3-chroot/usr/bin/hostname \ - stage3-chroot/usr/bin/gettext \ - stage3-chroot/usr/bin/lua \ - stage3-chroot/usr/bin/xz \ - stage3-chroot/usr/bin/rpm \ - stage3-chroot/usr/bin/gawk \ - stage3-chroot/usr/bin/vim \ - stage3-chroot/init \ - stage3-disk.img - -stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux: - rm -rf stage3-kernel/linux-$(KERNEL_VERSION) - cp -a $(LOCAL_LINUX_GIT_COPY) stage3-kernel/linux-$(KERNEL_VERSION) || { \ - mkdir stage3-kernel/linux-$(KERNEL_VERSION) && \ - cd stage3-kernel/linux-$(KERNEL_VERSION) && \ - git init; \ - } - cd stage3-kernel/linux-$(KERNEL_VERSION) && \ - git remote add riscv https://github.com/riscv/riscv-linux && \ - git fetch riscv && \ - git checkout -f linux-4.1.y-riscv && \ - make mrproper && \ - make ARCH=riscv defconfig - echo CONFIG_CMDLINE=\"root=/dev/htifblk0 init=/init\" >> stage3-kernel/linux-$(KERNEL_VERSION)/.config - echo CONFIG_CROSS_COMPILE=riscv64-unknown-elf- >> stage3-kernel/linux-$(KERNEL_VERSION)/.config - cd stage3-kernel/linux-$(KERNEL_VERSION) && \ - make ARCH=riscv olddefconfig - cd stage3-kernel/linux-$(KERNEL_VERSION) && \ - make ARCH=riscv vmlinux - ls -l $@ - -# Build an original (x86-64) chroot using supermin. We then aim to -# rebuild (using cross-compiled versions) every ELF binary in this -# chroot. -stage3-chroot-original/etc/fedora-release: - rm -rf stage3-chroot-original-t stage3-chroot-original tmp-supermin.d - supermin --prepare $(STAGE3_PACKAGES) -o tmp-supermin.d - supermin --build -f chroot tmp-supermin.d -o stage3-chroot-original-t - rm -r tmp-supermin.d - mv stage3-chroot-original-t stage3-chroot-original - @echo -n "Total files in chroot: " - @find stage3-chroot-original -type f | wc -l - @echo -n "ELF files to be rebuilt: " - @find stage3-chroot-original -type f | xargs file -N | grep -E '\bELF.*LSB\b' | wc -l - -# Copy the original chroot to the final chroot, remove all the ELF -# files. -stage3-chroot/etc/fedora-release: stage3-chroot-original/etc/fedora-release - rm -rf stage3-chroot-t stage3-chroot - cp -a stage3-chroot-original stage3-chroot-t - find stage3-chroot-t -type d -print0 | xargs -0 chmod u+w - find stage3-chroot-t -type f -print0 | xargs -0 chmod u+w - find stage3-chroot-t -type f -print0 | xargs -0 file -N | grep -E '\bELF.*LSB\b' | awk -F: '{print $$1}' | xargs rm -f - rm -f stage3-chroot-t/lib64/libc.so.6 - mv stage3-chroot-t stage3-chroot - -# Copy in compiled glibc from the riscv-gnu-toolchain sysroot. Only -# copy files and symlinks, leave the target directory structure -# intact. -stage3-chroot/lib64/libc.so.6: - mkdir -p stage3-chroot/usr/lib/audit - mkdir -p stage3-chroot/usr/lib/gconv - for f in `cd /usr/sysroot && find -type f -o -type l`; do \ - cp -d /usr/sysroot/$$f stage3-chroot/$$f; \ - done - cd stage3-chroot/lib64 && for f in ../lib/*; do ln -sf $$f; done - -# Cross-compile ncurses. -stage3-chroot/usr/bin/tic: ncurses-$(NCURSES_VERSION).tgz - tar zxf $^ - cd ncurses-$(NCURSES_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --with-shared \ - --with-termlib=tinfo \ - --enable-widec - cd ncurses-$(NCURSES_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd ncurses-$(NCURSES_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot - -ncurses-$(NCURSES_VERSION).tgz: - rm -f $@ $@-t - wget -O $@-t ftp://invisible-island.net/ncurses/current/ncurses-$(NCURSES_VERSION).tgz - mv $@-t $@ - -# Cross-compile readline. -stage3-chroot/usr/lib64/libhistory.so.6: readline-$(READLINE_VERSION).tar.gz - tar zxf $^ - cd readline-$(READLINE_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - bash_cv_wcwidth_broken=no \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd readline-$(READLINE_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd readline-$(READLINE_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -readline-$(READLINE_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.gnu.org/gnu/readline/readline-$(READLINE_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile bash. -stage3-chroot/bin/bash: bash-$(BASH_VERSION).tar.gz - tar zxf $^ - cd bash-$(BASH_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd bash-$(BASH_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd bash-$(BASH_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -bash-$(BASH_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.gnu.org/gnu/bash/bash-$(BASH_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile coreutils. Bleah, coreutils cross-compilation is -# known-broken and upstream don't care, hence the 'touch' command. - -COREUTILS_PROGRAMS = arch base32 base64 basename cat chcon chgrp chmod chown chroot cksum comm cp csplit cut date dd df dir dircolors dirname du echo env expand expr factor false fmt fold ginstall groups head hostid hostname id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum sha384sum sha512sum shred shuf sleep sort split stat stdbuf stty sum sync tac tail tee test timeout touch tr true truncate tsort tty uname unexpand uniq unlink uptime users vdir wc who whoami yes - -stage3-chroot/bin/ls: coreutils-$(COREUTILS_VERSION).tar.xz - rm -rf coreutils-$(COREUTILS_VERSION) - tar Jxf $^ - cd coreutils-$(COREUTILS_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - -cd coreutils-$(COREUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd coreutils-$(COREUTILS_VERSION)/man && \ - for f in $(COREUTILS_PROGRAMS); do touch $$f.1; done - cd coreutils-$(COREUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd coreutils-$(COREUTILS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -coreutils-$(COREUTILS_VERSION).tar.xz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.gnu.org/gnu/coreutils/coreutils-$(COREUTILS_VERSION).tar.xz - mv $@-t $@ - -# Cross-compile binutils. -stage3-chroot/usr/bin/as: binutils-$(BINUTILS_X_VERSION).tar.gz - rm -rf riscv-binutils-gdb-riscv-binutils-$(BINUTILS_X_VERSION) - zcat $^ | tar xf - - mkdir riscv-binutils-gdb-riscv-binutils-$(BINUTILS_X_VERSION)/build - cd riscv-binutils-gdb-riscv-binutils-$(BINUTILS_X_VERSION)/build && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ../configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd riscv-binutils-gdb-riscv-binutils-$(BINUTILS_X_VERSION)/build && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd riscv-binutils-gdb-riscv-binutils-$(BINUTILS_X_VERSION)/build && make DESTDIR=$(ROOT)/stage3-chroot install - -binutils-$(BINUTILS_X_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://github.com/riscv/riscv-binutils-gdb/archive/riscv-binutils-$(BINUTILS_X_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GMP, MPFR and MPC (deps of GCC). -stage3-chroot/usr/lib64/libgmp.so.10: gmp-$(GMP_VERSION).tar.lz - rm -rf gmp-$(GMP_VERSION) - tar --lzip -xf gmp-$(GMP_VERSION).tar.lz - cd gmp-$(GMP_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd gmp-$(GMP_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd gmp-$(GMP_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - cd stage3-chroot/usr/lib && ln -s ../lib64/libgmp.so - -gmp-$(GMP_VERSION).tar.lz: - rm -f $@ $@-t - wget -O $@-t https://gmplib.org/download/gmp/gmp-$(GMP_VERSION).tar.lz - mv $@-t $@ - -stage3-chroot/usr/lib64/libmpfr.so.4: mpfr-$(MPFR_VERSION).tar.gz - rm -rf mpfr-$(MPFR_VERSION) - tar -zxf mpfr-$(MPFR_VERSION).tar.gz - cd mpfr-$(MPFR_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --with-gmp=$(ROOT)/stage3-chroot/usr - cd mpfr-$(MPFR_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd mpfr-$(MPFR_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - cd stage3-chroot/usr/lib && ln -s ../lib64/libmpfr.so - rm -f stage3-chroot/usr/lib64/*.la - -mpfr-$(MPFR_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://www.mpfr.org/mpfr-current/mpfr-$(MPFR_VERSION).tar.gz - mv $@-t $@ - -stage3-chroot/usr/lib64/libmpc.so.3: mpc-$(MPC_VERSION).tar.gz - rm -rf mpc-$(MPC_VERSION) - tar -zxf mpc-$(MPC_VERSION).tar.gz - cd mpc-$(MPC_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --with-gmp=$(ROOT)/stage3-chroot/usr \ - --with-mpfr=$(ROOT)/stage3-chroot/usr - cd mpc-$(MPC_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd mpc-$(MPC_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - cd stage3-chroot/usr/lib && ln -s ../lib64/libmpc.so - rm -f stage3-chroot/usr/lib64/*.la - -mpc-$(MPC_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.gnu.org/gnu/mpc/mpc-$(MPC_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GCC. -stage3-chroot/usr/bin/gcc: gcc-$(GCC_X_VERSION).tar.gz - rm -rf riscv-gcc-riscv-gcc-$(GCC_X_VERSION) - zcat $^ | tar xf - - cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION) && \ - patch -p1 < ../0001-HACKS-TO-GET-GCC-TO-COMPILE.patch - mkdir riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build - cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && \ - gcc_cv_as_leb128=no \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ../configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --enable-shared \ - --enable-tls \ - --enable-languages=c,c++ \ - --disable-libmudflap \ - --disable-libssp \ - --disable-libquadmath \ - --disable-nls \ - --disable-multilib - cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && gcc_cv_as_leb128=no PATH=$(ROOT)/fixed-gcc:$$PATH make - cd riscv-gcc-riscv-gcc-$(GCC_X_VERSION)/build && make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -gcc-$(GCC_X_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://github.com/riscv/riscv-gcc/archive/riscv-gcc-$(GCC_X_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile util-linux. -stage3-chroot/usr/bin/mount: util-linux-$(UTIL_LINUX_VERSION).tar.xz - rm -rf util-linux-$(UTIL_LINUX_VERSION) - tar -Jxf $^ - cd util-linux-$(UTIL_LINUX_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --without-python \ - --without-systemd \ - --disable-makeinstall-chown \ - --enable-static-programs=mount - cd util-linux-$(UTIL_LINUX_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd util-linux-$(UTIL_LINUX_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -util-linux-$(UTIL_LINUX_VERSION).tar.xz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.kernel.org/pub/linux/utils/util-linux/v$(UTIL_LINUX_VERSION)/util-linux-$(UTIL_LINUX_VERSION).tar.xz - mv $@-t $@ - -# Cross-compile GNU tar. -stage3-chroot/usr/bin/tar: tar-$(TAR_VERSION).tar.xz - rm -rf tar-$(TAR_VERSION) - tar -Jxf $^ - cd tar-$(TAR_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd tar-$(TAR_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd tar-$(TAR_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -tar-$(TAR_VERSION).tar.xz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/tar/tar-$(TAR_VERSION).tar.xz - mv $@-t $@ - -# Cross-compile GNU gzip. -stage3-chroot/usr/bin/gzip: gzip-$(GZIP_VERSION).tar.gz - rm -rf gzip-$(GZIP_VERSION) - tar -zxf $^ - cd gzip-$(GZIP_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd gzip-$(GZIP_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd gzip-$(GZIP_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -gzip-$(GZIP_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/gzip/gzip-$(GZIP_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile zlib. -stage3-chroot/usr/lib64/libz.so: zlib-$(ZLIB_VERSION).tar.gz - rm -rf zlib-$(ZLIB_VERSION) - tar -zxf $^ - cd zlib-$(ZLIB_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - CC=riscv64-unknown-linux-gnu-gcc \ - CFLAGS="-I$(ROOT)/stage3-chroot/usr/include -L$(ROOT)/stage3-chroot/usr/lib" \ - ./configure \ - --prefix=/usr --libdir=/usr/lib64 - cd zlib-$(ZLIB_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make shared - cd zlib-$(ZLIB_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -zlib-$(ZLIB_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://zlib.net/zlib-$(ZLIB_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile file/libmagic. -stage3-chroot/usr/bin/file: file-$(FILE_VERSION).tar.gz - rm -rf file-$(FILE_VERSION) - tar -zxf $^ - cd file-$(FILE_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --disable-static --enable-shared - cd file-$(FILE_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make V=1 - cd file-$(FILE_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -file-$(FILE_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.astron.com/pub/file/file-$(FILE_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile popt. -stage3-chroot/usr/lib64/libpopt.so: popt-$(POPT_VERSION).tar.gz - rm -rf popt-$(POPT_VERSION) - tar -zxf $^ - cd popt-$(POPT_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --disable-static --enable-shared - cd popt-$(POPT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make V=1 - cd popt-$(POPT_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -popt-$(POPT_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://rpm5.org/files/popt/popt-$(POPT_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile beecrypt. -stage3-chroot/usr/lib64/libbeecrypt.so: beecrypt-$(BEECRYPT_VERSION).tar.gz - rm -rf beecrypt-$(BEECRYPT_VERSION) - tar -zxf $^ - cd beecrypt-$(BEECRYPT_VERSION) && patch -p0 < ../beecrypt-disable-cplusplus.patch - cd beecrypt-$(BEECRYPT_VERSION) && autoreconf -i - cd beecrypt-$(BEECRYPT_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --without-cplusplus \ - --without-java \ - --disable-openmp \ - --disable-static \ - --enable-shared - cd beecrypt-$(BEECRYPT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make V=1 - cd beecrypt-$(BEECRYPT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot V=1 - chrpath -d stage3-chroot/usr/lib64/libbeecrypt.so.* - rm -f stage3-chroot/usr/lib64/*.la - -beecrypt-$(BEECRYPT_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://downloads.sourceforge.net/sourceforge/beecrypt/beecrypt-$(BEECRYPT_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU nano (editor). -stage3-chroot/usr/bin/nano: nano-$(NANO_VERSION).tar.gz - rm -rf nano-$(NANO_VERSION) - tar -zxf $^ - cd nano-$(NANO_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd nano-$(NANO_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd nano-$(NANO_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -nano-$(NANO_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://www.nano-editor.org/dist/v2.6/nano-$(NANO_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU grep. -stage3-chroot/usr/bin/grep: grep-$(GREP_VERSION).tar.xz - rm -rf grep-$(GREP_VERSION) - tar -Jxf $^ - cd grep-$(GREP_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd grep-$(GREP_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd grep-$(GREP_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -grep-$(GREP_VERSION).tar.xz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/grep/grep-$(GREP_VERSION).tar.xz - mv $@-t $@ - -# Cross-compile less. -stage3-chroot/usr/bin/less: less-$(LESS_VERSION).tar.gz - rm -rf less-$(LESS_VERSION) - tar -zxf $^ - cd less-$(LESS_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd less-$(LESS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd less-$(LESS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -less-$(LESS_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://www.greenwoodsoftware.com/less/less-$(LESS_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile strace. -# XXX This does not work. -stage3-chroot/usr/bin/strace: strace-$(STRACE_SHORT_COMMIT).tar.gz - rm -rf strace-$(STRACE_SHORT_COMMIT) - tar -zxf $^ - cd riscv-strace-$(STRACE_COMMIT) && patch -p1 < ../0001-Update-riscv_regs-for-ptrace.h-from-Linux-4.1.x.patch - cd riscv-strace-$(STRACE_COMMIT) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd riscv-strace-$(STRACE_COMMIT) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd riscv-strace-$(STRACE_COMMIT) && make install DESTDIR=$(ROOT)/stage3-chroot - -strace-$(STRACE_SHORT_COMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t 'https://github.com/riscv/riscv-strace/archive/$(STRACE_COMMIT)/riscv-strace-$(STRACE_SHORTCOMMIT).tar.gz' - mv $@-t $@ - -# Cross-compile bzip2. -stage3-chroot/usr/bin/bzip2: bzip2-$(BZIP2_VERSION).tar.gz - rm -rf bzip2-$(BZIP2_VERSION) - tar -zxf $^ - cd bzip2-$(BZIP2_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - make libbz2.a bzip2 bzip2recover \ - PREFIX=/usr \ - CC=riscv64-unknown-linux-gnu-gcc \ - AR=riscv64-unknown-linux-gnu-ar \ - RANLIB=riscv64-unknown-linux-gnu-ranlib \ - CFLAGS="-Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64 -fPIC" - cd bzip2-$(BZIP2_VERSION) && \ - make install PREFIX=$(ROOT)/stage3-chroot/usr - -bzip2-$(BZIP2_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://www.bzip.org/1.0.6/bzip2-$(BZIP2_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU make. -stage3-chroot/usr/bin/make: make-$(MAKE_VERSION).tar.gz - rm -rf make-$(MAKE_VERSION) - tar -zxf $^ - cd make-$(MAKE_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd make-$(MAKE_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd make-$(MAKE_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -make-$(MAKE_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/make/make-$(MAKE_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU diffutils. -stage3-chroot/usr/bin/diff: diffutils-$(DIFFUTILS_VERSION).tar.xz - rm -rf diffutils-$(DIFFUTILS_VERSION) - tar -Jxf $^ - cd diffutils-$(DIFFUTILS_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd diffutils-$(DIFFUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd diffutils-$(DIFFUTILS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -diffutils-$(DIFFUTILS_VERSION).tar.xz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/diffutils/diffutils-$(DIFFUTILS_VERSION).tar.xz - mv $@-t $@ - -# Cross-compile GNU findutils. -stage3-chroot/usr/bin/find: findutils-$(FINDUTILS_VERSION).tar.gz - rm -rf findutils-$(FINDUTILS_VERSION) - tar -zxf $^ - cd findutils-$(FINDUTILS_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd findutils-$(FINDUTILS_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd findutils-$(FINDUTILS_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -findutils-$(FINDUTILS_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/findutils/findutils-$(FINDUTILS_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU sed. -stage3-chroot/usr/bin/sed: sed-$(SED_VERSION).tar.gz - rm -rf sed-$(SED_VERSION) - tar -zxf $^ - cd sed-$(SED_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd sed-$(SED_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd sed-$(SED_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -sed-$(SED_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/sed/sed-$(SED_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile patch. -stage3-chroot/usr/bin/patch: patch-$(PATCH_VERSION).tar.gz - rm -rf patch-$(PATCH_VERSION) - tar -zxf $^ - cd patch-$(PATCH_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd patch-$(PATCH_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd patch-$(PATCH_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -patch-$(PATCH_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/patch/patch-$(PATCH_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile hostname. -stage3-chroot/usr/bin/hostname: hostname-$(HOSTNAME_VERSION).tar.gz - rm -rf hostname-$(HOSTNAME_VERSION) - tar -zxf $^ - cd hostname && patch -p1 < ../hostname-rh.patch - cd hostname && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - make \ - CC=riscv64-unknown-linux-gnu-gcc \ - CFLAGS="-O2 -g" - cd hostname && make install BASEDIR=$(ROOT)/stage3-chroot - -hostname-$(HOSTNAME_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://ftp.de.debian.org/debian/pool/main/h/hostname/hostname_$(HOSTNAME_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU gettext. -stage3-chroot/usr/bin/gettext: gettext-$(GETTEXT_VERSION).tar.gz - rm -rf gettext-$(GETTEXT_VERSION) - tar -zxf $^ - cd gettext-$(GETTEXT_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd gettext-$(GETTEXT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd gettext-$(GETTEXT_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -gettext-$(GETTEXT_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/gettext/gettext-$(GETTEXT_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile lua. -stage3-chroot/usr/bin/lua: lua-$(LUA_VERSION).tar.gz - rm -rf lua-$(LUA_VERSION) - tar -zxf $^ - cd lua-$(LUA_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make PLAT=linux INSTALL_TOP=/usr CC=riscv64-unknown-linux-gnu-gcc AR="riscv64-unknown-linux-gnu-ar rcu" RANLIB="riscv64-unknown-linux-gnu-ranlib" MYLDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 MYLIBS=-ltinfo MYCFLAGS="-fPIC -DLUA_COMPAT_5_1" - cd lua-$(LUA_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install INSTALL_TOP=$(ROOT)/stage3-chroot/usr INSTALL_LIB=$(ROOT)/stage3-chroot/usr/lib64 - -lua-$(LUA_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://www.lua.org/ftp/lua-$(LUA_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile xz. -stage3-chroot/usr/bin/xz: xz-$(XZ_VERSION).tar.gz - rm -rf xz-$(XZ_VERSION) - tar -zxf $^ - cd xz-$(XZ_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd xz-$(XZ_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd xz-$(XZ_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -xz-$(XZ_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://tukaani.org/xz/xz-$(XZ_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile GNU awk. -stage3-chroot/usr/bin/gawk: gawk-$(GAWK_VERSION).tar.gz - rm -rf gawk-$(GAWK_VERSION) - tar -zxf $^ - cd gawk-$(GAWK_VERSION) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 - cd gawk-$(GAWK_VERSION) && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd gawk-$(GAWK_VERSION) && make install DESTDIR=$(ROOT)/stage3-chroot - -gawk-$(GAWK_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t https://ftp.gnu.org/gnu/gawk/gawk-$(GAWK_VERSION).tar.gz - mv $@-t $@ - -# Cross-compile vim. -stage3-chroot/usr/bin/vim: vim-$(VIM_VERSION).tar.gz - rm -rf vim-$(VIM_VERSION) - bzcat $^ | tar xf - - cd vim74/src && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - vim_cv_memmove_handles_overlap=yes \ - vim_cv_stat_ignores_slash=no \ - vim_cv_getcwd_broken=no \ - vim_cv_tty_group=world \ - vim_cv_terminfo=yes \ - vim_cv_toupper_broken=no \ - LDFLAGS=-L/home/rjones/d/fedora-riscv/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --with-tlib=tinfo - cd vim74/src && PATH=$(ROOT)/fixed-gcc:$$PATH make - cd vim74/src && make install DESTDIR=$(ROOT)/stage3-chroot STRIP=riscv64-unknown-linux-gnu-strip - -vim-$(VIM_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t ftp://ftp.vim.org/pub/vim/unix/vim-$(VIM_VERSION).tar.bz2 - mv $@-t $@ - -# Cross-compile RPM / rpmbuild. -# We build this from a git commit, with a few hacks to the configure -# script. -stage3-chroot/usr/bin/rpm: rpm-$(RPM_SHORT_COMMIT).tar.gz db-$(BDB_VERSION).tar.gz - rm -rf rpm-$(RPM_SHORT_COMMIT) - tar -zxf rpm-$(RPM_SHORT_COMMIT).tar.gz - tar -zxf db-$(BDB_VERSION).tar.gz -C rpm-$(RPM_SHORT_COMMIT) - cd rpm-$(RPM_SHORT_COMMIT) && ln -s db-$(BDB_VERSION) db - cd rpm-$(RPM_SHORT_COMMIT) && \ - patch -p1 < ../0001-RISCV-64-bit-riscv64-support.patch && \ - patch -p1 < ../0002-rpmrc-Convert-uname.machine-riscv-to-riscv32-riscv64.patch && \ - patch -p1 < ../0003-build-fgetc-returns-int-not-char.patch && \ - patch -p1 < ../0004-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch - cd rpm-$(RPM_SHORT_COMMIT) && autoreconf -i - cd rpm-$(RPM_SHORT_COMMIT) && \ - PATH=$(ROOT)/fixed-gcc:$$PATH \ - LDFLAGS=-L$(ROOT)/stage3-chroot/usr/lib64 \ - ./configure \ - --host=riscv64-unknown-linux-gnu \ - --prefix=/usr --libdir=/usr/lib64 \ - --disable-rpath \ - --with-vendor=redhat \ - --without-libarchive \ - --with-lua \ - --with-beecrypt \ - --without-archive \ - --without-external-db \ - --enable-ndb \ - --disable-plugins - cd rpm-$(RPM_SHORT_COMMIT) && PATH=$(ROOT)/fixed-gcc:$$PATH make V=1 - cd rpm-$(RPM_SHORT_COMMIT) && PATH=$(ROOT)/fixed-gcc:$$PATH make install DESTDIR=$(ROOT)/stage3-chroot - rm -f stage3-chroot/usr/lib64/*.la - -rpm-$(RPM_SHORT_COMMIT).tar.gz: - rm -f $@ $@-t - wget -O $@-t 'http://rpm.org/gitweb?p=rpm.git;a=snapshot;h=$(RPM_COMMIT);sf=tgz' - mv $@-t $@ - -db-$(BDB_VERSION).tar.gz: - rm -f $@ $@-t - wget -O $@-t http://download.oracle.com/berkeley-db/db-$(BDB_VERSION).tar.gz - mv $@-t $@ - -# Create an /init script. -stage3-chroot/init: init.sh - install -m 0755 $^ $@ - -# Create the stage3 disk image. -# Note `-s +...' adds spare space to the disk image. -stage3-disk.img: stage3-chroot - cd stage3-chroot && virt-make-fs . ../$@ -t ext2 -F raw -s +4G - -# Upload the compressed disk image. -upload-stage3: stage3-disk.img.xz - scp $^ tick:public_html/riscv/ -stage3-disk.img.xz: stage3-disk.img - rm -f $@ - xz --best $^ - -DISK := stage3-disk.img - -# Helper which boots stage3 disk image in spike. -boot-stage3-in-spike: stage3-disk.img stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux - spike +disk=$(DISK) \ - /usr/bin/bbl stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux - -# Helper which boots stage3 disk image in qemu. -boot-stage3-in-qemu: stage3-disk.img stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux - qemu-system-riscv -kernel /usr/bin/bbl \ - -append ./stage3-kernel/linux-$(KERNEL_VERSION)/vmlinux \ - -drive file=$(DISK),format=raw -nographic - -# Stage 4 - -stage4: - echo "XXX TO DO" - exit 1 - - - -# Don't run the builds in parallel because they are implicitly ordered. -.NOTPARALLEL: diff --git a/README b/README index 507209b..00ae4eb 100644 --- a/README +++ b/README @@ -1,211 +1,3 @@ -A plan for Fedora/RISC-V ----------------------------------------------------------------------- -by Richard W.M. Jones (rjones@redhat.com) +This repo has MOVED to: -Project home page: https://fedoraproject.org/wiki/Architectures/RISC-V - - -The aim of the project ----------------------- - -Get Fedora running on the RISC-V architecture! This will just be an -initial pass, which we're calling an "experimental architecture". It -won't even be a secondary architecture for perhaps 1 to 3 years. - -About Fedora: https://getfedora.org/ -About RISC-V: https://riscv.org/ - https://en.wikipedia.org/wiki/RISC-V - lowRISC: http://www.lowrisc.org/ - SiFive: https://www.sifive.com/ - - -How do we expect people to consume Fedora/RISC-V? -------------------------------------------------- - -Most users will download binaries. Of course source will be available -for everything, buildable from source RPMS. - -Currently no hardware is available, so you either have to run RISC-V -on an FPGA, or use emulation, either QEMU or Spike. - -For the FPGA option, you will need a Nexys 4 DDR development kit -costing around US$341, plus an ordinary micro SD card (8+ GB), plus a -host Fedora/x86-64 computer. - - - Maximum system RAM is 128 MB (1 GB is available if you use the - other far more expensive FPGA development kit) - - - There is a 115200 bps 8n1 serial port. - - - There is no ethernet and no display. - - - Note that some parts of the FPGA toolchain are closed source. - -For the QEMU emulation option, you will need Fedora 24 (x86_64). - - - QEMU has unlimited system RAM. - - - Single virtual CPU. - - - We hope to get virtio-net and maybe virtio-scsi working. - -For the Spike emulation option, you will need Fedora 24 (x86_64). - - - Spike has unlimited system RAM. - - - Spike can emulate multiple virtual CPUs. - - - Spike's single thread performance is a bit slower than QEMU. - - - No network. - - -What parts of Fedora are we aiming to build? --------------------------------------------- - -The @Core packages (as RPMs), rpmbuild, gcc, and a bootable binary -disk image. - -Only 64 bit RISC-V ("riscv64") will be targeted. - -Once those are done, we can declare victory. - - -What parts of Fedora are we *not* aiming to build? --------------------------------------------------- - -Nothing outside @Core except for specific compilers and build tools. - -Not Anaconda. - -Not Koji (at least, not at first). - -Not Grub nor EDK2. We will initially use the Berkeley bootloader -(bbl), but aim for a standard bootloader later. - - -Where will we build it? ------------------------ - -The packages which are run on the host (x86-64) computer are built in -COPR (http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv/). - -However the majority of packages will be built on RISC-V itself. -Since there are no RISC-V builders, and we cannot provide any, -initially developers will be building them on their own FPGAs / -emulators and uploading them to somewhere central. - -Getting build infrastructure would be a more long-term aim. - - -Bootstrapping stages --------------------- -[This plan was loosely based on: -https://fedoraproject.org/wiki/Architectures/AArch64/Bootstrap] - - -Bootstrapping, Stage 1 ----------------------- - -(1a) riscv-qemu.x86_64: QEMU + RISC-V system emulation - -Not upstream, fork of qemu 2.5.0. -https://github.com/riscv/riscv-qemu -Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv - -Note this package runs on x86-64 hosts, and is intended for people who -want to run Fedora/RISC-V but who do not have FPGA/hardware. - -(1b) riscv-isa-sim.x86_64: Spike system emulator - -https://github.com/riscv/riscv-isa-sim -Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv - -(1c) Nexys4 DDR FPGA - -Various sources, see: -http://www.lowrisc.org/docs/untether-v0.2/fpga-demo/ - - -Bootstrapping, Stage 2 ----------------------- - -(2a) GNU cross-compiler toolchain. - -https://github.com/lowRISC/riscv-gnu-toolchain -Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv - -(2b) Berkley Bootloader (bbl) - -https://github.com/lowrisc/riscv-pk.git -Status: done http://copr-fe.cloud.fedoraproject.org/coprs/rjones/riscv - -Used to boot the kernel and mount the root filesystem on FPGAs and -QEMU. - - -Bootstrapping, Stage 3 ----------------------- - -(3a) kernel.riscv64: The Linux kernel, cross-compiled. - -https://github.com/lowrisc/riscv-linux -Not upstream fork of Linux 4.1. -Status: done, see Makefile rule stage3-kernel/linux-*/vmlinux - -(3b) "Just enough userspace" - -We cross-compile packages from x86-64 host to riscv64 target -filesystem. The aim is to have a filesystem (not RPMs) that can be -booted on RISC-V hardware or under emulation, which will be sufficient -to use to compile RPMs. - -Status: done, see Makefile rules stage3-chroot/* and -http://oirase.annexia.org/riscv/ - - -Bootstrapping, Stage 4 ----------------------- - -(4a) Userspace RPMs - -We will build RPMs using "rpmbuild" on RISC-V itself (under emulation). - -The usual command is: - - rpmbuild --rebuild blah-xyz.src.rpm --define 'debug_package %{nil}' - -We will build enough RPMs so that stage 4 can run rpmbuild, gcc. -Essentially it's the same list of packages as for (3b) above, so look -in the Makefile for "stage3-chroot/..." rules, plus any dependencies. - -Some packages require non-upstream patches for RISC-V. Hopefully -only: kernel, glibc, binutils and gcc. - -Some packages require modifications to the spec file to reduce -extraneous dependencies (eg. for generating documentation). - -noarch RPMs do not need to be rebuilt, they can be copied from Koji/x86. - -Status: ongoing, see stage3-prebuilt-rpms/* - -(4b) Recreate the filesystem from RPMs. - -Distribute an initial bootable binary disk image which is completely -built from RPMs (but note: not created by Anaconda, we'll use -"rpm --root"). - -(4c) kernel.riscv64: The Linux kernel, compiled as an RPM on RISC-V. - -(4d) Continue compiling all other RPMs from @Core. - -As more packages are compiled, distribute them as RPMs and distribute -updated bootable binary disk image. - -(4e) Declare victory and celebrate! - - -Open issues ------------ - -(none at present) +https://github.com/rwmjones/fedora-riscv diff --git a/beecrypt-disable-cplusplus.patch b/beecrypt-disable-cplusplus.patch deleted file mode 100644 index d32958b..0000000 --- a/beecrypt-disable-cplusplus.patch +++ /dev/null @@ -1,14 +0,0 @@ -The act of linking to any C++ file causes libbeecrypt to be linked to -libstdc++ etc. We don't need any of that so kill it. - ---- Makefile.am~ 2009-07-08 19:56:18.000000000 +0100 -+++ Makefile.am 2016-08-09 15:31:40.039891644 +0100 -@@ -62,7 +62,7 @@ - - lib_LTLIBRARIES = libbeecrypt.la - --libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhies.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha224.c hmacsha256.c md4.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c ripemd128.c ripemd160.c ripemd256.c ripemd320.c rsa.c rsakp.c rsapk.c sha1.c sha224.c sha256.c sha384.c sha512.c sha2k32.c sha2k64.c timestamp.c cppglue.cxx -+libbeecrypt_la_SOURCES = aes.c base64.c beecrypt.c blockmode.c blockpad.c blowfish.c dhies.c dldp.c dlkp.c dlpk.c dlsvdp-dh.c dsa.c elgamal.c endianness.c entropy.c fips186.c hmac.c hmacmd5.c hmacsha1.c hmacsha224.c hmacsha256.c md4.c md5.c hmacsha384.c hmacsha512.c memchunk.c mp.c mpbarrett.c mpnumber.c mpprime.c mtprng.c pkcs1.c pkcs12.c ripemd128.c ripemd160.c ripemd256.c ripemd320.c rsa.c rsakp.c rsapk.c sha1.c sha224.c sha256.c sha384.c sha512.c sha2k32.c sha2k64.c timestamp.c - libbeecrypt_la_DEPENDENCIES = $(BEECRYPT_OBJECTS) - libbeecrypt_la_LIBADD = blowfishopt.lo mpopt.lo sha1opt.lo $(OPENMP_LIBS) - libbeecrypt_la_LDFLAGS = -no-undefined -version-info $(LIBBEECRYPT_LT_CURRENT):$(LIBBEECRYPT_LT_REVISION):$(LIBBEECRYPT_LT_AGE) diff --git a/fixed-gcc/README b/fixed-gcc/README deleted file mode 100644 index 8f714f1..0000000 --- a/fixed-gcc/README +++ /dev/null @@ -1,7 +0,0 @@ -The versions of riscv64-unknown-linux-{gcc,g++} in the -riscv-gnu-toolchain RPM are (possibly) broken in that they require an -explicit --sysroot parameter. - -Work around that by setting $PATH to contain this directory. - -Note this should only be used when building stage3. diff --git a/fixed-gcc/riscv64-unknown-linux-gnu-c++ b/fixed-gcc/riscv64-unknown-linux-gnu-c++ deleted file mode 100755 index 6c44bb5..0000000 --- a/fixed-gcc/riscv64-unknown-linux-gnu-c++ +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/riscv64-unknown-linux-gnu-g++ --sysroot=/home/rjones/d/fedora-riscv/stage3-chroot "$@" diff --git a/fixed-gcc/riscv64-unknown-linux-gnu-cc b/fixed-gcc/riscv64-unknown-linux-gnu-cc deleted file mode 100755 index 4125513..0000000 --- a/fixed-gcc/riscv64-unknown-linux-gnu-cc +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/riscv64-unknown-linux-gnu-gcc --sysroot=/home/rjones/d/fedora-riscv/stage3-chroot "$@" diff --git a/fixed-gcc/riscv64-unknown-linux-gnu-g++ b/fixed-gcc/riscv64-unknown-linux-gnu-g++ deleted file mode 100755 index 6c44bb5..0000000 --- a/fixed-gcc/riscv64-unknown-linux-gnu-g++ +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/riscv64-unknown-linux-gnu-g++ --sysroot=/home/rjones/d/fedora-riscv/stage3-chroot "$@" diff --git a/fixed-gcc/riscv64-unknown-linux-gnu-gcc b/fixed-gcc/riscv64-unknown-linux-gnu-gcc deleted file mode 100755 index 4125513..0000000 --- a/fixed-gcc/riscv64-unknown-linux-gnu-gcc +++ /dev/null @@ -1 +0,0 @@ -/usr/bin/riscv64-unknown-linux-gnu-gcc --sysroot=/home/rjones/d/fedora-riscv/stage3-chroot "$@" diff --git a/hostname-rh.patch b/hostname-rh.patch deleted file mode 100644 index d56ae59..0000000 --- a/hostname-rh.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -up hostname/Makefile.rh hostname/Makefile ---- hostname/Makefile.rh 2013-11-04 10:12:59.670379153 +0100 -+++ hostname/Makefile 2013-11-04 10:15:04.957314495 +0100 -@@ -10,21 +10,17 @@ OBJS=hostname.o - - hostname: $(OBJS) - $(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) -lnsl -- ln -fs hostname dnsdomainname -- ln -fs hostname domainname -- ln -fs hostname ypdomainname -- ln -fs hostname nisdomainname - - install: hostname - install -d ${BASEDIR}$(MANDIR)/man1 -- install -o root -g root -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1 -+ install -m 0644 hostname.1 ${BASEDIR}$(MANDIR)/man1 - ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/dnsdomainname.1 - ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/domainname.1 - ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/ypdomainname.1 - ln -fs hostname.1 ${BASEDIR}$(MANDIR)/man1/nisdomainname.1 - - install -d ${BASEDIR}$(BINDIR) -- install -o root -g root -m 0755 hostname ${BASEDIR}$(BINDIR) -+ install -m 0755 hostname ${BASEDIR}$(BINDIR) - ln -fs hostname ${BASEDIR}$(BINDIR)/dnsdomainname - ln -fs hostname ${BASEDIR}$(BINDIR)/domainname - ln -fs hostname ${BASEDIR}$(BINDIR)/nisdomainname -diff -up hostname/hostname.1.rh hostname/hostname.1 ---- hostname/hostname.1.rh 2013-11-03 15:24:23.000000000 +0100 -+++ hostname/hostname.1 2013-11-04 10:12:59.670379153 +0100 -@@ -80,6 +80,28 @@ complete FQDN of the system is returned - .B "THE FQDN" - below). - -+.LP -+The function -+.BR gethostname(2) -+is used to get the hostname. When the -+.BR "hostname \-a, \-d, \-f or \-i" -+is called will -+.BR gethostbyname(3) -+be called. The difference in -+.BR gethostname(2) -+and -+.BR gethostbyname(3) -+is that -+.BR gethostbyname(3) -+is network aware, so it consults -+.IR /etc/nsswitch.conf -+and -+.IR /etc/host.conf -+to decide whether to read information in -+.IR /etc/hostname -+or -+.IR /etc/hosts -+ - .SS "SET NAME" - When called with one argument or with the - .B \-\-file -@@ -105,8 +127,7 @@ command (see - .B "THE FQDN" - below). - .LP --The host name is usually set once at system startup in --.I /etc/init.d/hostname.sh -+The host name is usually set once at system startup - (normally by reading the contents of a file which contains - the host name, e.g. - .IR /etc/hostname ). diff --git a/init.sh b/init.sh deleted file mode 100755 index eac9bd9..0000000 --- a/init.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -# Init script installed in stage3 disk image. - -# Root filesystem is mounted as ro, remount it as rw. -mount.static -o remount,rw / - -# Mount standard filesystems. -mount.static -t proc /proc /proc -mount.static -t sysfs /sys /sys -mount.static -t tmpfs -o "nosuid,size=20%,mode=0755" tmpfs /run -mkdir -p /run/lock - -# XXX devtmpfs - -# Initialize dynamic linker cache. -ldconfig /usr/lib64 /usr/lib /lib64 /lib - -# There is no hardware clock, just ensure the date is not miles out. -date `date -r /usr/bin +%m%d%H%M%Y` - -hostname stage3 -echo stage3.fedoraproject.org > /etc/hostname - -# Set up the PATH. The GCC path is a hack because I wasn't able to -# find the right flags for configuring GCC. -PATH=/usr/libexec/gcc/riscv64-unknown-linux-gnu/6.1.0:\ -/usr/local/bin:\ -/usr/local/sbin:\ -/usr/bin:\ -/usr/sbin:\ -/bin:\ -/sbin -export PATH - -echo -echo "Welcome to the Fedora/RISC-V stage3 disk image" -echo "https://fedoraproject.org/wiki/Architectures/RISC-V" -echo - -PS1='stage3:\w\$ ' -export PS1 - -# Run bash. -bash -i - -# Sync disks and shut down. -sync -poweroff diff --git a/stage1-riscv-fesvr/riscv-fesvr.spec.in b/stage1-riscv-fesvr/riscv-fesvr.spec.in deleted file mode 100644 index babac6e..0000000 --- a/stage1-riscv-fesvr/riscv-fesvr.spec.in +++ /dev/null @@ -1,54 +0,0 @@ -%global debug_package %{nil} - -Name: riscv-fesvr -Version: 0 -Release: 0.2.git@SHORTCOMMIT@%{?dist} -Summary: RISC-V front end server library -License: BSD - -URL: https://github.com/riscv/riscv-fesvr -Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz - -BuildRequires: glibc-devel - -# Workaround some problem with RPM dependency generator. -Provides: libfesvr.so()(64bit) - - -%description -This is the RISC-V front end server library. - - -%prep -%setup -q -n %{name}-@COMMIT@ - - -%build -mkdir build -pushd build -../configure --prefix=%{_prefix} --libdir=%{_libdir} -make -popd - - -%install -pushd build -make install DESTDIR=$RPM_BUILD_ROOT -popd - -# Package ignores libdir, so fix that. -mv $RPM_BUILD_ROOT%{_prefix}/lib $RPM_BUILD_ROOT%{_libdir} - - -%files -%doc README.md COPYING LICENSE -%{_bindir}/elf2hex -%{_bindir}/fesvr-eth -%{_bindir}/fesvr-rs232 -%{_bindir}/fesvr-zedboard -%{_includedir}/fesvr -%{_libdir}/libfesvr.so -%{_libdir}/pkgconfig/riscv-fesvr.pc - - -%changelog diff --git a/stage1-riscv-isa-sim/riscv-isa-sim.spec.in b/stage1-riscv-isa-sim/riscv-isa-sim.spec.in deleted file mode 100644 index d72e4d0..0000000 --- a/stage1-riscv-isa-sim/riscv-isa-sim.spec.in +++ /dev/null @@ -1,61 +0,0 @@ -%global debug_package %{nil} - -Name: riscv-isa-sim -Version: 0 -Release: 0.1.git@SHORTCOMMIT@%{?dist} -Summary: RISC-V emulator (Spike) -License: BSD - -URL: https://github.com/riscv/riscv-isa-sim -Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz - -BuildRequires: glibc-devel -BuildRequires: riscv-fesvr - -# Workaround for dependency generator. -Provides: libriscv.so()(64bit) -Provides: libspike_main.so()(64bit) -Provides: libdummy_rocc.so()(64bit) -Provides: libsoftfloat.so()(64bit) - - -%description -This is the RISC-V emulator (Spike). - - -%prep -%setup -q -n %{name}-@COMMIT@ - - -%build -mkdir build -pushd build -../configure --prefix=%{_prefix} --libdir=%{_libdir} -make -popd - - -%install -pushd build -make install DESTDIR=$RPM_BUILD_ROOT -popd - -# Package ignores libdir, so fix that. -mv $RPM_BUILD_ROOT%{_prefix}/lib $RPM_BUILD_ROOT%{_libdir} - - -%files -%doc README.md LICENSE -%{_bindir}/spike -%{_bindir}/spike-dasm -%{_bindir}/termios-xspike -%{_bindir}/xspike -%{_includedir}/spike -%{_libdir}/libdummy_rocc.so -%{_libdir}/libriscv.so -%{_libdir}/libsoftfloat.so -%{_libdir}/libspike_main.so -%{_libdir}/pkgconfig/riscv-*.pc - - -%changelog diff --git a/stage1-riscv-qemu/riscv-qemu.spec.in b/stage1-riscv-qemu/riscv-qemu.spec.in deleted file mode 100644 index 7ad5830..0000000 --- a/stage1-riscv-qemu/riscv-qemu.spec.in +++ /dev/null @@ -1,104 +0,0 @@ -%global debug_package %{nil} - -Name: riscv-qemu -Version: 2.5.0 -Release: 0.2.git@SHORTCOMMIT@%{?dist} -Summary: RISC-V fork of QEMU -License: GPLv2+ and LGPLv2+ and BSD - -URL: https://github.com/riscv/riscv-qemu -Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz - -# These were just copied from qemu.spec, they are probably not -# all required. -BuildRequires: texi2html -BuildRequires: texinfo -BuildRequires: perl-podlators -BuildRequires: qemu-sanity-check-nodeps -BuildRequires: kernel -BuildRequires: iasl -BuildRequires: chrpath -BuildRequires: SDL2-devel -BuildRequires: zlib-devel -BuildRequires: gnutls-devel -BuildRequires: cyrus-sasl-devel -BuildRequires: libaio-devel -BuildRequires: pulseaudio-libs-devel -BuildRequires: alsa-lib-devel -BuildRequires: libiscsi-devel -BuildRequires: libnfs-devel -BuildRequires: snappy-devel -BuildRequires: lzo-devel -BuildRequires: ncurses-devel -BuildRequires: libattr-devel -BuildRequires: libcap-devel -BuildRequires: libcap-ng-devel -BuildRequires: usbredir-devel >= 0.5.2 -BuildRequires: gperftools-devel -BuildRequires: spice-protocol >= 0.12.2 -BuildRequires: spice-server-devel >= 0.12.0 -BuildRequires: libseccomp-devel >= 2.3.0 -BuildRequires: libcurl-devel -BuildRequires: ceph-devel >= 0.61 -BuildRequires: systemtap -BuildRequires: systemtap-sdt-devel -BuildRequires: libjpeg-devel -BuildRequires: libpng-devel -BuildRequires: libuuid-devel -BuildRequires: bluez-libs-devel -BuildRequires: brlapi-devel -BuildRequires: libfdt-devel -BuildRequires: pixman-devel -BuildRequires: glusterfs-devel >= 3.4.0 -BuildRequires: glusterfs-api-devel >= 3.4.0 -BuildRequires: libusbx-devel -BuildRequires: libssh2-devel -BuildRequires: gtk3-devel -BuildRequires: vte3-devel -BuildRequires: gettext -BuildRequires: librdmacm-devel -BuildRequires: numactl-devel -BuildRequires: bzip2-devel -BuildRequires: libepoxy-devel -BuildRequires: libtasn1-devel -BuildRequires: libcacard-devel >= 2.5.0 -BuildRequires: virglrenderer-devel -BuildRequires: mesa-libgbm-devel -BuildRequires: glibc-static pcre-static glib2-static zlib-static - -# We don't bother packaging ancillary files; use the ones provided by -# the real QEMU. -Requires: qemu-system-x86 - -%description -This is the RISC-V fork of QEMU. - - -%prep -%setup -q -n %{name}-@COMMIT@ - - -%build -./configure --prefix=%{_prefix} --target-list=riscv-softmmu \ - --disable-xen \ - --disable-werror -make - - -%install -make install DESTDIR=$RPM_BUILD_ROOT - -# Remove ancillary files. -rm $RPM_BUILD_ROOT%{_bindir}/ivshmem* -rm $RPM_BUILD_ROOT%{_bindir}/qemu-{ga,img,io,nbd} -rm $RPM_BUILD_ROOT%{_bindir}/virtfs-proxy-helper -rm -r $RPM_BUILD_ROOT%{_libexecdir} -rm -r $RPM_BUILD_ROOT%{_datadir} - - -%files -%doc README COPYING -%{_bindir}/qemu-system-riscv - - -%changelog diff --git a/stage2-riscv-gnu-toolchain/gcc-5-fix-compilation-with-gcc-6.patch b/stage2-riscv-gnu-toolchain/gcc-5-fix-compilation-with-gcc-6.patch deleted file mode 100644 index 4e173ba..0000000 --- a/stage2-riscv-gnu-toolchain/gcc-5-fix-compilation-with-gcc-6.patch +++ /dev/null @@ -1,138 +0,0 @@ -2016-02-20 Bernd Edlinger - - Backported from mainline - 2016-02-19 Jakub Jelinek - Bernd Edlinger - - * Make-lang.in: Invoke gperf with -L C++. - * cfns.gperf: Remove prototypes for hash and libc_name_p - inlines. - * cfns.h: Regenerated. - * except.c (nothrow_libfn_p): Adjust. - -Index: gcc/cp/Make-lang.in -=================================================================== ---- gcc/cp/Make-lang.in (revision 233574) -+++ gcc/cp/Make-lang.in (working copy) -@@ -111,7 +111,7 @@ else - # deleting the $(srcdir)/cp/cfns.h file. - $(srcdir)/cp/cfns.h: - endif -- gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L ANSI-C \ -+ gperf -o -C -E -k '1-6,$$' -j1 -D -N 'libc_name_p' -L C++ \ - $(srcdir)/cp/cfns.gperf --output-file $(srcdir)/cp/cfns.h - - # -Index: gcc/cp/cfns.gperf -=================================================================== ---- gcc/cp/cfns.gperf (revision 233574) -+++ gcc/cp/cfns.gperf (working copy) -@@ -1,3 +1,5 @@ -+%language=C++ -+%define class-name libc_name - %{ - /* Copyright (C) 2000-2015 Free Software Foundation, Inc. - -@@ -16,14 +18,6 @@ for more details. - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING3. If not see - . */ --#ifdef __GNUC__ --__inline --#endif --static unsigned int hash (const char *, unsigned int); --#ifdef __GNUC__ --__inline --#endif --const char * libc_name_p (const char *, unsigned int); - %} - %% - # The standard C library functions, for feeding to gperf; the result is used -Index: gcc/cp/cfns.h -=================================================================== ---- gcc/cp/cfns.h (revision 233574) -+++ gcc/cp/cfns.h (working copy) -@@ -1,5 +1,5 @@ --/* ANSI-C code produced by gperf version 3.0.3 */ --/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */ -+/* C++ code produced by gperf version 3.0.4 */ -+/* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L C++ --output-file cfns.h cfns.gperf */ - - #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ - && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ -@@ -28,7 +28,7 @@ - #error "gperf generated tables don't work with this execution character set. Please report a bug to ." - #endif - --#line 1 "cfns.gperf" -+#line 3 "cfns.gperf" - - /* Copyright (C) 2000-2015 Free Software Foundation, Inc. - -@@ -47,26 +47,19 @@ for more details. - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING3. If not see - . */ --#ifdef __GNUC__ --__inline --#endif --static unsigned int hash (const char *, unsigned int); --#ifdef __GNUC__ --__inline --#endif --const char * libc_name_p (const char *, unsigned int); - /* maximum key range = 391, duplicates = 0 */ - --#ifdef __GNUC__ --__inline --#else --#ifdef __cplusplus --inline --#endif --#endif --static unsigned int --hash (register const char *str, register unsigned int len) -+class libc_name - { -+private: -+ static inline unsigned int hash (const char *str, unsigned int len); -+public: -+ static const char *libc_name_p (const char *str, unsigned int len); -+}; -+ -+inline unsigned int -+libc_name::hash (register const char *str, register unsigned int len) -+{ - static const unsigned short asso_values[] = - { - 400, 400, 400, 400, 400, 400, 400, 400, 400, 400, -@@ -122,14 +115,8 @@ along with GCC; see the file COPYING3. If not see - return hval + asso_values[(unsigned char)str[len - 1]]; - } - --#ifdef __GNUC__ --__inline --#ifdef __GNUC_STDC_INLINE__ --__attribute__ ((__gnu_inline__)) --#endif --#endif - const char * --libc_name_p (register const char *str, register unsigned int len) -+libc_name::libc_name_p (register const char *str, register unsigned int len) - { - enum - { -Index: gcc/cp/except.c -=================================================================== ---- gcc/cp/except.c (revision 233574) -+++ gcc/cp/except.c (working copy) -@@ -1040,7 +1040,8 @@ nothrow_libfn_p (const_tree fn) - unless the system headers are playing rename tricks, and if - they are, we don't want to be confused by them. */ - id = DECL_NAME (fn); -- return !!libc_name_p (IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id)); -+ return !!libc_name::libc_name_p (IDENTIFIER_POINTER (id), -+ IDENTIFIER_LENGTH (id)); - } - - /* Returns nonzero if an exception of type FROM will be caught by a diff --git a/stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec.in b/stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec.in deleted file mode 100644 index f58fa86..0000000 --- a/stage2-riscv-gnu-toolchain/riscv-gnu-toolchain.spec.in +++ /dev/null @@ -1,118 +0,0 @@ -%global debug_package %{nil} - -# Don't rm -rf $RPM_BUILD_ROOT at the top of install rule. -%global __spec_install_pre %{___build_pre} - -# Strip breaks the libraries, don't do it. -%global __strip /bin/true - -# Kill check-buildroot and check-rpaths. -%global __arch_install_post /bin/true - -Name: riscv-gnu-toolchain -Version: 0 -Release: 0.5.git@SHORTCOMMIT@%{?dist} -Summary: RISC-V GNU cross-toolchain, containing binutils and GCC -License: GPLv2+ and LGPLv2+ and BSD - -URL: https://github.com/riscv/riscv-qemu -Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz - -Source1: http://mirrors.kernel.org/gnu/binutils/binutils-@BINUTILS_VERSION@.tar.gz -Source2: http://mirrors.kernel.org/gnu/glibc/glibc-@GLIBC_VERSION@.tar.gz -Source3: http://mirrors.kernel.org/gnu/gcc/gcc-@GCC_VERSION@/gcc-@GCC_VERSION@.tar.gz -Source4: ftp://sourceware.org/pub/newlib/newlib-@NEWLIB_VERSION@.tar.gz - -# XXX These BuildRequires are just culled from the GCC spec -# and probably overestimate the real requirements. -BuildRequires: binutils -BuildRequires: glibc-static -BuildRequires: zlib-devel, gettext, bison, flex -BuildRequires: texinfo, texinfo-tex, /usr/bin/pod2man -BuildRequires: systemtap-sdt-devel -BuildRequires: gmp-devel, mpfr-devel, libmpc-devel -BuildRequires: hostname, procps -BuildRequires: gdb -BuildRequires: glibc-devel -BuildRequires: elfutils-devel -BuildRequires: elfutils-libelf-devel -BuildRequires: glibc -BuildRequires: glibc-devel -BuildRequires: libunwind -BuildRequires: isl -BuildRequires: isl-devel -BuildRequires: doxygen -BuildRequires: graphviz, texlive-collection-latex - - -%description -This is the RISC-V fork of the GNU cross-compiler toolchain. It -includes binutils and GCC. - - -%prep -%setup -q -n %{name}-@COMMIT@ - - -%build -# This only works if you build in a build subdirectory. -mkdir build -pushd build -../configure --prefix=%{_prefix} --libdir=%{_libdir} - -# The ordinary Makefile downloads upstream GNU packages. Instead we -# provide these as local files. Note this is "DISTDIR" not "DESTDIR". -export DISTDIR=%{_sourcedir} - -# Since the Makefile installs as it goes along, clean the buildroot -# now (instead of at the top of install). -rm -rf $RPM_BUILD_ROOT -mkdir -p $RPM_BUILD_ROOT -export DESTDIR=$RPM_BUILD_ROOT - -# We need to use the tools we built as we go along. -export PATH=$RPM_BUILD_ROOT/usr/bin:$RPM_BUILD_ROOT/bin:$PATH - -make - -# The 'make linux' rule builds GCC linked against glibc (instead of -# newlib). -# Set RISCV=...? -make linux SYSROOT=$RPM_BUILD_ROOT%{_prefix}/sysroot - -popd - - -%install -# Not needed since the make installs as it goes along. -#pushd build -#make install DESTDIR=$RPM_BUILD_ROOT -#popd - -# Remove some documentation, language files -rm -r $RPM_BUILD_ROOT%{_datadir}/info -rm -r $RPM_BUILD_ROOT%{_mandir} -rm -r $RPM_BUILD_ROOT%{_datadir}/locale - -# Remove this libtool linker file. -rm $RPM_BUILD_ROOT%{_libdir}/libcc1.la - - -%files -%doc README.md -%{_bindir}/riscv64-unknown-elf-* -%{_bindir}/riscv64-unknown-linux-gnu-* -%{_libdir}/libcc1.so -%{_libdir}/libcc1.so.0 -%{_libdir}/libcc1.so.0.0.0 -%{_libexecdir}/gcc/riscv64-unknown-elf -%{_libexecdir}/gcc/riscv64-unknown-linux-gnu -%{_prefix}/lib/gcc/riscv64-unknown-elf -%{_prefix}/lib/gcc/riscv64-unknown-linux-gnu -%{_prefix}/riscv64-unknown-elf -%{_prefix}/riscv64-unknown-linux-gnu -%{_datadir}/gcc-@GCC_VERSION@ -%{_prefix}/sysroot - - -%changelog diff --git a/stage2-riscv-pk/riscv-pk.spec.in b/stage2-riscv-pk/riscv-pk.spec.in deleted file mode 100644 index 7556624..0000000 --- a/stage2-riscv-pk/riscv-pk.spec.in +++ /dev/null @@ -1,52 +0,0 @@ -%global debug_package %{nil} - -Name: riscv-pk -Version: 0 -Release: 0.2.git@SHORTCOMMIT@%{?dist} -Summary: RISC-V proxy kernel (pk) and boot loader (bbl) -License: BSD - -URL: https://github.com/lowRISC/riscv-pk -Source0: https://github.com/riscv/%{name}/archive/@COMMIT@/%{name}-@SHORTCOMMIT@.tar.gz - -BuildRequires: riscv-gnu-toolchain - - -%description -This is the RISC-V fork of the GNU cross-compiler toolchain. It -includes binutils and GCC. - - -%prep -%setup -q -n %{name}-@COMMIT@ - - -%build -mkdir build -pushd build -# Setting RUN to /bin/true prevents pk from looking for the 'spike' -# RISC-V cycle-accurate emulator, which would be needed to run tests -# but we don't care about here. -../configure --prefix=%{_prefix} \ - --libdir=%{_libdir} \ - --host=riscv64-unknown-elf RUN=/bin/true - -make -popd - - -%install -pushd build -make install DESTDIR=$RPM_BUILD_ROOT -popd - - -%files -%doc README.md LICENSE -%{_bindir}/bbl -%{_bindir}/pk -%{_includedir}/riscv-pk -%{_prefix}/lib/riscv-pk - - -%changelog diff --git a/stage3-built-rpms/RPMS/riscv64/filesystem-3.2-37.fc24.riscv64.rpm b/stage3-built-rpms/RPMS/riscv64/filesystem-3.2-37.fc24.riscv64.rpm deleted file mode 100644 index be1cb43..0000000 Binary files a/stage3-built-rpms/RPMS/riscv64/filesystem-3.2-37.fc24.riscv64.rpm and /dev/null differ diff --git a/stage3-built-rpms/RPMS/riscv64/zlib-1.2.8-10.fc24.1.riscv64.rpm b/stage3-built-rpms/RPMS/riscv64/zlib-1.2.8-10.fc24.1.riscv64.rpm deleted file mode 100644 index a9897db..0000000 Binary files a/stage3-built-rpms/RPMS/riscv64/zlib-1.2.8-10.fc24.1.riscv64.rpm and /dev/null differ diff --git a/stage3-built-rpms/RPMS/riscv64/zlib-devel-1.2.8-10.fc24.1.riscv64.rpm b/stage3-built-rpms/RPMS/riscv64/zlib-devel-1.2.8-10.fc24.1.riscv64.rpm deleted file mode 100644 index 21f573c..0000000 Binary files a/stage3-built-rpms/RPMS/riscv64/zlib-devel-1.2.8-10.fc24.1.riscv64.rpm and /dev/null differ diff --git a/stage3-built-rpms/RPMS/riscv64/zlib-static-1.2.8-10.fc24.1.riscv64.rpm b/stage3-built-rpms/RPMS/riscv64/zlib-static-1.2.8-10.fc24.1.riscv64.rpm deleted file mode 100644 index c99676b..0000000 Binary files a/stage3-built-rpms/RPMS/riscv64/zlib-static-1.2.8-10.fc24.1.riscv64.rpm and /dev/null differ diff --git a/stage3-built-rpms/SRPMS/filesystem-3.2-37.fc25.src.rpm b/stage3-built-rpms/SRPMS/filesystem-3.2-37.fc25.src.rpm deleted file mode 100644 index 76e0a79..0000000 Binary files a/stage3-built-rpms/SRPMS/filesystem-3.2-37.fc25.src.rpm and /dev/null differ diff --git a/stage3-built-rpms/SRPMS/zlib-1.2.8-10.fc25.1.src.rpm b/stage3-built-rpms/SRPMS/zlib-1.2.8-10.fc25.1.src.rpm deleted file mode 100644 index b3e0057..0000000 Binary files a/stage3-built-rpms/SRPMS/zlib-1.2.8-10.fc25.1.src.rpm and /dev/null differ diff --git a/stage3-kernel/.exists b/stage3-kernel/.exists deleted file mode 100644 index e69de29..0000000