[fedora-arm] [patch,rfc] assorted changes for arm

Lennert Buytenhek buytenh at wantstofly.org
Thu Jun 21 11:59:53 UTC 2007


(please CC on replies, not on rpm-maint@)

Hi,

Attached is a diff against rpm 4.4.2 that updates the arm arch
support in rpm somewhat.  In particular, it adds more ARM sub-archs,
and adds some bits to deal properly with the new ARM ABI (EABI).

Various patches along these lines have existed in the past few
years, this particular one is what the (unofficial) Fedora ARM effort
uses.  Comments welcome!


thanks,
Lennert



Index: rpm-4.4.2/Makefile.am
===================================================================
--- rpm-4.4.2.orig/Makefile.am
+++ rpm-4.4.2/Makefile.am
@@ -165,6 +165,12 @@ install-data-local:
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
 	alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
+	arm*)	$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
 	sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
Index: rpm-4.4.2/Makefile.in
===================================================================
--- rpm-4.4.2.orig/Makefile.in
+++ rpm-4.4.2/Makefile.in
@@ -1224,6 +1224,12 @@ install-data-local:
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
 	alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
+	arm*)	$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv3l ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4l ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv4tl ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tel ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv5tejl ;\
+		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/armv6l ;;\
 	sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv8 ;\
 		$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparcv9 ;\
Index: rpm-4.4.2/config.guess
===================================================================
--- rpm-4.4.2.orig/config.guess
+++ rpm-4.4.2/config.guess
@@ -809,7 +809,14 @@ EOF
 	echo ${UNAME_MACHINE}-pc-minix
 	exit 0 ;;
     arm*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+		| grep __ARM_EABI__ >/dev/null
+	then
+		echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnu
+	else
+		echo ${UNAME_MACHINE}-${VENDOR:-unknown}-linux-gnueabi
+	fi
 	exit 0 ;;
     cris:Linux:*:*)
 	echo cris-axis-linux-gnu
Index: rpm-4.4.2/configure.ac
===================================================================
--- rpm-4.4.2.orig/configure.ac
+++ rpm-4.4.2/configure.ac
@@ -1206,6 +1206,9 @@ fi
 if echo "$build_os" | grep '.*-gnulibc1' > /dev/null ; then
 	build_os=`echo "${build_os}" | sed 's/-gnulibc1$//'`
 fi
+if echo "$build_os" | grep '.*-gnueabi' > /dev/null ; then
+	build_os=`echo "${build_os}" | sed 's/-gnueabi$//'`
+fi
 if echo "$build_os" | grep '.*-gnu' > /dev/null ; then
 	build_os=`echo "${build_os}" | sed 's/-gnu$//'`
 fi
@@ -1277,10 +1280,7 @@ s390x*)		RPMCANONCOLOR=3; RPMCANONARCH=s
 s390*)		RPMCANONCOLOR=0; RPMCANONARCH=s390 ;;
 powerpc64*|ppc64*)	RPMCANONCOLOR=3; RPMCANONARCH=ppc64 ;;
 powerpc*|ppc*)	RPMCANONCOLOR=0; RPMCANONARCH=ppc ;;
-armv3l*)	RPMCANONCOLOR=0; RPMCANONARCH=armv3l ;;
-armv4l*)	RPMCANONCOLOR=0; RPMCANONARCH=armv4l ;;
-armv4b*)	RPMCANONCOLOR=0; RPMCANONARCH=armv4b ;;
-arm*)		RPMCANONCOLOR=0; RPMCANONARCH="${build_cpu}" ;;
+arm*)		RPMCANONCOLOR=0; RPMCANONARCH=arm ;;
 mipsel*)	RPMCANONCOLOR=0; RPMCANONARCH=mipsel ;;
 mips*)		RPMCANONCOLOR=0; RPMCANONARCH=mips ;;
 m68k*)		RPMCANONCOLOR=0; RPMCANONARCH=m68k ;;
Index: rpm-4.4.2/installplatform
===================================================================
--- rpm-4.4.2.orig/installplatform
+++ rpm-4.4.2/installplatform
@@ -21,7 +21,7 @@ E_O_F
 
 RPM="./rpm --rcfile $TEMPRC"
 
-canonarch_sed='s_i.86_i386_;s_pentium[34]_i386_;s_athlon_i386_;s_sparc[^-]*_sparc_;s_alpha[^-]*_alpha_;s_\(powerpc\|ppc\)[^-]*_ppc_'
+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_'
 arch="`$RPM --eval '%{_arch}'|sed -e "$canonarch_sed"`"
 VENDOR="`$RPM --eval '%{_vendor}'`"
 OS="`$RPM --eval '%{_os}'`"
@@ -32,6 +32,7 @@ target="`$RPM --eval '%{_target}'|sed -e
 case "$arch" in
   i[3456]86|pentium[34]|athlon) SUBSTS='s_i386_i386_ s_i386_i486_ s_i386_i586_ s_i386_i686_ s_i386_pentium3_ s_i386_pentium4_ s_i386_athlon_' ;;
   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_arm4l_ s_arm_armv4tl_ s_arm_armv5tel_ s_arm_armv5tejl_ s_arm_armv6l_' ;;
   sparc*) SUBSTS='s_sparc\(64\|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_' ;;
Index: rpm-4.4.2/lib/rpmts.c
===================================================================
--- rpm-4.4.2.orig/lib/rpmts.c
+++ rpm-4.4.2/lib/rpmts.c
@@ -236,7 +236,7 @@ static int isArch(const char * arch)
 	"m68k",
 	"rs6000",
 	"ia64",
