From: Richard W.M. Jones Date: Tue, 9 Aug 2016 17:27:01 +0000 (+0100) Subject: Patch RPM with initial riscv64 support. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;ds=sidebyside;h=0458a4a2ee443480f0a0ab027f53e1fee7b60522;p=fedora-riscv.git Patch RPM with initial riscv64 support. --- diff --git a/rpm-hacks.patch b/0001-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch similarity index 82% rename from rpm-hacks.patch rename to 0001-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch index d4921d2..a73b122 100644 --- a/rpm-hacks.patch +++ b/0001-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch @@ -1,3 +1,12 @@ +From d6940aecfc237d215c3c067c16b386885ecd9ca8 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 9 Aug 2016 18:21:57 +0100 +Subject: [PATCH 1/2] 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 @@ -51,3 +60,6 @@ index e2d5ec3..3f94742 100644 #================= # Process --with/without-external-db +-- +2.7.4 + diff --git a/0002-RISCV-64-bit-riscv64-support.patch b/0002-RISCV-64-bit-riscv64-support.patch new file mode 100644 index 0000000..26ab199 --- /dev/null +++ b/0002-RISCV-64-bit-riscv64-support.patch @@ -0,0 +1,94 @@ +From d34904540ecaabbcbfff8e99dc4c831b39f4ea32 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Tue, 9 Aug 2016 18:25:24 +0100 +Subject: [PATCH 2/2] 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..5b9b71d 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: riscv64: 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/Makefile b/Makefile index 228d045..e953bcb 100644 --- a/Makefile +++ b/Makefile @@ -639,7 +639,8 @@ stage3-chroot/usr/bin/rpm: rpm-$(RPM_SHORT_COMMIT).tar.gz db-$(BDB_VERSION).tar. 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 < ../rpm-hacks.patch + cd rpm-$(RPM_SHORT_COMMIT) && patch -p1 < ../0001-HACKS-TO-GET-RPM-TO-CROSS-COMPILE.patch + cd rpm-$(RPM_SHORT_COMMIT) && patch -p1 < ../0002-RISCV-64-bit-riscv64-support.patch cd rpm-$(RPM_SHORT_COMMIT) && autoreconf -i cd rpm-$(RPM_SHORT_COMMIT) && \ PATH=$(ROOT)/fixed-gcc:$$PATH \