From: Vladimir Lettiev <crux@syktsu.ru>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: Re: [devel] I: pentium4 arch support in rpm
Date: Tue, 28 Sep 2004 17:53:04 +0400
Message-ID: <41596CC0.3020105@syktsu.ru> (raw)
In-Reply-To: <20040928124441.GE20415@immo.ru>
[-- Attachment #1: Type: text/plain, Size: 963 bytes --]
Alexey I. Froloff wrote:
> https://bugzilla.altlinux.org/show_bug.cgi?id=5259
>
> Прошу всех заинтересованых лиц протестировать. Подводный грабель
> пока найден один - не детектит Xeon, потому как я просто не знаю
> какие из ксеонов являются p3, а какие p4 (для определения
> архитектуры используется /proc/cpuinfo)...
>
> По результатам удачного тестирования можно будет начинать
> уговаривать ldv приложить этот патч, по результатам неудачного
> тестирования - аттачте патчи для патча ;-)
>
Будем последовательны. Почему бы не добавить Pentium3 ?
На самом деле, надо просто попросить всех прислать вывод /proc/cpuinfo
для разных CPU и за один раз закатать все возможные архитектуры.
Кстати у меня вот такие отпечатки на двух разных пнях3:
model name : Pentium III (Coppermine)
model name : Intel(R) Pentium(R) III CPU family 1133MHz
Как тут быть? (патч, он в атаче, под первый вариант)
--
С уважением, Владимир Леттиев aka crux <crux@syktsu.ru>
[-- Attachment #2: rpm.patch --]
[-- Type: text/x-patch, Size: 6189 bytes --]
diff -Nur rpm-4_0-4.0.4-orig/installplatform rpm-4_0-4.0.4/installplatform
--- rpm-4_0-4.0.4-orig/installplatform 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/installplatform 2004-09-28 17:16:53 +0400
@@ -35,7 +35,7 @@
ln -s ${arch}-${VENDOR}-${OS} ${DESTDIR}/${pkglibdir}/noarch-${OS}
case "$arch" in
- i[3456]86|k6|athlon) SUBSTS='s_\(i[3456]86\|k6\|athlon\)_i386_ s_\(i[3456]86\|k6\|athlon\)_i486_ s_\(i[3456]86\|k6\|athlon\)_i586_ s_\(i[3456]86\|k6\|athlon\)_i686_ s_\(i[3456]86\|k6\|athlon\)_k6_ s_\(i[3456]86\|k6\|athlon\)_athlon_' ;;
+ i[3456]86|k6|athlon|pentium3|pentium4) SUBSTS='s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_i386_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_i486_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_i586_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_i686_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_k6_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_athlon_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_pentium3_ s_\(i[3456]86\|k6\|athlon|pentium3|pentium4\)_pentium4_' ;;
alpha*) SUBSTS='s_alpha_alpha_ s_alpha_alphaev5_ s_alpha_alphaev56_ s_alpha_alphapca56_ s_alpha_alphaev6_ s_alpha_alphaev67_' ;;
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\([^6]\|$\)_ppc64\1_' ;;
diff -Nur rpm-4_0-4.0.4-orig/lib/rpmrc.c rpm-4_0-4.0.4/lib/rpmrc.c
--- rpm-4_0-4.0.4-orig/lib/rpmrc.c 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/lib/rpmrc.c 2004-09-28 17:19:03 +0400
@@ -1031,7 +1031,7 @@
}
#endif
-static const char *checkAMD( void )
+static const char *checkCPU( void )
{
int fd = open( "/proc/cpuinfo", O_RDONLY );
if ( !fd )
@@ -1044,14 +1044,21 @@
read( fd, buffer, sizeof buffer - 1 );
close( fd );
- if ( !strstr( buffer, "AMD" ) )
- return 0;
+ if ( strstr( buffer, "AMD" ) ) {
+ if ( strstr( buffer, "Athlon" ) || strstr( buffer, "Duron" ) )
+ return "athlon";
- if ( strstr( buffer, "Athlon" ) || strstr( buffer, "Duron" ) )
- return "athlon";
+ if ( strstr( buffer, "K6" ) )
+ return "k6";
+ }
- if ( strstr( buffer, "K6" ) )
- return "k6";
+ if ( strstr( buffer, "Intel" ) ) {
+ if ( strstr( buffer, "Pentium III" ) )
+ return "pentium3";
+ /* XXX: check for Xeon(R) */
+ if ( strstr( buffer, "Pentium(R) 4" ) )
+ return "pentium4";
+ }
return 0;
}
@@ -1290,9 +1297,9 @@
if ( !strcmp( un.machine, "i586" ) || !strcmp( un.machine, "i686" ) )
{
- const char *amd = checkAMD();
- if ( amd )
- strcpy( un.machine, amd );
+ const char *cpu = checkCPU();
+ if ( cpu )
+ strcpy( un.machine, cpu );
}
# endif
diff -Nur rpm-4_0-4.0.4-orig/macros.in rpm-4_0-4.0.4/macros.in
--- rpm-4_0-4.0.4-orig/macros.in 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/macros.in 2004-09-28 17:21:11 +0400
@@ -812,7 +812,7 @@
# rpm can use regular expressions against target platforms in macro
# conditionals.
#
-%intel i386 i486 i586 i686 i786 i886 i986
+%intel i386 i486 i586 i686 i786 i886 i986 pentium3 pentium4
%amd k6 athlon
%ix86 %intel %amd
diff -Nur rpm-4_0-4.0.4-orig/Makefile.am rpm-4_0-4.0.4/Makefile.am
--- rpm-4_0-4.0.4-orig/Makefile.am 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/Makefile.am 2004-09-28 17:21:58 +0400
@@ -140,7 +140,9 @@
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i486 ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i586 ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/i686 ;\
- $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;;\
+ $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/athlon ;\
+ $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium3 ;\
+ $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/pentium4 ;;\
alpha*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alpha ;\
$(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/alphaev6 ;;\
sparc*) $(mkinstalldirs) $(DESTDIR)$(pkgsrcdir)/RPMS/sparc ;\
diff -Nur rpm-4_0-4.0.4-orig/rpmrc.in rpm-4_0-4.0.4/rpmrc.in
--- rpm-4_0-4.0.4-orig/rpmrc.in 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/rpmrc.in 2004-09-28 17:25:27 +0400
@@ -17,6 +17,8 @@
optflags: i686 %optflags_default -march=i686
optflags: k6 %optflags_default -march=k6
optflags: athlon %optflags_default -march=athlon
+optflags: pentium3 %optflags_default -march=pentium3
+optflags: pentium4 %optflags_default -march=pentium4
optflags: ia64 %optflags_default
# XXX Please note that -mieee has been added in rpm-3.0.5.
@@ -67,6 +69,8 @@
#############################################################
# Canonical arch names and numbers
+arch_canon: pentium4: pentium4 1
+arch_canon: pentium3: pentium3 1
arch_canon: athlon: athlon 1
arch_canon: i686: i686 1
arch_canon: k6: k6 1
@@ -164,6 +168,8 @@
buildarchtranslate: ia64: ia64
+buildarchtranslate: pentium4: pentium4
+buildarchtranslate: pentium3: pentium3
buildarchtranslate: athlon: athlon
buildarchtranslate: i686: i686
buildarchtranslate: k6: k6
@@ -210,6 +216,8 @@
arch_compat: alphaev5: alpha
arch_compat: alpha: axp noarch
+arch_compat: pentium4: i686
+arch_compat: pentium3: i686
arch_compat: athlon: i686 k6
arch_compat: i686: i586
arch_compat: k6: i586
@@ -297,6 +305,8 @@
buildarch_compat: ia64: noarch
+buildarch_compat: pentium4: i686
+buildarch_compat: pentium3: i686
buildarch_compat: athlon: i686 k6
buildarch_compat: i686: i586
buildarch_compat: k6: i586
diff -Nur rpm-4_0-4.0.4-orig/rpm.spec.in rpm-4_0-4.0.4/rpm.spec.in
--- rpm-4_0-4.0.4-orig/rpm.spec.in 2004-09-28 17:13:56 +0400
+++ rpm-4_0-4.0.4/rpm.spec.in 2004-09-28 17:26:31 +0400
@@ -355,9 +355,11 @@
%attr(0644, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/rpmpopt*
%attr(0644, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/rpmrc
-%ifarch i386 i486 i586 i686 athlon
+%ifarch i386 i486 i586 i686 athlon pentium3 pentium4
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/i[3456]86*
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/athlon*
+%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/pentium3*
+%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/pentium4*
%endif
%ifarch alpha alphaev5 alphaev56 alphapca56 alphaev6 alphaev67
%attr(-, @RPMUSER@, @RPMGROUP@) %{__prefix}/lib/rpm/alpha*
next prev parent reply other threads:[~2004-09-28 13:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-28 12:44 Alexey I. Froloff
2004-09-28 13:53 ` Vladimir Lettiev [this message]
2004-09-28 14:16 ` Aleksey Avdeev
2004-09-29 5:36 ` Genix
2004-09-29 7:40 ` Aleksey Avdeev
2004-09-29 8:13 ` Aleksey Avdeev
2004-09-30 12:52 ` vserge
2004-09-30 18:02 ` Valery V. Inozemtsev
2004-09-30 18:33 ` Re[2]: " Volkov Serge
2004-10-01 9:19 ` vserge
2004-09-28 14:36 ` Andrey Rahmatullin
2004-09-28 19:53 ` Денис Смирнов
2004-09-29 10:00 ` Alexey I. Froloff
2004-09-29 10:29 ` Aleksey Avdeev
2004-10-04 12:00 ` Anton Farygin
2004-10-04 12:07 ` Alexey I. Froloff
2004-10-04 12:25 ` Sergey Vlasov
2004-10-04 12:37 ` Anton Farygin
2004-10-04 12:51 ` Sergey Vlasov
2004-10-04 13:12 ` Anton Farygin
2004-10-04 13:40 ` Sergey Vlasov
2004-09-28 14:12 ` [devel] Re: [sisyphus] " Alexey I. Froloff
2004-09-28 14:47 ` Alexey I. Froloff
2004-09-28 17:11 ` Alexey I. Froloff
2004-09-29 8:38 ` Vital Khilko
2004-09-29 9:13 ` Alexey I. Froloff
2004-10-04 11:47 ` [devel] " Anton Farygin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41596CC0.3020105@syktsu.ru \
--to=crux@syktsu.ru \
--cc=devel@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git