aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/icedtea/icedtea6-native-1.7.5/icedtea-hotspot-make-arch-sane-for-x86.patch
blob: 9d7b9bbecd389e6a246a1aaf6ada76e9bcb08686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
From b8a51665ada45e3beb0823c03c025d5514f5e745 Mon Sep 17 00:00:00 2001
From: woglinde <woglinde@rhein.zuhause.netz>
Date: Thu, 22 Oct 2009 16:35:25 +0200
Subject: [PATCH] hotspot: make arch sane for x86

diff --git openjdk/hotspot/agent/make/saenv.sh openjdk/hotspot/agent/make/saenv.sh
index 38e0f78..64c8410 100644
--- openjdk/hotspot/agent/make/saenv.sh
+++ openjdk/hotspot/agent/make/saenv.sh
@@ -43,9 +43,9 @@ if [ "$OS" = "Linux" ]; then
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
      CPU=amd64
    else
-     SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
+     SA_LIBPATH=$STARTDIR/../src/os/linux/x86:$STARTDIR/linux/x86
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
-     CPU=i386
+     CPU=x86
    fi
 else
    SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
diff --git openjdk/hotspot/make/defs.make openjdk/hotspot/make/defs.make
index 83ddd1a..c20c7eb 100644
--- openjdk/hotspot/make/defs.make
+++ openjdk/hotspot/make/defs.make
@@ -207,7 +207,7 @@ ifneq ($(OSNAME),windows)
     ifdef LP64
       BUILDARCH = amd64
     else
-      BUILDARCH = i486
+      BUILDARCH = x86
     endif
   endif
   ifeq ($(BUILDARCH), sparc)
@@ -218,7 +218,7 @@ ifneq ($(OSNAME),windows)
 
   # LIBARCH is 1:1 mapping from BUILDARCH
   LIBARCH         = $(LIBARCH/$(BUILDARCH))
-  LIBARCH/i486    = i386
+  LIBARCH/x86     = x86
   LIBARCH/amd64   = amd64
   LIBARCH/sparc   = sparc
   LIBARCH/sparcv9 = sparcv9
diff --git openjdk/hotspot/make/jprt.config openjdk/hotspot/make/jprt.config
index bc82543..4a1ef4e 100644
--- openjdk/hotspot/make/jprt.config
+++ openjdk/hotspot/make/jprt.config
@@ -111,7 +111,7 @@ elif [ "${osname}" = Linux ] ; then
     # LINUX: X86, AMD64
     osarch=`uname -m`
     if [ "${osarch}" = i686 ] ; then
-	linux_arch=i586
+	linux_arch=x86
     elif [ "${osarch}" = x86_64 ] ; then
 	linux_arch=amd64
     fi
diff --git openjdk/hotspot/make/jprt.properties openjdk/hotspot/make/jprt.properties
index eb2ce82..7193de0 100644
--- openjdk/hotspot/make/jprt.properties
+++ openjdk/hotspot/make/jprt.properties
@@ -70,7 +70,7 @@ jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10
 jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10
 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
 
-jprt.my.linux.i586=linux_i586
+jprt.my.linux.x86=linux_x86
 jprt.my.linux.x64=linux_x64
 jprt.my.windows.i586=windows_i586
 jprt.my.windows.x64=windows_x64
@@ -201,30 +201,30 @@ jprt.my.solaris.i586.test.targets= \
     ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_2, \
     ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_3
 
-jprt.my.linux.i586.test.targets = \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_2, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_3, \
-    ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
-    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
-    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp_2, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_default, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_2, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_3
+jprt.my.linux.x86.test.targets = \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp_2, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp_3, \
+    ${jprt.my.linux.x86}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.linux.x86}-fastdebug-c2-runThese_Xcomp, \
+    ${jprt.my.linux.x86}-fastdebug-c2-runThese_Xcomp_2, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_default, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_SerialGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_ParallelGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_ParNewGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_CMS, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_default, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_ParallelGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_CMS, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c2-scimark_3
 
 jprt.my.linux.x64.test.targets = \
     ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \
@@ -294,7 +294,7 @@ jprt.test.targets = \
   ${jprt.my.solaris.sparcv9.test.targets}, \
   ${jprt.my.solaris.i586.test.targets}, \
   ${jprt.my.solaris.x64.test.targets}, \
-  ${jprt.my.linux.i586.test.targets}, \
+  ${jprt.my.linux.x86.test.targets}, \
   ${jprt.my.linux.x64.test.targets}, \
   ${jprt.my.windows.i586.test.targets}, \
   ${jprt.my.windows.x64.test.targets}
diff --git openjdk/hotspot/make/linux/build.sh openjdk/hotspot/make/linux/build.sh
index e317fdd..5d3b1ff 100644
--- openjdk/hotspot/make/linux/build.sh
+++ openjdk/hotspot/make/linux/build.sh
@@ -43,7 +43,7 @@ esac
 
 case `uname -m` in
   i386|i486|i586|i686)
-    mach=i386
+    mach=x86
     ;;
   *)
     echo "Unsupported machine: " `uname -m`
diff --git openjdk/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make
index add9823..cbbf81f 100644
--- openjdk/hotspot/make/linux/makefiles/buildtree.make
+++ openjdk/hotspot/make/linux/makefiles/buildtree.make
@@ -30,7 +30,7 @@
 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the
 # environment or on the command-line:
 #
