rest of the ix86 patch
Ulrich Drepper
drepper@cygnus.com
Wed Apr 8 02:13:00 GMT 1998
Hi,
Richard already applied most of the ix86 patch I sent last week. This
is the rest:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: config/i386/i386.h
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/config/i386/i386.h,v
retrieving revision 1.17
diff -u -r1.17 i386.h
--- i386.h 1998/04/04 20:25:41 1.17
+++ i386.h 1998/04/08 00:53:05
@@ -304,36 +304,30 @@
%{mpentiumpro:-mcpu=pentiumpro}}"
#endif
-#ifndef CPP_CPU_SPEC
-#ifdef __STDC__
+#ifndef CPP_CPU_DEFAULT_SPEC
#if TARGET_CPU_DEFAULT == 1
-#define CPP_CPU_DEFAULT "-Di486"
+#define CPP_CPU_DEFAULT_SPEC "-Di486"
#else
#if TARGET_CPU_DEFAULT == 2
-#define CPP_CPU_DEFAULT "-Di586"
+#define CPP_CPU_DEFAULT_SPEC "-Dpentium -Di586"
#else
#if TARGET_CPU_DEFAULT == 3
-#define CPP_CPU_DEFAULT "-Di686"
+#define CPP_CPU_DEFAULT_SPEC "-Dpentiumpro -Di686"
#else
-#define CPP_CPU_DEFAULT ""
+#define CPP_CPU_DEFAULT_SPEC ""
#endif
#endif
-#endif /* TARGET_CPU_DEFAULT */
-
-#define CPP_CPU_SPEC "\
--Di386 " CPP_CPU_DEFAULT " -Asystem(unix) -Acpu(i386) -Amachine(i386) \
-%{mcpu=i486:-Di486} %{m486:-Di486} \
-%{mpentium:-Dpentium -Di586} %{mcpu=pentium:-Dpentium -Di586} \
-%{mpentiumpro:-Dpentiumpro -Di686} %{mcpu=pentiumpro:-Dpentiumpro -Di686}"
+#endif
+#endif /* CPP_CPU_DEFAULT_SPEC */
-#else
+#ifndef CPP_CPU_SPEC
#define CPP_CPU_SPEC "\
-Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) \
%{mcpu=i486:-Di486} %{m486:-Di486} \
%{mpentium:-Dpentium -Di586} %{mcpu=pentium:-Dpentium -Di586} \
-%{mpentiumpro:-Dpentiumpro -Di686} %{mcpu=pentiumpro:-Dpentiumpro -Di686}"
-#endif /* __STDC__ */
-#endif /* CPP_CPU_SPEC */
+%{mpentiumpro:-Dpentiumpro -Di686} %{mcpu=pentiumpro:-Dpentiumpro -Di686} \
+%{!mcpu:%{!m486:%{!mpentium*: %(cpp_cpu_default)}}}"
+#endif
#ifndef CC1_SPEC
#define CC1_SPEC "%(cc1_spec) "
@@ -354,6 +348,7 @@
#endif
#define EXTRA_SPECS \
+ { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
{ "cpp_cpu", CPP_CPU_SPEC }, \
{ "cc1_cpu", CC1_CPU_SPEC }, \
SUBTARGET_EXTRA_SPECS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*BUT* this is not really correct since gcc cannot handle this
%{!mcpu:%{!m486:%{!mpentium*: %(cpp_cpu_default)}}}
correctly. The problem is that gcc runs over the string a second
time, adding __*__ to the defines. But it does so before the %(...)
expressions are expanded (at least this is how I explain me the
output). So I get
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc version egcs-2.91.16 980328 (gcc-2.8.0 release)
/happy/clown/H-egcs-i686-linux-gnu/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.16/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) -Dpentiumpro -Di686 -D__i386__ -Asystem(unix) -Acpu(i386) -Amachine(i386) -Dpentiumpro -Di686 u.c /tmp/cca00342.i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
instead of
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc version egcs-2.91.16 980328 (gcc-2.8.0 release)
/happy/clown/H-egcs-i686-linux-gnu/lib/gcc-lib/i686-pc-linux-gnu/egcs-2.91.16/cpp -lang-c -v -undef -D__GNUC__=2 -D__GNUC_MINOR__=91 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386) -Dpentiumpro -Di686 -D__i386__ -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__pentiumpro__ -D__i686__ u.c /tmp/cca00342.i
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(Please note the last two -D parameters).
I think the solution for this problem is to expand the string before
generating the __*__ protected names. I don't know where this happens
so if somebody knows more about this please step ahead :-). Otherwise
I'd appreciate pointers.
-- Uli
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------
More information about the Gcc
mailing list