Bug 432496

Summary: Add super-H(sh3,4) arche support.
Product: [Fedora] Fedora Reporter: CHIKAMA Masaki <masaki.chikama>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: pnasrat
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: sh4   
OS: Linux   
Whiteboard:
Fixed In Version: rpm-4.4.2.3-1.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-10-22 10:14:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch to compile on sh3,4
none
msync before munmap patch
none
rpm-spec-sh.diff none

Description CHIKAMA Masaki 2008-02-12 12:46:13 UTC
Description of problem:
 These two patches add support super-H(sh3,sh4) architecture.
They are forward ported patches for version 4.4.2.3-rc1 
getting from http://www.sh-linux.org/ .

The first one enables to compile on sh architecture and
add some definition for sh3,4 .

The second one has been there since around 2004. I don't know the 
effect of the patch and I(we?) need more evaluation. May be... 
it prevents some old kernel's bug.

Comment 1 CHIKAMA Masaki 2008-02-12 12:46:13 UTC
Created attachment 294651 [details]
patch to compile on sh3,4

Comment 2 CHIKAMA Masaki 2008-02-12 12:47:24 UTC
Created attachment 294652 [details]
msync before munmap patch

Comment 3 CHIKAMA Masaki 2008-02-12 15:42:12 UTC
Created attachment 294668 [details]
rpm-spec-sh.diff

proposed patch for rpm.spec file.

Comment 4 CHIKAMA Masaki 2008-03-05 12:01:54 UTC
Comment on attachment 294651 [details]
patch to compile on sh3,4

>diff -ur rpm-4.4.2.3-rc1.org/configure rpm-4.4.2.3-rc1/configure
>--- rpm-4.4.2.3-rc1.org/configure	2008-01-25 20:09:50.000000000 +0900
>+++ rpm-4.4.2.3-rc1/configure	2008-02-12 19:50:06.000000000 +0900
>@@ -36291,6 +36291,8 @@
> mipsel*)	RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
> mips*)		RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
> m68k*)		RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
>+sh3*)		RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
>+sh4*)		RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
> *)		RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
> esac
> case "${build_os_noversion}" in
>diff -ur rpm-4.4.2.3-rc1.org/configure.ac rpm-4.4.2.3-rc1/configure.ac
>--- rpm-4.4.2.3-rc1.org/configure.ac	2008-01-25 20:06:06.000000000 +0900
>+++ rpm-4.4.2.3-rc1/configure.ac	2008-02-12 19:50:06.000000000 +0900
>@@ -1218,6 +1218,8 @@
> mipsel*)	RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
> mips*)		RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
> m68k*)		RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
>+sh3*)		RPMCANONCOLOR=0; RPMCANONARCH=sh3 ;;
>+sh4*)		RPMCANONCOLOR=0; RPMCANONARCH=sh4 ;;
> *)		RPMCANONCOLOR=0; RPMCANONARCH=unknown ;;
> esac
> case "${build_os_noversion}" in
>diff -ur rpm-4.4.2.3-rc1.org/installplatform rpm-4.4.2.3-rc1/installplatform
>--- rpm-4.4.2.3-rc1.org/installplatform	2008-01-25 19:26:02.000000000 +0900
>+++ rpm-4.4.2.3-rc1/installplatform	2008-02-12 19:55:49.000000000 +0900
>@@ -21,7 +21,7 @@
> 
> RPM="./rpm --rcfile $TEMPRC"
> 
>-canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_arm[^-]*_arm_;s_\(powerpc\|ppc\)[^-]*_ppc_;s,\(ia32e\|amd64\),x86_64,'
>+canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_arm[^-]*_arm_;s_\(powerpc\|ppc\)[^-]*_ppc_;s,\(ia32e\|amd64\),x86_64,;s_sh4a_sh4_'
> arch="`$RPM --eval '%{_arch}'|sed -e "$canonarch_sed"`"
> VENDOR="`$RPM --eval '%{_vendor}'`"
> OS="`$RPM --eval '%{_os}'`"
>@@ -33,6 +33,7 @@
>   i[3456]86|pentium[34]|athlon|geode) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_pentium3_ s_i386_pentium4_ s_i386_athlon_ s_i386_geode_' ;;
>   alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
>   arm*) SUBSTS='s_arm_armv3l_ s_arm_armv4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_' ;;
>+  sh4*) SUBSTS='s_sh4_sh4_ s_sh4_sh4a_' ;;
>   sparc*) SUBSTS='s_sparc\(64\|64v\|v9v\|v9\)_sparc_ s_sparc64_sparcv9_;s_sparc\([^v]\|$\)_sparcv9\1_ s_sparcv9_sparc64_;s_sparc\([^6]\|$\)_sparc64\1_' ;;
>   powerpc*|ppc*) SUBSTS='s_ppc64_ppc_ s_ppc\([^6ip]\|$\)_ppc64\1_ s_ppc\([^6ip]\|$\)_ppciseries_ s_ppc\([^6ip]\|$\)_ppcpseries_ s_ppc\([^6ip]\|$\)_ppc64iseries_ s_ppc\([^6ip]\|$\)_ppc64pseries_' ;;
>   s390*) SUBSTS='s_s390x_s390_ s_s390\([^x]\|$\)_s390x\1_' ;;
>Only in rpm-4.4.2.3-rc1: installplatform.rej
>diff -ur rpm-4.4.2.3-rc1.org/rpmrc.in rpm-4.4.2.3-rc1/rpmrc.in
>--- rpm-4.4.2.3-rc1.org/rpmrc.in	2008-01-25 18:46:22.000000000 +0900
>+++ rpm-4.4.2.3-rc1/rpmrc.in	2008-02-12 19:50:06.000000000 +0900
>@@ -80,6 +80,10 @@
> optflags: s390 -O2 -g -m31
> optflags: s390x -O2 -g -m64
> 
>+optflags: sh3 -O2 -g
>+optflags: sh4 -O2 -g -mieee
>+optflags: sh4a -O2 -g -mieee
>+
> #############################################################
> # Canonical arch names and numbers
> 
>@@ -156,6 +160,9 @@
> arch_canon:    ppc64iseries: ppc64iseries  16
> 
> arch_canon:	sh: sh		17
>+arch_canon:	sh3: sh3	17
>+arch_canon:	sh4: sh4	17
>+arch_canon:	sh4a: sh4a	17
> arch_canon:	xtensa: xtensa	18
> 
> #############################################################
>@@ -259,6 +266,10 @@
> buildarchtranslate: amd64: x86_64
> buildarchtranslate: ia32e: x86_64
> 
>+buildarchtranslate: sh3: sh3
>+buildarchtranslate: sh4: sh4
>+buildarchtranslate: sh4a: sh4
>+
> #############################################################
> # Architecture compatibility
> 
>@@ -343,6 +354,10 @@
> arch_compat: amd64: x86_64 athlon noarch
> arch_compat: ia32e: x86_64 athlon noarch
> 
>+arch_compat: sh3: noarch
>+arch_compat: sh4: noarch
>+arch_compat: sh4a: sh4
>+
> 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
>@@ -447,6 +462,10 @@
> buildarch_compat: amd64: x86_64
> buildarch_compat: ia32e: x86_64
> 
>+buildarch_compat: sh3: noarch
>+buildarch_compat: sh4: noarch
>+buildarch_compat: sh4a: sh4
>+
> macrofiles:	@RPMCONFIGDIR@/macros:@RPMCONFIGDIR@/%{_target}/macros:@SYSCONFIGDIR@/macros.*:@SYSCONFIGDIR@/macros:@SYSCONFIGDIR@/%{_target}/macros:~/.rpmmacros
> 
> # \endverbatim