-# ARCH		- sparc, i486, ... HotSpot cpu and os_cpu source directory
+# ARCH		- sparc, x86, ... HotSpot cpu and os_cpu source directory
 # BUILDARCH     - build directory
 # LIBARCH       - the corresponding directory in JDK/JRE
 # GAMMADIR	- top of workspace
@@ -316,7 +316,7 @@ NO_JAVA_HOME_MSG	= \
 DATA_MODE = $(DATA_MODE/$(BUILDARCH))
 JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
 
-DATA_MODE/i486    = 32
+DATA_MODE/x86     = 32
 DATA_MODE/sparc   = 32
 DATA_MODE/sparcv9 = 64
 DATA_MODE/amd64   = 64
diff --git openjdk/hotspot/make/linux/makefiles/cscope.make openjdk/hotspot/make/linux/makefiles/cscope.make
index 113d4f8..d3f06cb 100644
--- openjdk/hotspot/make/linux/makefiles/cscope.make
+++ openjdk/hotspot/make/linux/makefiles/cscope.make
@@ -78,7 +78,7 @@ endif
 # Processor-specific files for other processors are excluded by default.  Use
 # CS_CPU=x to include platform-specific files for other platforms.
 ifndef	CS_CPU
-CS_CPU		= i486 sparc amd64 ia64
+CS_CPU		= x86 sparc amd64 ia64
 CS_PRUNE_CPU	= $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU}))
 endif
 
diff --git openjdk/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make
index 9131c79..138dfb3 100644
--- openjdk/hotspot/make/linux/makefiles/defs.make
+++ openjdk/hotspot/make/linux/makefiles/defs.make
@@ -85,6 +85,14 @@ ifeq ($(ARCH), sparc)
   HS_ARCH          = sparc
 endif
 
+# x86
+ifeq ($(findstring 86,$(ARCH)), 86)
+  ARCH_DATA_MODEL  = 32
+  PLATFORM         = linux-x86
+  VM_PLATFORM      = linux_x86
+  HS_ARCH          = x86
+endif
+
 # x86_64
 ifeq ($(ARCH), x86_64) 
   ifeq ($(ARCH_DATA_MODEL), 64)
@@ -95,22 +103,12 @@ ifeq ($(ARCH), x86_64)
     HS_ARCH         = x86
   else
     ARCH_DATA_MODEL = 32
-    PLATFORM        = linux-i586
-    VM_PLATFORM     = linux_i486
+    PLATFORM        = linux-x86
+    VM_PLATFORM     = linux_x86
     HS_ARCH         = x86
-    # We have to reset ARCH to i686 since SRCARCH relies on it
-    ARCH            = i686   
   endif
 endif
 
-# i686
-ifeq ($(ARCH), i686)
-  ARCH_DATA_MODEL  = 32
-  PLATFORM         = linux-i586
-  VM_PLATFORM      = linux_i486
-  HS_ARCH          = x86
-endif
-
 JDK_INCLUDE_SUBDIR=linux
 
 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
diff --git openjdk/hotspot/make/linux/makefiles/sparcWorks.make openjdk/hotspot/make/linux/makefiles/sparcWorks.make
index 0a9f75b..2e29bb9 100644
--- openjdk/hotspot/make/linux/makefiles/sparcWorks.make
+++ openjdk/hotspot/make/linux/makefiles/sparcWorks.make
@@ -30,7 +30,7 @@ CC  = cc
 AS  = $(CC) -c
 
 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
-ARCHFLAG/i486    = -m32
+ARCHFLAG/x86    = -m32
 ARCHFLAG/amd64   = -m64
 
 CFLAGS     += $(ARCHFLAG)
diff --git openjdk/hotspot/make/linux/platform_i486 openjdk/hotspot/make/linux/platform_i486
deleted file mode 100644
index 610ac91..0000000
--- openjdk/hotspot/make/linux/platform_i486
+++ /dev/null
@@ -1,15 +0,0 @@
-os_family = linux
-
-arch = x86
-
-arch_model = x86_32
-
-os_arch = linux_x86
-
-os_arch_model = linux_x86_32
-
-lib_arch = i386
-
-compiler = gcc
-
-sysdefs = -DLINUX -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/make/linux/platform_i486.suncc openjdk/hotspot/make/linux/platform_i486.suncc
index 325a3fe..717fc75 100644
--- openjdk/hotspot/make/linux/platform_i486.suncc
+++ openjdk/hotspot/make/linux/platform_i486.suncc
@@ -8,10 +8,10 @@ os_arch = linux_x86
 
 os_arch_model = linux_x86_32
 
-lib_arch = i386
+lib_arch = x86
 
 compiler = sparcWorks
 
-gnu_dis_arch = i386
+gnu_dis_arch = x86
 
 sysdefs = -DLINUX -DSPARC_WORKS -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/make/linux/platform_x86 openjdk/hotspot/make/linux/platform_x86