-	"armv3l", "armv4b", "armv4l",
+	"armv3l", "armv4b", "armv4l", "armv4tl", "armv5tel", "armv5tejl", "armv6l",
 	"s390", "i370", "s390x",
 	"sh", "xtensa",
 	"noarch",
Index: rpm-4.4.2/macros.in
===================================================================
--- rpm-4.4.2.orig/macros.in
+++ rpm-4.4.2/macros.in
@@ -1260,6 +1260,10 @@ done \
 #
 %ix86   i386 i486 i586 i686 pentium3 pentium4 athlon
 
+#------------------------------------------------------------------------------
+# arch macro for all supported ARM processors
+%arm	armv3l armv4b armv4l armv4tl armv5tel armv5tejl armv6l
+
 #------------------------------------------------------------------------
 # Use in %install to generate locale specific file lists. For example,
 #
Index: rpm-4.4.2/rpm.spec.in
===================================================================
--- rpm-4.4.2.orig/rpm.spec.in
+++ rpm-4.4.2/rpm.spec.in
@@ -331,8 +331,8 @@ exit 0
 %ifarch s390 s390x
 %attr(-, @RPMUSER@, @RPMGROUP@)		%{__prefix}/lib/rpm/s390*
 %endif
-%ifarch armv3l armv4l
-%attr(-, @RPMUSER@, @RPMGROUP@)		%{__prefix}/lib/rpm/armv[34][lb]*
+%ifarch %{arm}
+%attr(-, @RPMUSER@, @RPMGROUP@)		%{__prefix}/lib/rpm/arm*
 %endif
 %ifarch mips mipsel
 %attr(-, @RPMUSER@, @RPMGROUP@)		%{__prefix}/lib/rpm/mips*
Index: rpm-4.4.2/rpmrc.in
===================================================================
--- rpm-4.4.2.orig/rpmrc.in
+++ rpm-4.4.2/rpmrc.in
@@ -58,9 +58,13 @@ optflags: hppa2.0 -O2 -g -mpa-risc-1-0
 optflags: mips -O2 -g
 optflags: mipsel -O2 -g
 
-optflags: armv3l -O2 -g -fsigned-char -fomit-frame-pointer -march=armv3
-optflags: armv4b -O2 -g -fsigned-char -fomit-frame-pointer -march=armv4
-optflags: armv4l -O2 -g -fsigned-char -fomit-frame-pointer -march=armv4
+optflags: armv3l -O2 -g -march=armv3
+optflags: armv4b -O2 -g -march=armv4
+optflags: armv4l -O2 -g -march=armv4
+optflags: armv4tl -O2 -g -march=armv4t
+optflags: armv5tel -O2 -g -march=armv5te
+optflags: armv5tejl -O2 -g -march=armv5te
+optflags: armv6l -O2 -g -march=armv6
 
 optflags: atarist -O2 -g -fomit-frame-pointer
 optflags: atariste -O2 -g -fomit-frame-pointer
@@ -124,6 +128,9 @@ arch_canon:	mipsel:	mipsel	11
 arch_canon:	armv3l: armv3l	12
 arch_canon:     armv4b:	armv4b 	12
 arch_canon:     armv4l:	armv4l 	12
+arch_canon:     armv5tel: armv5tel 	12
+arch_canon:     armv5tejl: armv5tejl 	12
+arch_canon:     armv6l: armv6l 	12
 
 arch_canon:	m68kmint: m68kmint	13
 arch_canon:	atarist: m68kmint	13
@@ -218,6 +225,14 @@ buildarchtranslate: ppcpseries: ppc
 buildarchtranslate: ppc64iseries: ppc64
 buildarchtranslate: ppc64pseries: ppc64
 
+buildarchtranslate: armv3l: armv3l
+buildarchtranslate: armv4b: armv4b
+buildarchtranslate: armv4l: armv4l
+buildarchtranslate: armv4tl: armv4tl
+buildarchtranslate: armv5tel: armv5tel
+buildarchtranslate: armv5tejl: armv4tejl
+buildarchtranslate: armv6l: armv6l
+
 buildarchtranslate: atarist: m68kmint
 buildarchtranslate: atariste: m68kmint
 buildarchtranslate: ataritt: m68kmint
@@ -291,6 +306,10 @@ arch_compat: hppa1.0: parisc
 arch_compat: parisc: noarch
 
 arch_compat: armv4b: noarch
+arch_compat: armv6l: armv5tejl
+arch_compat: armv5tejl: armv5tel
+arch_compat: armv5tel: armv4tl
+arch_compat: armv4tl: armv4l
 arch_compat: armv4l: armv3l
 arch_compat: armv3l: noarch
 
@@ -381,9 +400,13 @@ buildarch_compat: ppc64iseries: ppc64
 buildarch_compat: mips: noarch
 buildarch_compat: mipsel: noarch
 
-buildarch_compat: armv3l: noarch
 buildarch_compat: armv4b: noarch
-buildarch_compat: armv4l: noarch
+buildarch_compat: armv6l: armv5tejl
+buildarch_compat: armv5tejl: armv5tel
+buildarch_compat: armv5tel: armv4tl
+buildarch_compat: armv4tl: armv4l
+buildarch_compat: armv4l: armv3l
+buildarch_compat: armv3l: noarch
 
 buildarch_compat: hppa2.0: hppa1.2
 buildarch_compat: hppa1.2: hppa1.1




More information about the arm mailing list