Comment 5 CHIKAMA Masaki 2008-03-05 12:05:50 UTC
Sorry for big comment sending.

The change is adding "-mieee" option to "optflags" for sh4 and sh4a.
With this option, some packages(perl,mprf) can pass self test.
 

Comment 6 CHIKAMA Masaki 2008-03-05 12:07:57 UTC
Comment on attachment 294652 [details]
msync before munmap patch

I withdraw this patch.
I don't have a problem without this patch until now.

Comment 7 Panu Matilainen 2008-04-01 08:19:34 UTC
Applied upstream (without the msync patch), thanks for the patch.
rpm-4.4.2.3-1.fc9 in rawhide now.

Comment 8 CHIKAMA Masaki 2008-04-07 09:21:15 UTC
Thanks. But there are two missings.

1. Please update rpm.spec file like bellow. 

@@ -315,6 +319,12 @@
 %{rpmhome}/amd64*
 %{rpmhome}/ia32e*
 %endif
+%ifarch sh3
+%{rpmhome}/sh3*
+%endif
+%ifarch sh4
+%{rpmhome}/sh4*
+%endif
 %{rpmhome}/noarch*
 
 %{_mandir}/man1/gendiff.1*

2. Please add "-mieee" option to "optflags" in rpm-4.4.2.3-rc1/rpmrc.in

--- rpm-4.4.2.3-rc1.org/rpmrc.in	2008-01-25 18:46:22.000000000 +0900
+++ rpm-4.4.2.3-rc1/rpmrc.in	2008-02-12 19:50:06.000000000 +0900
@@ -80,6 +80,10 @@
 optflags: s390 -O2 -g -m31
 optflags: s390x -O2 -g -m64
 
+optflags: sh3 -O2 -g
+optflags: sh4 -O2 -g -imeee
+optflags: sh4a -O2 -g -imeee


Comment 9 Bug Zapper 2008-05-14 05:09:05 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 CHIKAMA Masaki 2008-10-22 10:14:32 UTC
Handled by Bug #467992.