new file mode 100644
index 0000000..5c613fe
--- /dev/null
+++ openjdk/hotspot/make/linux/platform_x86
@@ -0,0 +1,15 @@
+os_family = linux
+
+arch = x86
+
+arch_model = x86_32
+
+os_arch = linux_x86
+
+os_arch_model = linux_x86_32
+
+lib_arch = x86
+
+compiler = gcc
+
+sysdefs = -DLINUX -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
index b2b3162..a4bbe70 100644
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
@@ -164,7 +164,7 @@ bool os::have_special_privileges() {
 // i386: 224, ia64: 1105, amd64: 186, sparc 143
 #ifdef __ia64__
 #define SYS_gettid 1105
-#elif __i386__
+#elif __x86__
 #define SYS_gettid 224
 #elif __amd64__
 #define SYS_gettid 186
@@ -181,7 +181,7 @@ static char cpu_arch[] = ZERO_LIBARCH;
 #elif defined(IA64)
 static char cpu_arch[] = "ia64";
 #elif defined(IA32)
-static char cpu_arch[] = "i386";
+static char cpu_arch[] = "x86";
 #elif defined(AMD64)
 static char cpu_arch[] = "amd64";
 #elif defined(SPARC)
diff --git openjdk/hotspot/src/share/tools/hsdis/Makefile openjdk/hotspot/src/share/tools/hsdis/Makefile
index 6bdf4b8..fd43c6e 100644
--- openjdk/hotspot/src/share/tools/hsdis/Makefile
+++ openjdk/hotspot/src/share/tools/hsdis/Makefile
@@ -32,7 +32,7 @@ BINUTILS	= $(shell cd ../../../../..;pwd)/binutils-2.17-$(LIBARCH)
 endif
 
 # Default arch; it is changed below as needed.
-ARCH		= i386
+ARCH		= x86
 OS		= $(shell uname)
 
 CPPFLAGS	+= -I$(BINUTILS)/include -I$(BINUTILS)/bfd
@@ -87,7 +87,7 @@ endif	# SunOS
 LIBARCH		= $(ARCH)
 ifdef		LP64
 LIBARCH64/sparc	= sparcv9
-LIBARCH64/i386	= amd64
+LIBARCH64/x86	= amd64
 LIBARCH64	= $(LIBARCH64/$(ARCH))
 ifneq		($(LIBARCH64),)
 LIBARCH		= $(LIBARCH64)
diff --git openjdk/hotspot/src/share/tools/hsdis/hsdis.c openjdk/hotspot/src/share/tools/hsdis/hsdis.c
index 75b7efe..62c692b 100644
--- openjdk/hotspot/src/share/tools/hsdis/hsdis.c
+++ openjdk/hotspot/src/share/tools/hsdis/hsdis.c
@@ -383,8 +383,8 @@ static void print_help(struct hsdis_app_data* app_data,
   else
     disassembler_usage(stderr); /* better than nothing */
   (*printf_callback)(printf_stream, "  mach=<arch>   select disassembly mode\n");
-#if defined(LIBARCH_i386) || defined(LIBARCH_amd64)
-  (*printf_callback)(printf_stream, "  mach=i386     select 32-bit mode\n");
+#if defined(LIBARCH_x86) || defined(LIBARCH_amd64)
+  (*printf_callback)(printf_stream, "  mach=x86      select 32-bit mode\n");
   (*printf_callback)(printf_stream, "  mach=x86-64   select 64-bit mode\n");
   (*printf_callback)(printf_stream, "  suffix        always print instruction suffix\n");
 #endif
@@ -406,7 +406,7 @@ static const bfd_arch_info_type* find_arch_info(const char* arch_name) {
 static const char* native_arch_name() {
   const char* res = HOTSPOT_LIB_ARCH;
 #ifdef LIBARCH_amd64
-    res = "i386:x86-64";
+    res = "x86:x86-64";
 #endif
 #ifdef LIBARCH_sparc
     res = "sparc:v8plusb";
diff --git openjdk/hotspot/test/Makefile openjdk/hotspot/test/Makefile
index 2596d85..c2f3eb9 100644
--- openjdk/hotspot/test/Makefile
+++ openjdk/hotspot/test/Makefile
@@ -33,14 +33,14 @@ ifeq ($(OSNAME), SunOS)
   PLATFORM = solaris
   ARCH = $(shell uname -p)
   ifeq ($(ARCH), i386)
-    ARCH=i586
+    ARCH=x86
   endif
 endif
 ifeq ($(OSNAME), Linux)
   PLATFORM = linux
   ARCH = $(shell uname -m)
-  ifeq ($(ARCH), i386)
-    ARCH = i586
+  ifeq ($(findstring 86,$(ARCH)), 86)
+    ARCH = x86
   endif
 endif
 ifeq ($(OSNAME), Windows_NT)
@@ -55,7 +55,7 @@ ifeq ($(OSNAME), Windows_NT)
       ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
         ARCH = x64
       else
-        ARCH = i586
+        ARCH = x86
       endif
     endif
   endif
diff --git openjdk/hotspot/agent/make/saenv.sh openjdk/hotspot/agent/make/saenv.sh
index 38e0f78..64c8410 100644
--- openjdk/hotspot/agent/make/saenv.sh
+++ openjdk/hotspot/agent/make/saenv.sh
@@ -43,9 +43,9 @@ if [ "$OS" = "Linux" ]; then
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
      CPU=amd64
    else
-     SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386
+     SA_LIBPATH=$STARTDIR/../src/os/linux/x86:$STARTDIR/linux/x86
      OPTIONS="-Dsa.library.path=$SA_LIBPATH"
-     CPU=i386
+     CPU=x86
    fi
 else
    SA_LIBPATH=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/solaris/`uname -p`
diff --git openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
index c4ca7de..54c12ca 100644
--- openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
+++ openjdk/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c
@@ -29,7 +29,7 @@
 #define amd64 1
 #endif
 
-#ifdef i386
+#ifdef x86
 #include "sun_jvm_hotspot_debugger_x86_X86ThreadContext.h"
 #endif
 
@@ -295,7 +295,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
   }
 
 #undef NPRGREG
-#ifdef i386
+#ifdef x86
 #define NPRGREG sun_jvm_hotspot_debugger_x86_X86ThreadContext_NPRGREG
 #endif
 #ifdef ia64
@@ -314,7 +314,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
 
 #undef REG_INDEX
 
-#ifdef i386
+#ifdef x86
 #define REG_INDEX(reg) sun_jvm_hotspot_debugger_x86_X86ThreadContext_##reg
 
   regs[REG_INDEX(GS)]  = (uintptr_t) gregs.xgs;
@@ -333,7 +333,7 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo
   regs[REG_INDEX(CS)]  = (uintptr_t) gregs.xcs;
   regs[REG_INDEX(SS)]  = (uintptr_t) gregs.xss;
 
-#endif /* i386 */
+#endif /* x86 */
 
 #if ia64
   regs = (*env)->GetLongArrayElements(env, array, &isCopy);
diff --git openjdk/hotspot/agent/src/os/linux/Makefile openjdk/hotspot/agent/src/os/linux/Makefile
index a16f3a7..85fecb1 100644
--- openjdk/hotspot/agent/src/os/linux/Makefile
+++ openjdk/hotspot/agent/src/os/linux/Makefile
@@ -22,7 +22,7 @@
 #  
 #
 
-ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo i386 ; fi )
+ARCH := $(shell if ([ `uname -m` = "ia64" ])  ; then echo ia64 ; elif ([ `uname -m` = "x86_64" ]) ; then echo amd64; elif ([ `uname -m` = "sparc64" ]) ; then echo sparc; else echo x86 ; fi )
 GCC      = gcc$(GCC_SUFFIX)
 
 JAVAH    = ${JAVA_HOME}/bin/javah
diff --git openjdk/hotspot/agent/src/os/linux/ps_core.c openjdk/hotspot/agent/src/os/linux/ps_core.c
index 3562f2d..47ab01b 100644
--- openjdk/hotspot/agent/src/os/linux/ps_core.c
+++ openjdk/hotspot/agent/src/os/linux/ps_core.c
@@ -540,7 +540,7 @@ static bool core_handle_prstatus(struct ps_prochandle* ph, const char* buf, size
 
    if (is_debug()) {
       print_debug("integer regset\n");
-#ifdef i386
+#ifdef x86
       // print the regset
       print_debug("\teax = 0x%x\n", newthr->regs.eax);
       print_debug("\tebx = 0x%x\n", newthr->regs.ebx);
diff --git openjdk/hotspot/make/defs.make openjdk/hotspot/make/defs.make
index 83ddd1a..c20c7eb 100644
--- openjdk/hotspot/make/defs.make
+++ openjdk/hotspot/make/defs.make
@@ -207,7 +207,7 @@ ifneq ($(OSNAME),windows)
     ifdef LP64
       BUILDARCH = amd64
     else
-      BUILDARCH = i486
+      BUILDARCH = x86
     endif
   endif
   ifeq ($(BUILDARCH), sparc)
@@ -218,7 +218,7 @@ ifneq ($(OSNAME),windows)
 
   # LIBARCH is 1:1 mapping from BUILDARCH
   LIBARCH         = $(LIBARCH/$(BUILDARCH))
-  LIBARCH/i486    = i386
+  LIBARCH/x86     = x86
   LIBARCH/amd64   = amd64
   LIBARCH/sparc   = sparc
   LIBARCH/sparcv9 = sparcv9
diff --git openjdk/hotspot/make/jprt.config openjdk/hotspot/make/jprt.config
index bc82543..4a1ef4e 100644
--- openjdk/hotspot/make/jprt.config
+++ openjdk/hotspot/make/jprt.config
@@ -111,7 +111,7 @@ elif [ "${osname}" = Linux ] ; then
     # LINUX: X86, AMD64
     osarch=`uname -m`
     if [ "${osarch}" = i686 ] ; then
-	linux_arch=i586
+	linux_arch=x86
     elif [ "${osarch}" = x86_64 ] ; then
 	linux_arch=amd64
     fi
diff --git openjdk/hotspot/make/jprt.properties openjdk/hotspot/make/jprt.properties
index eb2ce82..7193de0 100644
--- openjdk/hotspot/make/jprt.properties
+++ openjdk/hotspot/make/jprt.properties
@@ -70,7 +70,7 @@ jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10
 jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10
 jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}}
 
-jprt.my.linux.i586=linux_i586
+jprt.my.linux.x86=linux_x86
 jprt.my.linux.x64=linux_x64
 jprt.my.windows.i586=windows_i586
 jprt.my.windows.x64=windows_x64
@@ -201,30 +201,30 @@ jprt.my.solaris.i586.test.targets= \
     ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_2, \
     ${jprt.my.solaris.i586}-{product|fastdebug}-{c1|c2}-scimark_3
 
-jprt.my.linux.i586.test.targets = \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-jvm98, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-scimark, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_2, \
-    ${jprt.my.linux.i586}-product-c1-runThese_Xcomp_3, \
-    ${jprt.my.linux.i586}-fastdebug-c1-runThese_Xshare, \
-    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp, \
-    ${jprt.my.linux.i586}-fastdebug-c2-runThese_Xcomp_2, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_default, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_SerialGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParallelGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_ParNewGC, \
-    ${jprt.my.linux.i586}-product-{c1|c2}-GCOld_CMS, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_default, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_ParallelGC, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c1-jbb_CMS, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_2, \
-    ${jprt.my.linux.i586}-{product|fastdebug}-c2-scimark_3
+jprt.my.linux.x86.test.targets = \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-jvm98, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-scimark, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp_2, \
+    ${jprt.my.linux.x86}-product-c1-runThese_Xcomp_3, \
+    ${jprt.my.linux.x86}-fastdebug-c1-runThese_Xshare, \
+    ${jprt.my.linux.x86}-fastdebug-c2-runThese_Xcomp, \
+    ${jprt.my.linux.x86}-fastdebug-c2-runThese_Xcomp_2, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_default, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_SerialGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_ParallelGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_ParNewGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-{c1|c2}-GCBasher_CMS, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_default, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_SerialGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_ParallelGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_ParNewGC, \
+    ${jprt.my.linux.x86}-product-{c1|c2}-GCOld_CMS, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_default, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_ParallelGC, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c1-jbb_CMS, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c2-scimark_2, \
+    ${jprt.my.linux.x86}-{product|fastdebug}-c2-scimark_3
 
 jprt.my.linux.x64.test.targets = \
     ${jprt.my.linux.x64}-{product|fastdebug}-c2-jvm98, \
@@ -294,7 +294,7 @@ jprt.test.targets = \
   ${jprt.my.solaris.sparcv9.test.targets}, \
   ${jprt.my.solaris.i586.test.targets}, \
   ${jprt.my.solaris.x64.test.targets}, \
-  ${jprt.my.linux.i586.test.targets}, \
+  ${jprt.my.linux.x86.test.targets}, \
   ${jprt.my.linux.x64.test.targets}, \
   ${jprt.my.windows.i586.test.targets}, \
   ${jprt.my.windows.x64.test.targets}
diff --git openjdk/hotspot/make/linux/build.sh openjdk/hotspot/make/linux/build.sh
index e317fdd..5d3b1ff 100644
--- openjdk/hotspot/make/linux/build.sh
+++ openjdk/hotspot/make/linux/build.sh
@@ -43,7 +43,7 @@ esac
 
 case `uname -m` in
   i386|i486|i586|i686)
-    mach=i386
+    mach=x86
     ;;
   *)
     echo "Unsupported machine: " `uname -m`
diff --git openjdk/hotspot/make/linux/makefiles/buildtree.make openjdk/hotspot/make/linux/makefiles/buildtree.make
index add9823..cbbf81f 100644
--- openjdk/hotspot/make/linux/makefiles/buildtree.make
+++ openjdk/hotspot/make/linux/makefiles/buildtree.make
@@ -30,7 +30,7 @@
 # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the
 # environment or on the command-line:
 #
-# ARCH		- sparc, i486, ... HotSpot cpu and os_cpu source directory
+# ARCH		- sparc, x86, ... HotSpot cpu and os_cpu source directory
 # BUILDARCH     - build directory
 # LIBARCH       - the corresponding directory in JDK/JRE
 # GAMMADIR	- top of workspace
@@ -316,7 +316,7 @@ NO_JAVA_HOME_MSG	= \
 DATA_MODE = $(DATA_MODE/$(BUILDARCH))
 JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
 
-DATA_MODE/i486    = 32
+DATA_MODE/x86     = 32
 DATA_MODE/sparc   = 32
 DATA_MODE/sparcv9 = 64
 DATA_MODE/amd64   = 64
diff --git openjdk/hotspot/make/linux/makefiles/cscope.make openjdk/hotspot/make/linux/makefiles/cscope.make
index 113d4f8..d3f06cb 100644
--- openjdk/hotspot/make/linux/makefiles/cscope.make
+++ openjdk/hotspot/make/linux/makefiles/cscope.make
@@ -78,7 +78,7 @@ endif
 # Processor-specific files for other processors are excluded by default.  Use
 # CS_CPU=x to include platform-specific files for other platforms.
 ifndef	CS_CPU
-CS_CPU		= i486 sparc amd64 ia64
+CS_CPU		= x86 sparc amd64 ia64
 CS_PRUNE_CPU	= $(patsubst %,-o -name '*%*',$(filter-out ${SRCARCH},${CS_CPU}))
 endif
 
diff --git openjdk/hotspot/make/linux/makefiles/defs.make openjdk/hotspot/make/linux/makefiles/defs.make
index 9131c79..138dfb3 100644
--- openjdk/hotspot/make/linux/makefiles/defs.make
+++ openjdk/hotspot/make/linux/makefiles/defs.make
@@ -85,6 +85,14 @@ ifeq ($(ARCH), sparc)
   HS_ARCH          = sparc
 endif
 
+# x86
+ifeq ($(findstring 86,$(ARCH)), 86)
+  ARCH_DATA_MODEL  = 32
+  PLATFORM         = linux-x86
+  VM_PLATFORM      = linux_x86
+  HS_ARCH          = x86
+endif
+
 # x86_64
 ifeq ($(ARCH), x86_64) 
   ifeq ($(ARCH_DATA_MODEL), 64)
@@ -95,22 +103,12 @@ ifeq ($(ARCH), x86_64)
     HS_ARCH         = x86
   else
     ARCH_DATA_MODEL = 32
-    PLATFORM        = linux-i586
-    VM_PLATFORM     = linux_i486
+    PLATFORM        = linux-x86
+    VM_PLATFORM     = linux_x86
     HS_ARCH         = x86
-    # We have to reset ARCH to i686 since SRCARCH relies on it
-    ARCH            = i686   
   endif
 endif
 
-# i686
-ifeq ($(ARCH), i686)
-  ARCH_DATA_MODEL  = 32
-  PLATFORM         = linux-i586
-  VM_PLATFORM      = linux_i486
-  HS_ARCH          = x86
-endif
-
 JDK_INCLUDE_SUBDIR=linux
 
 # FIXUP: The subdirectory for a debug build is NOT the same on all platforms
diff --git openjdk/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
index a2c24bc..27bad01 100644
--- openjdk/hotspot/make/linux/makefiles/gcc.make
+++ openjdk/hotspot/make/linux/makefiles/gcc.make
@@ -77,7 +77,7 @@ CFLAGS += -fcheck-new
 CFLAGS += -g
 
 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
-ARCHFLAG/i486    = -m32 -march=i586
+ARCHFLAG/x86    = -m32
 ARCHFLAG/amd64   = -m64
 ARCHFLAG/ia64    =
 ARCHFLAG/sparc   = -m32 -mcpu=v9
diff --git openjdk/hotspot/make/linux/makefiles/sparcWorks.make openjdk/hotspot/make/linux/makefiles/sparcWorks.make
index 0a9f75b..2e29bb9 100644
--- openjdk/hotspot/make/linux/makefiles/sparcWorks.make
+++ openjdk/hotspot/make/linux/makefiles/sparcWorks.make
@@ -30,7 +30,7 @@ CC  = cc
 AS  = $(CC) -c
 
 ARCHFLAG = $(ARCHFLAG/$(BUILDARCH))
-ARCHFLAG/i486    = -m32
+ARCHFLAG/x86    = -m32
 ARCHFLAG/amd64   = -m64
 
 CFLAGS     += $(ARCHFLAG)
diff --git openjdk/hotspot/make/linux/platform_i486 openjdk/hotspot/make/linux/platform_i486
deleted file mode 100644
index 610ac91..0000000
--- openjdk/hotspot/make/linux/platform_i486
+++ /dev/null
@@ -1,15 +0,0 @@
-os_family = linux
-
-arch = x86
-
-arch_model = x86_32
-
-os_arch = linux_x86
-
-os_arch_model = linux_x86_32
-
-lib_arch = i386
-
-compiler = gcc
-
-sysdefs = -DLINUX -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/make/linux/platform_i486.suncc openjdk/hotspot/make/linux/platform_i486.suncc
deleted file mode 100644
index 325a3fe..0000000
--- openjdk/hotspot/make/linux/platform_i486.suncc
+++ /dev/null
@@ -1,17 +0,0 @@
-os_family = linux
-
-arch = x86
-
-arch_model = x86_32
-
-os_arch = linux_x86
-
-os_arch_model = linux_x86_32
-
-lib_arch = i386
-
-compiler = sparcWorks
-
-gnu_dis_arch = i386
-
-sysdefs = -DLINUX -DSPARC_WORKS -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/make/linux/platform_x86 openjdk/hotspot/make/linux/platform_x86
new file mode 100644
index 0000000..5c613fe
--- /dev/null
+++ openjdk/hotspot/make/linux/platform_x86
@@ -0,0 +1,15 @@
+os_family = linux
+
+arch = x86
+
+arch_model = x86_32
+
+os_arch = linux_x86
+
+os_arch_model = linux_x86_32
+
+lib_arch = x86
+
+compiler = gcc
+
+sysdefs = -DLINUX -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/make/linux/platform_x86.suncc openjdk/hotspot/make/linux/platform_x86.suncc
new file mode 100644
index 0000000..717fc75
--- /dev/null
+++ openjdk/hotspot/make/linux/platform_x86.suncc
@@ -0,0 +1,17 @@
+os_family = linux
+
+arch = x86
+
+arch_model = x86_32
+
+os_arch = linux_x86
+
+os_arch_model = linux_x86_32
+
+lib_arch = x86
+
+compiler = sparcWorks
+
+gnu_dis_arch = x86
+
+sysdefs = -DLINUX -DSPARC_WORKS -D_GNU_SOURCE -DIA32
diff --git openjdk/hotspot/src/os/linux/launcher/java_md.c openjdk/hotspot/src/os/linux/launcher/java_md.c
index 50a86cd..48141be 100644
--- openjdk/hotspot/src/os/linux/launcher/java_md.c
+++ openjdk/hotspot/src/os/linux/launcher/java_md.c
@@ -56,8 +56,8 @@
  * models is supported, then DUAL_MODE is defined.  When DUAL_MODE is
  * defined, the architecture names for the narrow and wide version of
  * the architecture are defined in BIG_ARCH and SMALL_ARCH.  Currently
- * only Solaris on sparc/sparcv9 and i586/amd64 is DUAL_MODE; linux
- * i586/amd64 could be defined as DUAL_MODE but that is not the
+ * only Solaris on sparc/sparcv9 and x86/amd64 is DUAL_MODE; linux
+ * x86/amd64 could be defined as DUAL_MODE but that is not the
  * current policy.
  */
 
@@ -75,8 +75,8 @@
 
 #else /* 32-bit data model */
 
-#  ifdef i586
-#    define ARCH "i386"
+#  ifdef x86
+#    define ARCH "x86"
 #  elif defined(__sparc)
 #    define ARCH "sparc"
 #  endif
@@ -90,7 +90,7 @@
 #    define SMALL_ARCH "sparc"
 #  else
 #    define BIG_ARCH "amd64"
-#    define SMALL_ARCH "i386"
+#    define SMALL_ARCH "x86"
 #  endif
 #  include <sys/systeminfo.h>
 #  include <sys/elf.h>
@@ -1103,7 +1103,7 @@ void PrintMachineDependentOptions() {
  * This code is somewhat more confused with #ifdef's than we'd
  * like because this file is used by both Solaris and Linux
  * platforms, and so needs to be parameterized for SPARC and
- * i586 hardware.  The other Linux platforms (amd64 and ia64)
+ * x86 hardware.  The other Linux platforms (amd64 and ia64)
  * don't even ask this question, because they only come with
  * server JVMs.  */
 
@@ -1168,11 +1168,11 @@ solaris_sparc_ServerClassMachine(void) {
 
 #endif /* __sun && __sparc */
 
-#if defined(__sun) && defined(i586)
+#if defined(__sun) && defined(x86)
 
 /*
  * A utility method for asking the CPU about itself.
- * There's a corresponding version of linux-i586
+ * There's a corresponding version of linux-x86
  * because the compilers are different.
  */
 void
@@ -1218,13 +1218,13 @@ get_cpuid(uint32_t arg,
 #endif
 }
 
-#endif /* __sun && i586 */
+#endif /* __sun && x86 */
 
-#if defined(__linux__) && defined(i586)
+#if defined(__linux__) && defined(x86)
 
 /*
  * A utility method for asking the CPU about itself.
- * There's a corresponding version of solaris-i586
+ * There's a corresponding version of solaris-x86
  * because the compilers are different.
  */
 void
@@ -1286,11 +1286,11 @@ get_cpuid(uint32_t arg,
 #endif
 }
 
-#endif /* __linux__ && i586 */
+#endif /* __linux__ && x86 */
 
-#ifdef i586
+#ifdef x86
 /*
- * Routines shared by solaris-i586 and linux-i586.
+ * Routines shared by solaris-x86 and linux-x86.
  */
 
 enum HyperThreadingSupport_enum {
@@ -1430,11 +1430,11 @@ physical_processors(void) {
   return result;
 }
 
-#endif /* i586 */
+#endif /* x86 */
 
-#if defined(__sun) && defined(i586)
+#if defined(__sun) && defined(x86)
 
-/* The definition of a server-class machine for solaris-i586/amd64 */
+/* The definition of a server-class machine for solaris-x86/amd64 */
 jboolean
 solaris_i586_ServerClassMachine(void) {
   jboolean            result            = JNI_FALSE;
@@ -1463,11 +1463,11 @@ solaris_i586_ServerClassMachine(void) {
   return result;
 }
 
-#endif /* __sun && i586 */
+#endif /* __sun && x86 */
 
-#if defined(__linux__) && defined(i586)
+#if defined(__linux__) && defined(x86)
 
-/* The definition of a server-class machine for linux-i586 */
+/* The definition of a server-class machine for linux-x86 */
 jboolean
 linux_i586_ServerClassMachine(void) {
   jboolean            result            = JNI_FALSE;
@@ -1496,7 +1496,7 @@ linux_i586_ServerClassMachine(void) {
   return result;
 }
 
-#endif /* __linux__ && i586 */
+#endif /* __linux__ && x86 */
 
 /* Dispatch to the platform-specific definition of "server-class" */
 jboolean
@@ -1504,9 +1504,9 @@ ServerClassMachine(void) {
   jboolean result = JNI_FALSE;
 #if   defined(__sun) && defined(__sparc)
   result = solaris_sparc_ServerClassMachine();
-#elif defined(__sun) && defined(i586)
+#elif defined(__sun) && defined(x86)
   result = solaris_i586_ServerClassMachine();
-#elif defined(__linux__) && defined(i586)
+#elif defined(__linux__) && defined(x86)
   result = linux_i586_ServerClassMachine();
 #else
   if (_launcher_debug) {
diff --git openjdk/hotspot/src/os/linux/vm/os_linux.cpp openjdk/hotspot/src/os/linux/vm/os_linux.cpp
index b2b3162..a4bbe70 100644
--- openjdk/hotspot/src/os/linux/vm/os_linux.cpp
+++ openjdk/hotspot/src/os/linux/vm/os_linux.cpp
@@ -164,7 +164,7 @@ bool os::have_special_privileges() {
 // i386: 224, ia64: 1105, amd64: 186, sparc 143
 #ifdef __ia64__
 #define SYS_gettid 1105
-#elif __i386__
+#elif __x86__
 #define SYS_gettid 224
 #elif __amd64__
 #define SYS_gettid 186
@@ -181,7 +181,7 @@ static char cpu_arch[] = ZERO_LIBARCH;
 #elif defined(IA64)
 static char cpu_arch[] = "ia64";
 #elif defined(IA32)
-static char cpu_arch[] = "i386";
+static char cpu_arch[] = "x86";
 #elif defined(AMD64)
 static char cpu_arch[] = "amd64";
 #elif defined(SPARC)
diff --git openjdk/hotspot/src/share/tools/hsdis/Makefile openjdk/hotspot/src/share/tools/hsdis/Makefile
index 6bdf4b8..fd43c6e 100644
--- openjdk/hotspot/src/share/tools/hsdis/Makefile
+++ openjdk/hotspot/src/share/tools/hsdis/Makefile
@@ -32,7 +32,7 @@ BINUTILS	= $(shell cd ../../../../..;pwd)/binutils-2.17-$(LIBARCH)
 endif
 
 # Default arch; it is changed below as needed.
-ARCH		= i386
+ARCH		= x86
 OS		= $(shell uname)
 
 CPPFLAGS	+= -I$(BINUTILS)/include -I$(BINUTILS)/bfd
@@ -87,7 +87,7 @@ endif	# SunOS
 LIBARCH		= $(ARCH)
 ifdef		LP64
 LIBARCH64/sparc	= sparcv9
-LIBARCH64/i386	= amd64
+LIBARCH64/x86	= amd64
 LIBARCH64	= $(LIBARCH64/$(ARCH))
 ifneq		($(LIBARCH64),)
 LIBARCH		= $(LIBARCH64)
diff --git openjdk/hotspot/src/share/tools/hsdis/hsdis.c openjdk/hotspot/src/share/tools/hsdis/hsdis.c
index 75b7efe..62c692b 100644
--- openjdk/hotspot/src/share/tools/hsdis/hsdis.c
+++ openjdk/hotspot/src/share/tools/hsdis/hsdis.c
@@ -383,8 +383,8 @@ static void print_help(struct hsdis_app_data* app_data,
   else
     disassembler_usage(stderr); /* better than nothing */
   (*printf_callback)(printf_stream, "  mach=<arch>   select disassembly mode\n");
-#if defined(LIBARCH_i386) || defined(LIBARCH_amd64)
-  (*printf_callback)(printf_stream, "  mach=i386     select 32-bit mode\n");
+#if defined(LIBARCH_x86) || defined(LIBARCH_amd64)
+  (*printf_callback)(printf_stream, "  mach=x86      select 32-bit mode\n");
   (*printf_callback)(printf_stream, "  mach=x86-64   select 64-bit mode\n");
   (*printf_callback)(printf_stream, "  suffix        always print instruction suffix\n");
 #endif
@@ -406,7 +406,7 @@ static const bfd_arch_info_type* find_arch_info(const char* arch_name) {
 static const char* native_arch_name() {
   const char* res = HOTSPOT_LIB_ARCH;
 #ifdef LIBARCH_amd64
-    res = "i386:x86-64";
+    res = "x86:x86-64";
 #endif
 #ifdef LIBARCH_sparc
     res = "sparc:v8plusb";
diff --git openjdk/hotspot/src/share/vm/adlc/Test/i486.ad openjdk/hotspot/src/share/vm/adlc/Test/i486.ad
deleted file mode 100644
index e69de29..0000000
diff --git openjdk/hotspot/src/share/vm/adlc/Test/x86.ad openjdk/hotspot/src/share/vm/adlc/Test/x86.ad
new file mode 100644
index 0000000..e69de29
diff --git openjdk/hotspot/test/Makefile openjdk/hotspot/test/Makefile
index 2596d85..c2f3eb9 100644
--- openjdk/hotspot/test/Makefile
+++ openjdk/hotspot/test/Makefile
@@ -33,14 +33,14 @@ ifeq ($(OSNAME), SunOS)
   PLATFORM = solaris
   ARCH = $(shell uname -p)
   ifeq ($(ARCH), i386)
-    ARCH=i586
+    ARCH=x86
   endif
 endif
 ifeq ($(OSNAME), Linux)
   PLATFORM = linux
   ARCH = $(shell uname -m)
-  ifeq ($(ARCH), i386)
-    ARCH = i586
+  ifeq ($(findstring 86,$(ARCH)), 86)
+    ARCH = x86
   endif
 endif
 ifeq ($(OSNAME), Windows_NT)
@@ -55,7 +55,7 @@ ifeq ($(OSNAME), Windows_NT)
       ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
         ARCH = x64
       else
-        ARCH = i586
+        ARCH = x86
       endif
     endif
   endif
-- 
1.6.5

diff --git openjdk/hotspot/make/linux/makefiles/i486.make b/hotspot/make/linux/makefiles/i486.make
deleted file mode 100644
index 9dd0b44..0000000
--- openjdk/hotspot/make/linux/makefiles/i486.make
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-# Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# This code is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation.
-#
-# This code is distributed in the hope that it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-# version 2 for more details (a copy is included in the LICENSE file that
-# accompanied this code).
-#
-# You should have received a copy of the GNU General Public License version
-# 2 along with this work; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
-#
-# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
-# CA 95054 USA or visit www.sun.com if you need additional information or
-# have any questions.
-#  
-#
-
-# TLS helper, assembled from .s file
-# Not included in includeDB because it has no dependencies
-Obj_Files += linux_x86_32.o
-
-# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
-OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
-# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
-OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
-# Must also specify if CPU is little endian
-CFLAGS += -DVM_LITTLE_ENDIAN
-
-OPT_CFLAGS/compactingPermGenGen.o = -O1
diff --git openjdk/hotspot/make/linux/makefiles/x86.make openjdk/hotspot/make/linux/makefiles/x86.make
new file mode 100644
index 0000000..9dd0b44
--- /dev/null
+++ openjdk/hotspot/make/linux/makefiles/x86.make
@@ -0,0 +1,36 @@
+#
+# Copyright 1999-2008 Sun Microsystems, Inc.  All Rights Reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+# CA 95054 USA or visit www.sun.com if you need additional information or
+# have any questions.
+#  
+#
+
+# TLS helper, assembled from .s file
+# Not included in includeDB because it has no dependencies
+Obj_Files += linux_x86_32.o
+
+# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
+# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
+OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
+# Must also specify if CPU is little endian
+CFLAGS += -DVM_LITTLE_ENDIAN
+
+OPT_CFLAGS/compactingPermGenGen.o = -O1