summaryrefslogtreecommitdiff
path: root/toolchain/glibc/patches/2.38/0004-ARC-Add-support-for-ARCv3-processors.patch
blob: cf4ca7352685df3965028eb634c63afbf3b0744b (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
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
From ac6163148698545dd56471edabf97ffc23a519da Mon Sep 17 00:00:00 2001
From: Alexey Brodkin <abrodkin@synopsys.com>
Date: Tue, 2 Jan 2024 03:38:32 -0800
Subject: [PATCH] ARC: Add support for ARCv3 processors

Signed-off-by: Vineet Gupta <vgupta@kernel.org>
Signed-off-by: Pavel Kozlov <pavel.kozlov@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
---
 config.h.in                                   |    6 +
 elf/dl-runtime.c                              |    4 +-
 elf/elf.h                                     |    5 +-
 nptl/Makefile                                 |    5 +-
 scripts/build-many-glibcs.py                  |    6 +
 scripts/config.sub                            |    8 +
 sysdeps/arc/Implies                           |    1 -
 sysdeps/arc/__longjmp.S                       |   62 +-
 sysdeps/arc/arc32/Implies                     |    1 +
 sysdeps/arc/arc64/Implies                     |    1 +
 sysdeps/arc/arc64/fpu/libm-test-ulps          | 1141 +++++++++++++++++
 sysdeps/arc/arc64/fpu/libm-test-ulps-name     |    1 +
 sysdeps/arc/{ => arc64}/nofpu/libm-test-ulps  |    1 +
 sysdeps/arc/arc64/nofpu/libm-test-ulps-name   |    1 +
 sysdeps/arc/atomic-machine.h                  |   41 +-
 sysdeps/arc/bits/setjmp.h                     |    6 +-
 sysdeps/arc/configure                         |   80 +-
 sysdeps/arc/configure.ac                      |   36 +
 sysdeps/arc/dl-machine.h                      |   75 +-
 sysdeps/arc/dl-trampoline.S                   |   89 +-
 sysdeps/arc/fpu/math-use-builtins-fma.h       |   18 +-
 sysdeps/arc/fpu/math-use-builtins-sqrt.h      |   18 +-
 sysdeps/arc/isa-asm-macro-32.h                |   61 +
 sysdeps/arc/isa-asm-macro-64.h                |   86 ++
 sysdeps/arc/isa-asm-macros.h                  |   35 +
 sysdeps/arc/nofpu/libm-test-ulps              |    1 +
 sysdeps/arc/nptl/pthreaddef.h                 |    2 +-
 sysdeps/arc/preconfigure                      |   18 +-
 sysdeps/arc/setjmp.S                          |   55 +-
 sysdeps/arc/sfp-machine.h                     |   55 +-
 sysdeps/arc/start.S                           |   14 +-
 sysdeps/arc/sysdep.h                          |    5 +-
 sysdeps/unix/sysv/linux/arc/Makefile          |    8 +-
 sysdeps/unix/sysv/linux/arc/arc32/Implies     |    1 +
 .../sysv/linux/arc/{ => arc32}/arch-syscall.h |    0
 .../sysv/linux/arc/{ => arc32}/c++-types.data |    0
 .../linux/arc/{ => arc32}/fixup-asm-unistd.h  |    0
 .../sysv/linux/arc/{ => arc32}/ld.abilist     |    0
 .../arc/{ => arc32}/libBrokenLocale.abilist   |    0
 .../sysv/linux/arc/{ => arc32}/libanl.abilist |    0
 .../sysv/linux/arc/{ => arc32}/libc.abilist   |    0
 .../arc/{ => arc32}/libc_malloc_debug.abilist |    0
 .../linux/arc/{ => arc32}/libcrypt.abilist    |    0
 .../sysv/linux/arc/{ => arc32}/libdl.abilist  |    0
 .../sysv/linux/arc/{ => arc32}/libm.abilist   |    0
 .../linux/arc/{ => arc32}/libpthread.abilist  |    0
 .../linux/arc/{ => arc32}/libresolv.abilist   |    0
 .../sysv/linux/arc/{ => arc32}/librt.abilist  |    0
 .../arc/{ => arc32}/libthread_db.abilist      |    0
 .../linux/arc/{ => arc32}/libutil.abilist     |    0
 sysdeps/unix/sysv/linux/arc/arc64/Implies     |    2 +
 .../sysv/linux/arc/{ => arc64}/arch-syscall.h |   59 +-
 .../sysv/linux/arc/{ => arc64}/c++-types.data |   48 +-
 .../sysv/linux/arc/{ => arc64}/ld.abilist     |    8 +-
 .../arc/{ => arc64}/libBrokenLocale.abilist   |    0
 .../sysv/linux/arc/{ => arc64}/libanl.abilist |    0
 .../sysv/linux/arc/{ => arc64}/libc.abilist   |   82 +-
 .../arc/{ => arc64}/libc_malloc_debug.abilist |    8 +-
 .../linux/arc/{ => arc64}/libcrypt.abilist    |    0
 .../sysv/linux/arc/{ => arc64}/libdl.abilist  |    0
 .../sysv/linux/arc/{ => arc64}/libm.abilist   |    0
 .../linux/arc/{ => arc64}/libpthread.abilist  |    0
 .../linux/arc/{ => arc64}/libresolv.abilist   |    4 +-
 .../sysv/linux/arc/{ => arc64}/librt.abilist  |    0
 .../arc/{ => arc64}/libthread_db.abilist      |    0
 .../linux/arc/{ => arc64}/libutil.abilist     |    0
 sysdeps/unix/sysv/linux/arc/bits/fcntl.h      |   62 +
 .../sysv/linux/arc/bits/types/__sigset_t.h    |    2 +-
 sysdeps/unix/sysv/linux/arc/clone.S           |   30 +-
 sysdeps/unix/sysv/linux/arc/clone3.S          |   14 +-
 sysdeps/unix/sysv/linux/arc/getcontext.S      |   71 +-
 sysdeps/unix/sysv/linux/arc/setcontext.S      |   88 +-
 sysdeps/unix/sysv/linux/arc/shlib-versions    |    8 +
 sysdeps/unix/sysv/linux/arc/swapcontext.S     |  129 +-
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h    |    1 +
 sysdeps/unix/sysv/linux/arc/syscall.S         |   16 +-
 sysdeps/unix/sysv/linux/arc/sysdep.h          |   16 +-
 sysdeps/unix/sysv/linux/arc/vfork.S           |    4 +-
 timezone/zic.c                                |    2 +-
 79 files changed, 2211 insertions(+), 390 deletions(-)
 mode change 100755 => 100644 scripts/config.sub
 create mode 100644 sysdeps/arc/arc32/Implies
 create mode 100644 sysdeps/arc/arc64/Implies
 create mode 100644 sysdeps/arc/arc64/fpu/libm-test-ulps
 create mode 100644 sysdeps/arc/arc64/fpu/libm-test-ulps-name
 copy sysdeps/arc/{ => arc64}/nofpu/libm-test-ulps (99%)
 create mode 100644 sysdeps/arc/arc64/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/arc/isa-asm-macro-32.h
 create mode 100644 sysdeps/arc/isa-asm-macro-64.h
 create mode 100644 sysdeps/arc/isa-asm-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/arc32/Implies
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/arch-syscall.h (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/c++-types.data (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc32}/fixup-asm-unistd.h (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/ld.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libBrokenLocale.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libanl.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libc.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libc_malloc_debug.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libcrypt.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libdl.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libm.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libpthread.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libresolv.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/librt.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libthread_db.abilist (100%)
 copy sysdeps/unix/sysv/linux/arc/{ => arc32}/libutil.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/arc/arc64/Implies
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/arch-syscall.h (89%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/c++-types.data (73%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/ld.abilist (54%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libBrokenLocale.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libanl.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libc.abilist (97%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libc_malloc_debug.abilist (80%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libcrypt.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libdl.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libm.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libpthread.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libresolv.abilist (95%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/librt.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libthread_db.abilist (100%)
 rename sysdeps/unix/sysv/linux/arc/{ => arc64}/libutil.abilist (100%)
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/fcntl.h

diff --git a/config.h.in b/config.h.in
index 0dedc124f7..d69b4166c0 100644
--- a/config.h.in
+++ b/config.h.in
@@ -120,6 +120,12 @@
 /* ARC big endian ABI */
 #undef HAVE_ARC_BE
 
+/* ARC64:32 ABI */
+#undef HAVE_ARC32
+
+/* ARC64:64 ABI */
+#undef HAVE_ARC64
+
 /* C-SKY ABI version.  */
 #undef CSKYABI
 
diff --git a/elf/dl-runtime.c b/elf/dl-runtime.c
index 32a8bfcf74..68ffdb1c24 100644
--- a/elf/dl-runtime.c
+++ b/elf/dl-runtime.c
@@ -42,7 +42,7 @@ _dl_fixup (
 # ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
 	   ELF_MACHINE_RUNTIME_FIXUP_ARGS,
 # endif
-	   struct link_map *l, ElfW(Word) reloc_arg)
+	   struct link_map *l, uintptr_t reloc_arg)
 {
   const ElfW(Sym) *const symtab
     = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
@@ -170,7 +170,7 @@ _dl_profile_fixup (
 #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
 		   ELF_MACHINE_RUNTIME_FIXUP_ARGS,
 #endif
-		   struct link_map *l, ElfW(Word) reloc_arg,
+		   struct link_map *l, uintptr_t reloc_arg,
 		   ElfW(Addr) retaddr, void *regs, long int *framesizep)
 {
   void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = _dl_mcount;
diff --git a/elf/elf.h b/elf/elf.h
index 89fc8021e9..05cc75c631 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -358,6 +358,8 @@ typedef struct
 
 #define EM_BPF		247	/* Linux BPF -- in-kernel virtual machine */
 #define EM_CSKY		252     /* C-SKY */
+#define EM_ARCV3	253     /* Synopsys ARCv3 64-bit ISA */
+#define EM_ARCV3_32	255     /* Synopsys ARCv3 32-bit ISA */
 #define EM_LOONGARCH	258	/* LoongArch */
 
 #define EM_NUM		259
@@ -4216,12 +4218,13 @@ enum
 /* Processor specific values for the Shdr sh_type field.  */
 #define SHT_ARC_ATTRIBUTES	(SHT_LOPROC + 1) /* ARC attributes section.  */
 
-/* ARCompact/ARCv2 specific relocs.  */
+/* ARCompact/ARCv2/ARCv3 specific relocs.  */
 #define R_ARC_NONE		0x0
 #define R_ARC_8			0x1
 #define R_ARC_16		0x2
 #define R_ARC_24		0x3
 #define R_ARC_32		0x4
+#define R_ARC_64		0x5
 
 #define R_ARC_B22_PCREL		0x6
 #define R_ARC_H30		0x7
diff --git a/nptl/Makefile b/nptl/Makefile
index ffa5722e48..c8b7674c27 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -353,6 +353,7 @@ tests = \
   tst-thread-exit-clobber \
   tst-thread-setspecific \
   tst-thread_local1 \
+  tst-eintr1 \
   tst-tsd3 \
   tst-tsd4 \
   # tests
@@ -397,10 +398,6 @@ tests-time64 := \
   tst-cancel4_2-time64
   # tests-time64
 
-# This test can run into task limits because of a linux kernel bug
-# and then cause the make process to fail too, see bug 24537.
-xtests += tst-eintr1
-
 test-srcs = tst-oddstacklimit
 
 gen-as-const-headers = unwindbuf.sym
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 73ffc57c86..6f53c195cd 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -172,6 +172,12 @@ class Context(object):
         self.add_config(arch='arceb',
                         os_name='linux-gnu',
                         gcc_cfg=['--disable-multilib', '--with-cpu=hs38'])
+        self.add_config(arch='arc64',
+                        os_name='linux-gnu',
+                        gcc_cfg=['--disable-multilib'])
+        self.add_config(arch='arc64',
+                        os_name='linux-gnuhf',
+                        gcc_cfg=['--disable-multilib', '--with-fpu=fpud'])
         self.add_config(arch='alpha',
                         os_name='linux-gnu')
         self.add_config(arch='arm',
diff --git a/scripts/config.sub b/scripts/config.sub
old mode 100755
new mode 100644
index dba16e84c7..4d9a117c9c
--- a/scripts/config.sub
+++ b/scripts/config.sub
@@ -1170,6 +1170,14 @@ case $cpu-$vendor in
 		cpu=mipsallegrexel
 		vendor=sony
 		;;
+	arc32*-*)
+		cpu=arc32
+		vendor=linux
+		;;
+	arc64*-*)
+		cpu=arc64
+		vendor=linux
+		;;
 	tile*-*)
 		basic_os=${basic_os:-linux-gnu}
 		;;
diff --git a/sysdeps/arc/Implies b/sysdeps/arc/Implies
index 780c4e2467..12ca48b4c9 100644
--- a/sysdeps/arc/Implies
+++ b/sysdeps/arc/Implies
@@ -1,3 +1,2 @@
-wordsize-32
 ieee754/flt-32
 ieee754/dbl-64
diff --git a/sysdeps/arc/__longjmp.S b/sysdeps/arc/__longjmp.S
index a57054bce0..920e535ffd 100644
--- a/sysdeps/arc/__longjmp.S
+++ b/sysdeps/arc/__longjmp.S
@@ -24,25 +24,49 @@
 
 ENTRY (__longjmp)
 
-	LDR (blink, r0,  0)
-	LDR (sp,    r0,  1)
-	LDR (fp,    r0,  2)
-	LDR (gp,    r0,  3)
-
-	LDR (r13,   r0,  4)
-	LDR (r14,   r0,  5)
-	LDR (r15,   r0,  6)
-	LDR (r16,   r0,  7)
-	LDR (r17,   r0,  8)
-	LDR (r18,   r0,  9)
-	LDR (r19,   r0, 10)
-	LDR (r20,   r0, 11)
-	LDR (r21,   r0, 12)
-	LDR (r22,   r0, 13)
-	LDR (r23,   r0, 14)
-	LDR (r24,   r0, 15)
-
-	mov.f  r0, r1
+	LDR.as blink, r0,  0
+	LDR.as sp,    r0,  1
+	LDR.as fp,    r0,  2
+	LDR.as gp,    r0,  3
+
+	LDR.as r13,   r0,  4
+	LDR.as r14,   r0,  5
+	LDR.as r15,   r0,  6
+	LDR.as r16,   r0,  7
+	LDR.as r17,   r0,  8
+	LDR.as r18,   r0,  9
+	LDR.as r19,   r0, 10
+	LDR.as r20,   r0, 11
+	LDR.as r21,   r0, 12
+	LDR.as r22,   r0, 13
+	LDR.as r23,   r0, 14
+	LDR.as r24,   r0, 15
+
+#if defined(__ARCV3__)
+	LDR.as r25,   r0, 16
+	LDR.as r26,   r0, 17
+#endif
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FLDR.as	f16,  r0, 18
+	FLDR.as	f17,  r0, 19
+	FLDR.as	f18,  r0, 20
+	FLDR.as	f19,  r0, 21
+	FLDR.as	f20,  r0, 22
+	FLDR.as	f21,  r0, 23
+	FLDR.as	f22,  r0, 24
+	FLDR.as	f23,  r0, 25
+	FLDR.as	f24,  r0, 26
+	FLDR.as	f25,  r0, 27
+	FLDR.as	f26,  r0, 28
+	FLDR.as	f27,  r0, 29
+	FLDR.as	f28,  r0, 30
+	FLDR.as	f29,  r0, 31
+	FLDR.as	f30,  r0, 32
+	FLDR.as	f31,  r0, 33
+#endif
+
+	MOVR.f r0, r1
 	j.d    [blink]
 	mov.z  r0, 1	/* don't return 0 to setjmp callsite from longjmp.  */
 
diff --git a/sysdeps/arc/arc32/Implies b/sysdeps/arc/arc32/Implies
new file mode 100644
index 0000000000..39a34c5f57
--- /dev/null
+++ b/sysdeps/arc/arc32/Implies
@@ -0,0 +1 @@
+wordsize-32
diff --git a/sysdeps/arc/arc64/Implies b/sysdeps/arc/arc64/Implies
new file mode 100644
index 0000000000..a8cae95f9d
--- /dev/null
+++ b/sysdeps/arc/arc64/Implies
@@ -0,0 +1 @@
+wordsize-64
diff --git a/sysdeps/arc/arc64/fpu/libm-test-ulps b/sysdeps/arc/arc64/fpu/libm-test-ulps
new file mode 100644
index 0000000000..f3b8753c4d
--- /dev/null
+++ b/sysdeps/arc/arc64/fpu/libm-test-ulps
@@ -0,0 +1,1141 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+double: 1
+float: 1
+
+Function: "acos_downward":
+double: 1
+float: 1
+
+Function: "acos_towardzero":
+double: 1
+float: 1
+
+Function: "acos_upward":
+double: 1
+float: 1
+
+Function: "acosh":
+double: 2
+float: 2
+
+Function: "acosh_downward":
+double: 2
+float: 2
+
+Function: "acosh_towardzero":
+double: 2
+float: 2
+
+Function: "acosh_upward":
+double: 2
+float: 2
+
+Function: "asin":
+double: 1
+float: 1
+
+Function: "asin_downward":
+double: 1
+float: 1
+
+Function: "asin_towardzero":
+double: 1
+float: 1
+
+Function: "asin_upward":
+double: 2
+float: 1
+
+Function: "asinh":
+double: 2
+float: 2
+
+Function: "asinh_downward":
+double: 3
+float: 3
+
+Function: "asinh_towardzero":
+double: 2
+float: 2
+
+Function: "asinh_upward":
+double: 3
+float: 3
+
+Function: "atan":
+double: 1
+float: 1
+
+Function: "atan2":
+float: 1
+
+Function: "atan2_downward":
+double: 1
+float: 2
+
+Function: "atan2_towardzero":
+double: 1
+float: 2
+
+Function: "atan2_upward":
+double: 1
+float: 1
+
+Function: "atan_downward":
+double: 1
+float: 2
+
+Function: "atan_towardzero":
+double: 1
+float: 1
+
+Function: "atan_upward":
+double: 1
+float: 2
+
+Function: "atanh":
+double: 2
+float: 2
+
+Function: "atanh_downward":
+double: 3
+float: 3
+
+Function: "atanh_towardzero":
+double: 2
+float: 2
+
+Function: "atanh_upward":
+double: 3
+float: 3
+
+Function: "cabs":
+double: 1
+
+Function: "cabs_downward":
+double: 1
+
+Function: "cabs_towardzero":
+double: 1
+
+Function: "cabs_upward":
+double: 1
+float: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+
+Function: Real part of "cacos_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_downward":
+double: 5
+float: 3
+
+Function: Real part of "cacos_towardzero":
+double: 3
+float: 2
+
+Function: Imaginary part of "cacos_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "cacos_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacos_upward":
+double: 5
+float: 5
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+
+Function: Real part of "cacosh_downward":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "cacosh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "cacosh_towardzero":
+double: 3
+float: 2
+
+Function: Real part of "cacosh_upward":
+double: 4
+float: 3
+
+Function: Imaginary part of "cacosh_upward":
+double: 3
+float: 2
+
+Function: "carg":
+float: 1
+
+Function: "carg_downward":
+double: 1
+float: 2
+
+Function: "carg_towardzero":
+double: 1
+float: 2
+
+Function: "carg_upward":
+double: 1
+float: 1
+
+Function: Real part of "casin":
+double: 1
+float: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+
+Function: Real part of "casin_downward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_downward":
+double: 5
+float: 3
+
+Function: Real part of "casin_towardzero":
+double: 3
+float: 1
+
+Function: Imaginary part of "casin_towardzero":
+double: 4
+float: 2
+
+Function: Real part of "casin_upward":
+double: 3
+float: 2
+
+Function: Imaginary part of "casin_upward":
+double: 5
+float: 5
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+
+Function: Real part of "casinh_downward":
+double: 5
+float: 3
+
+Function: Imaginary part of "casinh_downward":
+double: 3
+float: 2
+
+Function: Real part of "casinh_towardzero":
+double: 4
+float: 2
+
+Function: Imaginary part of "casinh_towardzero":
+double: 3
+float: 1
+
+Function: Real part of "casinh_upward":
+double: 5
+float: 5
+
+Function: Imaginary part of "casinh_upward":
+double: 3
+float: 2
+
+Function: Real part of "catan":
+double: 1
+float: 1
+
+Function: Imaginary part of "catan":
+double: 1
+float: 1
+
+Function: Real part of "catan_downward":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_downward":
+double: 2
+float: 2
+
+Function: Real part of "catan_towardzero":
+double: 1
+float: 2
+
+Function: Imaginary part of "catan_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "catan_upward":
+double: 1
+float: 1
+
+Function: Imaginary part of "catan_upward":
+double: 2
+float: 2
+
+Function: Real part of "catanh":
+double: 1
+float: 1
+
+Function: Imaginary part of "catanh":
+double: 1
+float: 1
+
+Function: Real part of "catanh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_downward":
+double: 1
+float: 2
+
+Function: Real part of "catanh_towardzero":
+double: 2
+float: 2
+
+Function: Imaginary part of "catanh_towardzero":
+double: 1
+float: 2
+
+Function: Real part of "catanh_upward":
+double: 4
+float: 4
+
+Function: Imaginary part of "catanh_upward":
+double: 1
+float: 1
+
+Function: "cbrt":
+double: 4
+float: 1
+
+Function: "cbrt_downward":
+double: 4
+float: 1
+
+Function: "cbrt_towardzero":
+double: 3
+float: 1
+
+Function: "cbrt_upward":
+double: 5
+float: 1
+
+Function: Real part of "ccos":
+double: 1
+float: 1
+
+Function: Imaginary part of "ccos":
+double: 1
+float: 1
+
+Function: Real part of "ccos_downward":
+double: 1
+float: 1
+
+Function: Imaginary part of "ccos_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccos_towardzero":
+double: 1
+float: 2
+
+Function: Imaginary part of "ccos_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccos_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "ccos_upward":
+double: 2
+float: 2
+
+Function: Real part of "ccosh":
+double: 1
+float: 1
+
+Function: Imaginary part of "ccosh":
+double: 1
+float: 1
+
+Function: Real part of "ccosh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "ccosh_downward":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_towardzero":
+double: 2
+float: 3
+
+Function: Imaginary part of "ccosh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "ccosh_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "ccosh_upward":
+double: 2
+float: 2
+
+Function: Real part of "cexp":
+double: 2
+float: 1
+
+Function: Imaginary part of "cexp":
+double: 1
+float: 2
+
+Function: Real part of "cexp_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "cexp_downward":
+double: 3
+float: 3
+
+Function: Real part of "cexp_towardzero":
+double: 2
+float: 2
+
+Function: Imaginary part of "cexp_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "cexp_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "cexp_upward":
+double: 3
+float: 2
+
+Function: Real part of "clog":
+double: 3
+float: 3
+
+Function: Imaginary part of "clog":
+double: 1
+float: 1
+
+Function: Real part of "clog10":
+double: 3
+float: 4
+
+Function: Imaginary part of "clog10":
+double: 2
+float: 2
+
+Function: Real part of "clog10_downward":
+double: 5
+float: 5
+
+Function: Imaginary part of "clog10_downward":
+double: 2
+float: 4
+
+Function: Real part of "clog10_towardzero":
+double: 5
+float: 6
+
+Function: Imaginary part of "clog10_towardzero":
+double: 2
+float: 4
+
+Function: Real part of "clog10_upward":
+double: 6
+float: 5
+
+Function: Imaginary part of "clog10_upward":
+double: 2
+float: 4
+
+Function: Real part of "clog_downward":
+double: 4
+float: 3
+
+Function: Imaginary part of "clog_downward":
+double: 1
+float: 2
+
+Function: Real part of "clog_towardzero":
+double: 4
+float: 4
+
+Function: Imaginary part of "clog_towardzero":
+double: 1
+float: 3
+
+Function: Real part of "clog_upward":
+double: 4
+float: 3
+
+Function: Imaginary part of "clog_upward":
+double: 1
+float: 2
+
+Function: "cos":
+double: 1
+float: 1
+
+Function: "cos_downward":
+double: 1
+float: 1
+
+Function: "cos_towardzero":
+double: 1
+float: 1
+
+Function: "cos_upward":
+double: 1
+float: 1
+
+Function: "cosh":
+double: 2
+float: 2
+
+Function: "cosh_downward":
+double: 3
+float: 2
+
+Function: "cosh_towardzero":
+double: 3
+float: 2
+
+Function: "cosh_upward":
+double: 2
+float: 2
+
+Function: Real part of "cpow":
+double: 2
+float: 5
+
+Function: Imaginary part of "cpow":
+float: 2
+
+Function: Real part of "cpow_downward":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_downward":
+double: 1
+float: 2
+
+Function: Real part of "cpow_towardzero":
+double: 5
+float: 8
+
+Function: Imaginary part of "cpow_towardzero":
+double: 1
+float: 2
+
+Function: Real part of "cpow_upward":
+double: 4
+float: 1
+
+Function: Imaginary part of "cpow_upward":
+double: 1
+float: 2
+
+Function: Real part of "csin":
+double: 1
+float: 1
+
+Function: Real part of "csin_downward":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_downward":
+double: 1
+float: 1
+
+Function: Real part of "csin_towardzero":
+double: 3
+float: 3
+
+Function: Imaginary part of "csin_towardzero":
+double: 1
+float: 1
+
+Function: Real part of "csin_upward":
+double: 2
+float: 2
+
+Function: Imaginary part of "csin_upward":
+double: 1
+float: 2
+
+Function: Real part of "csinh":
+float: 1
+
+Function: Imaginary part of "csinh":
+double: 1
+float: 1
+
+Function: Real part of "csinh_downward":
+double: 2
+float: 1
+
+Function: Imaginary part of "csinh_downward":
+double: 3
+float: 3
+
+Function: Real part of "csinh_towardzero":
+double: 2
+float: 2
+
+Function: Imaginary part of "csinh_towardzero":
+double: 3
+float: 3
+
+Function: Real part of "csinh_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "csinh_upward":
+double: 2
+float: 2
+
+Function: Real part of "csqrt":
+double: 2
+float: 2
+
+Function: Imaginary part of "csqrt":
+double: 2
+float: 2
+
+Function: Real part of "csqrt_downward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_downward":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_towardzero":
+double: 4
+float: 3
+
+Function: Imaginary part of "csqrt_towardzero":
+double: 4
+float: 3
+
+Function: Real part of "csqrt_upward":
+double: 5
+float: 4
+
+Function: Imaginary part of "csqrt_upward":
+double: 3
+float: 3
+
+Function: Real part of "ctan":
+double: 1
+float: 1
+
+Function: Imaginary part of "ctan":
+double: 2
+float: 2
+
+Function: Real part of "ctan_downward":
+double: 6
+float: 5
+
+Function: Imaginary part of "ctan_downward":
+double: 2
+float: 2
+
+Function: Real part of "ctan_towardzero":
+double: 5
+float: 2
+
+Function: Imaginary part of "ctan_towardzero":
+double: 2
+float: 2
+
+Function: Real part of "ctan_upward":
+double: 2
+float: 4
+
+Function: Imaginary part of "ctan_upward":
+double: 1
+float: 2
+
+Function: Real part of "ctanh":
+double: 2
+float: 2
+
+Function: Imaginary part of "ctanh":
+double: 2
+float: 2
+
+Function: Real part of "ctanh_downward":
+double: 2
+float: 2
+
+Function: Imaginary part of "ctanh_downward":
+double: 6
+float: 5
+
+Function: Real part of "ctanh_towardzero":
+double: 2
+float: 2
+
+Function: Imaginary part of "ctanh_towardzero":
+double: 5
+float: 2
+
+Function: Real part of "ctanh_upward":
+double: 1
+float: 2
+
+Function: Imaginary part of "ctanh_upward":
+double: 3
+float: 3
+
+Function: "erf":
+double: 1
+float: 1
+
+Function: "erf_downward":
+double: 1
+float: 1
+
+Function: "erf_towardzero":
+double: 1
+float: 1
+
+Function: "erf_upward":
+double: 1
+float: 1
+
+Function: "erfc":
+double: 3
+float: 3
+
+Function: "erfc_downward":
+double: 4
+float: 4
+
+Function: "erfc_towardzero":
+double: 3
+float: 3
+
+Function: "erfc_upward":
+double: 4
+float: 4
+
+Function: "exp":
+double: 1
+float: 1
+
+Function: "exp10":
+double: 2
+float: 1
+
+Function: "exp10_downward":
+double: 3
+float: 1
+
+Function: "exp10_towardzero":
+double: 3
+float: 1
+
+Function: "exp10_upward":
+double: 2
+float: 1
+
+Function: "exp2":
+double: 1
+
+Function: "exp2_downward":
+double: 1
+float: 1
+
+Function: "exp2_towardzero":
+double: 1
+float: 1
+
+Function: "exp2_upward":
+double: 1
+float: 1
+
+Function: "exp_downward":
+double: 1
+float: 1
+
+Function: "exp_towardzero":
+double: 1
+float: 1
+
+Function: "exp_upward":
+double: 1
+float: 1
+
+Function: "expm1":
+double: 1
+float: 1
+
+Function: "expm1_downward":
+double: 1
+float: 1
+
+Function: "expm1_towardzero":
+double: 1
+float: 2
+
+Function: "expm1_upward":
+double: 1
+float: 1
+
+Function: "gamma":
+double: 4
+float: 7
+
+Function: "gamma_downward":
+double: 4
+float: 4
+
+Function: "gamma_towardzero":
+double: 4
+float: 3
+
+Function: "gamma_upward":
+double: 4
+float: 5
+
+Function: "hypot":
+double: 1
+float: 1
+
+Function: "hypot_downward":
+double: 1
+float: 1
+
+Function: "hypot_towardzero":
+double: 1
+float: 1
+
+Function: "hypot_upward":
+double: 1
+float: 1
+
+Function: "j0":
+double: 4
+float: 9
+
+Function: "j0_downward":
+double: 6
+float: 8
+
+Function: "j0_towardzero":
+double: 4
+float: 9
+
+Function: "j0_upward":
+double: 4
+float: 9
+
+Function: "j1":
+double: 3
+float: 9
+
+Function: "j1_downward":
+double: 9
+float: 9
+
+Function: "j1_towardzero":
+double: 5
+float: 9
+
+Function: "j1_upward":
+double: 5
+float: 8
+
+Function: "jn":
+double: 4
+float: 4
+
+Function: "jn_downward":
+double: 4
+float: 5
+
+Function: "jn_towardzero":
+double: 4
+float: 5
+
+Function: "jn_upward":
+double: 5
+float: 5
+
+Function: "lgamma":
+double: 4
+float: 7
+
+Function: "lgamma_downward":
+double: 4
+float: 4
+
+Function: "lgamma_towardzero":
+double: 4
+float: 3
+
+Function: "lgamma_upward":
+double: 4
+float: 5
+
+Function: "log":
+double: 1
+
+Function: "log10":
+double: 2
+float: 2
+
+Function: "log10_downward":
+double: 2
+float: 3
+
+Function: "log10_towardzero":
+double: 2
+float: 2
+
+Function: "log10_upward":
+double: 2
+float: 2
+
+Function: "log1p":
+double: 1
+float: 1
+
+Function: "log1p_downward":
+double: 1
+float: 2
+
+Function: "log1p_towardzero":
+double: 2
+float: 2
+
+Function: "log1p_upward":
+double: 2
+float: 2
+
+Function: "log2":
+double: 2
+float: 1
+
+Function: "log2_downward":
+double: 1
+float: 1
+
+Function: "log2_towardzero":
+double: 1
+float: 1
+
+Function: "log2_upward":
+double: 1
+float: 1
+
+Function: "log_downward":
+double: 1
+float: 1
+
+Function: "log_towardzero":
+double: 1
+float: 1
+
+Function: "log_upward":
+double: 1
+float: 1
+
+Function: "pow":
+double: 1
+
+Function: "pow_downward":
+double: 1
+float: 1
+
+Function: "pow_towardzero":
+double: 1
+float: 1
+
+Function: "pow_upward":
+double: 1
+float: 1
+
+Function: "sin":
+double: 1
+float: 1
+
+Function: "sin_downward":
+double: 1
+float: 1
+
+Function: "sin_towardzero":
+double: 1
+float: 1
+
+Function: "sin_upward":
+double: 1
+float: 1
+
+Function: "sincos":
+double: 1
+float: 1
+
+Function: "sincos_downward":
+double: 1
+float: 1
+
+Function: "sincos_towardzero":
+double: 1
+float: 1
+
+Function: "sincos_upward":
+double: 1
+float: 1
+
+Function: "sinh":
+double: 2
+float: 2
+
+Function: "sinh_downward":
+double: 3
+float: 3
+
+Function: "sinh_towardzero":
+double: 3
+float: 2
+
+Function: "sinh_upward":
+double: 3
+float: 3
+
+Function: "tan":
+float: 1
+
+Function: "tan_downward":
+double: 1
+float: 2
+
+Function: "tan_towardzero":
+double: 1
+float: 1
+
+Function: "tan_upward":
+double: 1
+float: 1
+
+Function: "tanh":
+double: 2
+float: 2
+
+Function: "tanh_downward":
+double: 3
+float: 3
+
+Function: "tanh_towardzero":
+double: 2
+float: 2
+
+Function: "tanh_upward":
+double: 3
+float: 3
+
+Function: "tgamma":
+double: 9
+float: 8
+
+Function: "tgamma_downward":
+double: 9
+float: 7
+
+Function: "tgamma_towardzero":
+double: 9
+float: 7
+
+Function: "tgamma_upward":
+double: 8
+float: 8
+
+Function: "y0":
+double: 3
+float: 8
+
+Function: "y0_downward":
+double: 3
+float: 8
+
+Function: "y0_towardzero":
+double: 3
+float: 8
+
+Function: "y0_upward":
+double: 2
+float: 8
+
+Function: "y1":
+double: 3
+float: 9
+
+Function: "y1_downward":
+double: 6
+float: 8
+
+Function: "y1_towardzero":
+double: 3
+float: 9
+
+Function: "y1_upward":
+double: 6
+float: 9
+
+Function: "yn":
+double: 3
+float: 3
+
+Function: "yn_downward":
+double: 3
+float: 4
+
+Function: "yn_towardzero":
+double: 3
+float: 3
+
+Function: "yn_upward":
+double: 4
+float: 5
+
+# end of automatic generation
diff --git a/sysdeps/arc/arc64/fpu/libm-test-ulps-name b/sysdeps/arc/arc64/fpu/libm-test-ulps-name
new file mode 100644
index 0000000000..8c4fba4f9a
--- /dev/null
+++ b/sysdeps/arc/arc64/fpu/libm-test-ulps-name
@@ -0,0 +1 @@
+ARC
diff --git a/sysdeps/arc/nofpu/libm-test-ulps b/sysdeps/arc/arc64/nofpu/libm-test-ulps
similarity index 99%
copy from sysdeps/arc/nofpu/libm-test-ulps
copy to sysdeps/arc/arc64/nofpu/libm-test-ulps
index 6ac2830b25..26632ff8f2 100644
--- a/sysdeps/arc/nofpu/libm-test-ulps
+++ b/sysdeps/arc/arc64/nofpu/libm-test-ulps
@@ -205,6 +205,7 @@ float: 7
 
 Function: "hypot":
 double: 1
+float: 1
 
 Function: "j0":
 double: 2
diff --git a/sysdeps/arc/arc64/nofpu/libm-test-ulps-name b/sysdeps/arc/arc64/nofpu/libm-test-ulps-name
new file mode 100644
index 0000000000..8a9879ebd6
--- /dev/null
+++ b/sysdeps/arc/arc64/nofpu/libm-test-ulps-name
@@ -0,0 +1 @@
+ARC soft-float
diff --git a/sysdeps/arc/atomic-machine.h b/sysdeps/arc/atomic-machine.h
index 6ac3d87dd9..f1565b317b 100644
--- a/sysdeps/arc/atomic-machine.h
+++ b/sysdeps/arc/atomic-machine.h
@@ -19,7 +19,23 @@
 #ifndef _ARC_BITS_ATOMIC_H
 #define _ARC_BITS_ATOMIC_H 1
 
-#define __HAVE_64B_ATOMICS 0
+#include <stdint.h>
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int64_t atomic64_t;
+typedef uint64_t uatomic64_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+# if defined(__ARC64_ARCH64__)
+#  define __HAVE_64B_ATOMICS 1
+# else
+#  define __HAVE_64B_ATOMICS 0
+# endif
 #define USE_ATOMIC_COMPILER_BUILTINS 1
 
 /* ARC does have legacy atomic EX reg, [mem] instruction but the micro-arch
@@ -30,15 +46,16 @@
   (abort (), 0)
 #define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval)	\
   (abort (), 0)
-#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval)	\
-  (abort (), 0)
+
+# if !defined(__ARC64__)
+#  define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval)	\
+    (abort (), 0)
+#endif
 
 #define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model)	\
   (abort (), (__typeof (*mem)) 0)
 #define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model)	\
   (abort (), (__typeof (*mem)) 0)
-#define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model)	\
-  (abort (), (__typeof (*mem)) 0)
 
 #define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model)	\
   ({										\
@@ -48,6 +65,20 @@
     __oldval;                                                           	\
   })
 
+# if defined(__ARC64__)
+# define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model)	\
+  ({										\
+    typeof (*mem) __oldval = (oldval);                                  	\
+    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,    	\
+                                 model, __ATOMIC_RELAXED);              	\
+    __oldval;                                                           	\
+  })
+# else
+/* ARCv2 has LOCKD/SCOND but not sure if gcc atomic builtins exist.  */
+#  define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model)	\
+    (abort (), (__typeof (*mem)) 0)
+#endif
+
 #define atomic_compare_and_exchange_val_acq(mem, new, old)		\
   __atomic_val_bysize (__arch_compare_and_exchange_val, int,		\
 		       mem, new, old, __ATOMIC_ACQUIRE)
diff --git a/sysdeps/arc/bits/setjmp.h b/sysdeps/arc/bits/setjmp.h
index d1604cde1f..2ca85a679d 100644
--- a/sysdeps/arc/bits/setjmp.h
+++ b/sysdeps/arc/bits/setjmp.h
@@ -20,7 +20,11 @@
 #define _ARC_BITS_SETJMP_H 1
 
 /* Saves r13-r25 (callee-saved), fp (frame pointer), sp (stack pointer),
-   blink (branch-n-link).  */
+   blink (branch-n-link), FP regs.  */
+#if defined (__ARC_FLOAT_ABI_HARD__)
+typedef long int __jmp_buf[64];
+#else
 typedef long int __jmp_buf[32];
+#endif
 
 #endif
diff --git a/sysdeps/arc/configure b/sysdeps/arc/configure
index 7b27e26490..d7b19db793 100644
--- a/sysdeps/arc/configure
+++ b/sysdeps/arc/configure
@@ -10,7 +10,7 @@ libc_cv_asm_line_sep='`'
 printf "%s\n" "#define ASM_LINE_SEP $libc_cv_asm_line_sep" >>confdefs.h
 
 
-# For big endian ABI, generate a symbol for selecting right dynamic linker
+# For arc64:64 generate a symbol for selecting right dynamic linker
 
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
@@ -155,6 +155,77 @@ printf "%s\n" "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc64" >&5
+printf %s "checking for arc64... " >&6; }
+if test ${libc_cv_arc64+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ARC64_ARCH64__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1
+then :
+  libc_cv_arc64=yes
+else $as_nop
+  libc_cv_arc64=no
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arc64" >&5
+printf "%s\n" "$libc_cv_arc64" >&6; }
+if test $libc_cv_arc64 = yes; then
+  # For shlib-versions.
+  printf "%s\n" "#define HAVE_ARC64 1" >>confdefs.h
+
+  config_vars="$config_vars
+default-abi = arc64le"
+
+else
+
+# For arc64:32 generate a symbol for selecting right dynamic linker
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for arc32" >&5
+printf %s "checking for arc32... " >&6; }
+if test ${libc_cv_arc32+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ARC64_ARCH32__
+                      yes
+                     #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1
+then :
+  libc_cv_arc32=yes
+else $as_nop
+  libc_cv_arc32=no
+fi
+rm -rf conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arc32" >&5
+printf "%s\n" "$libc_cv_arc32" >&6; }
+
+if test $libc_cv_arc32 = yes; then
+  # For shlib-versions.
+  printf "%s\n" "#define HAVE_ARC32 1" >>confdefs.h
+
+  config_vars="$config_vars
+default-abi = arc32le"
+
+else
+
+# For big endian ABI, generate a symbol for selecting right dynamic linker
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for big endian" >&5
 printf %s "checking for big endian... " >&6; }
 if test ${libc_cv_arc_be+y}
@@ -189,5 +260,12 @@ default-abi = arcbe"
 else
   config_vars="$config_vars
 default-abi = arcle"
+# big endian
+fi
+
+# arc64:32
+fi
+
+# arc64:64
 fi
 
diff --git a/sysdeps/arc/configure.ac b/sysdeps/arc/configure.ac
index 619da4e088..4e84f17105 100644
--- a/sysdeps/arc/configure.ac
+++ b/sysdeps/arc/configure.ac
@@ -9,6 +9,35 @@ libc_cv_have_sdata_section=no
 libc_cv_asm_line_sep='`'
 AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
 
+# For arc64:64 generate a symbol for selecting right dynamic linker
+AC_CACHE_CHECK([for arc64],
+  [libc_cv_arc64],
+  [AC_EGREP_CPP(yes,[#ifdef __ARC64_ARCH64__
+                      yes
+                     #endif
+  ], libc_cv_arc64=yes, libc_cv_arc64=no)])
+if test $libc_cv_arc64 = yes; then
+  # For shlib-versions.
+  AC_DEFINE(HAVE_ARC64)
+  LIBC_CONFIG_VAR([default-abi], [arc64le])
+
+else
+
+# For arc64:32 generate a symbol for selecting right dynamic linker
+AC_CACHE_CHECK([for arc32],
+  [libc_cv_arc32],
+  [AC_EGREP_CPP(yes,[#ifdef __ARC64_ARCH32__
+                      yes
+                     #endif
+  ], libc_cv_arc32=yes, libc_cv_arc32=no)])
+
+if test $libc_cv_arc32 = yes; then
+  # For shlib-versions.
+  AC_DEFINE(HAVE_ARC32)
+  LIBC_CONFIG_VAR([default-abi], [arc32le])
+
+else
+
 # For big endian ABI, generate a symbol for selecting right dynamic linker
 AC_CACHE_CHECK([for big endian],
   [libc_cv_arc_be],
@@ -22,4 +51,11 @@ if test $libc_cv_arc_be = yes; then
   LIBC_CONFIG_VAR([default-abi], [arcbe])
 else
   LIBC_CONFIG_VAR([default-abi], [arcle])
+# big endian
+fi
+
+# arc64:32
+fi
+
+# arc64:64
 fi
diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h
index 4dc652a449..dbb7394c27 100644
--- a/sysdeps/arc/dl-machine.h
+++ b/sysdeps/arc/dl-machine.h
@@ -32,18 +32,19 @@
 #include <dl-tls.h>
 #include <dl-static-tls.h>
 #include <dl-machine-rel.h>
+#include <sysdep.h>
 
 /* Dynamic Linking ABI for ARCv2 ISA.
 
-                        PLT
+                        .plt
           --------------------------------	<---- DT_PLTGOT
           |  ld r11, [pcl, off-to-GOT[1] |  0
           |                              |  4
-   plt0   |  ld r10, [pcl, off-to-GOT[2] |  8
+   PLT0   |  ld r10, [pcl, off-to-GOT[2] |  8
           |                              | 12
           |  j [r10]                     | 16
           --------------------------------
-          |    Base address of GOT       | 20
+          |   Base address of .got.plt   | 20
           --------------------------------
           |  ld r12, [pcl, off-to-GOT[3] | 24
    plt1   |                              |
@@ -69,11 +70,11 @@
           --------------
           |    [1]     |  Module info - setup by ld.so
           --------------
-          |    [2]     |  resolver entry point
+          |    [2]     |  resolver entry point: _dl_runtime_resolve
           --------------
           |    [3]     |
           |    ...     |  Runtime address for function symbols
-          |    [f]     |
+          |    [f]     |  Initially point to PLT0
           --------------
 
    For ARCompact, the PLT is 12 bytes due to short instructions
@@ -91,6 +92,8 @@ static inline int
 elf_machine_matches_host (const ElfW(Ehdr) *ehdr)
 {
   return (ehdr->e_machine == EM_ARCV2		 /* ARC HS.  */
+	  || ehdr->e_machine == EM_ARCV3         /* ARCv3: ARC64.  */
+	  || ehdr->e_machine == EM_ARCV3_32      /* ARCv3: ARC32.  */
 	  || ehdr->e_machine == EM_ARC_COMPACT); /* ARC 700.  */
 }
 
@@ -114,7 +117,7 @@ elf_machine_load_address (void)
   /* For build address, below generates
      ld  r0, [pcl, _GLOBAL_OFFSET_TABLE_@pcl].  */
   build_addr = elf_machine_dynamic ();
-  __asm__ ("add %0, pcl, _DYNAMIC@pcl	\n" : "=r" (run_addr));
+  __asm__ ("ADDR %0, pcl, _DYNAMIC@pcl	\n" : "=r" (run_addr));
 
   return run_addr - build_addr;
 }
@@ -131,10 +134,13 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
 
   if (l->l_info[DT_JMPREL] && lazy)
     {
-      /* On ARC DT_PLTGOT point to .plt whose 5th word (after the PLT header)
-         contains the address of .got.  */
+      /* update .got.plt[1] and .got.plt[2].
+         DT_PLTGOT point to base of .plt and PLT0 is 3 instructions
+         for total of 20 bytes, see illustration at top.
+         The word right after contains base address of .got.plt.  */
       ElfW(Addr) *plt_base = (ElfW(Addr) *) D_PTR (l, l_info[DT_PLTGOT]);
-      ElfW(Addr) *got = (ElfW(Addr) *) (plt_base[5] + l->l_addr);
+      ElfW(Addr) *got_build = (ElfW(Addr) *) ((uintptr_t)plt_base + 20);
+      ElfW(Addr) *got = (ElfW(Addr) *) (*got_build + l->l_addr);
 
       got[1] = (ElfW(Addr)) l;	/* Identify this shared object.  */
 
@@ -152,6 +158,8 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
     -optionally adjusts argc for executable if exec passed as cmd
     -calls into app main with address of finaliser.  */
 
+#ifdef __ARC64_ARCH64__
+
 #define RTLD_START asm ("\
 .text									\n\
 .globl __start								\n\
@@ -159,25 +167,55 @@ elf_machine_runtime_setup (struct link_map *l, struct r_scope_elem *scope[],
 __start:								\n\
 	/* (1). bootstrap ld.so.  */					\n\
 	bl.d    _dl_start                                       	\n\
-	mov_s   r0, sp  /* pass ptr to aux vector tbl.    */    	\n\
-	mov r13, r0	/* safekeep app elf entry point.  */		\n\
-	ld_s    r1, [sp]       /* orig argc.  */			\n\
+	MOVR    r0, sp  /* pass ptr to aux vector tbl.    */    	\n\
+	MOVR    r14, r0	/* safekeep app elf entry point.  */		\n\
+	LDR     r1,  sp       	/* orig argc.  */			\n\
 									\n\
 	/* (2). call preinit stuff.  */					\n\
-	ld	r0, [pcl, _rtld_local@pcl]				\n\
-	add	r2, sp, 4	; argv					\n\
-	add2	r3, r2, r1						\n\
-	add	r3, r3, 4	; env					\n\
+	LDR	r0, pcl, _rtld_local@pcl				\n\
+	ADDR	r2, sp, 8	; argv					\n\
+	ADD3R	r3, r2, r1						\n\
+	ADDR	r3, r3, 8	; env					\n\
 	bl	_dl_init@plt						\n\
 									\n\
 	/* (3) call app elf entry point.  */				\n\
-	add     r0, pcl, _dl_fini@pcl					\n\
-	j	[r13]							\n\
+	ADDR    r0, pcl, _dl_fini@pcl					\n\
+	j	[r14]							\n\
 									\n\
 	.size  __start,.-__start                               		\n\
 	.previous                                               	\n\
 ");
 
+#else
+
+#define RTLD_START asm ("\
+.text									\n\
+.globl __start								\n\
+.type __start, @function						\n\
+__start:								\n\
+	/* (1). bootstrap ld.so.  */					\n\
+	bl.d    _dl_start                                       	\n\
+	MOVR    r0, sp  /* pass ptr to aux vector tbl.    */    	\n\
+	MOVR    r14, r0	/* safekeep app elf entry point.  */		\n\
+	LDR     r1,  sp       	/* orig argc.  */			\n\
+									\n\
+	/* (2). call preinit stuff.  */					\n\
+	LDR	r0, pcl, _rtld_local@pcl				\n\
+	ADDR	r2, sp, 4	; argv					\n\
+	ADD2R	r3, r2, r1						\n\
+	ADDR	r3, r3, 4	; env					\n\
+	bl	_dl_init@plt						\n\
+									\n\
+	/* (3) call app elf entry point.  */				\n\
+	ADDR    r0, pcl, _dl_fini@pcl					\n\
+	j	[r14]							\n\
+									\n\
+	.size  __start,.-__start                               		\n\
+	.previous                                               	\n\
+");
+
+#endif
+
 /* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
    PLT entries should not be allowed to define the value.
    ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
@@ -289,6 +327,7 @@ elf_machine_rela (struct link_map *map, struct r_scope_elem *scope[],
           break;
 
         case R_ARC_32:
+        case R_ARC_64:
           *reloc_addr += value + reloc->r_addend;
           break;
 
diff --git a/sysdeps/arc/dl-trampoline.S b/sysdeps/arc/dl-trampoline.S
index 1b307a616f..386009d41e 100644
--- a/sysdeps/arc/dl-trampoline.S
+++ b/sysdeps/arc/dl-trampoline.S
@@ -31,42 +31,71 @@
 ENTRY (_dl_runtime_resolve)
 
 	/* save args to func being resolved before entering resolver.  */
-	push_s	r0
-	push_s	r1
-	push_s	r2
-	push_s	r3
-	st.a	r4, [sp, -4]
-	st.a	r5, [sp, -4]
-	st.a	r6, [sp, -4]
-	st.a	r7, [sp, -4]
-	st.a	r8, [sp, -4]
-	st.a	r9, [sp, -4]
-	cfi_adjust_cfa_offset (40)
-	push_s	blink
-	cfi_adjust_cfa_offset (4)
+	PUSHR	r0
+	PUSHR	r1
+	PUSHR	r2
+	PUSHR	r3
+	PUSHR	r4
+	PUSHR	r5
+	PUSHR	r6
+	PUSHR	r7
+	PUSHR	r8
+	PUSHR	r9
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FPUSHR	f0
+	FPUSHR	f1
+	FPUSHR	f2
+	FPUSHR	f3
+	FPUSHR	f4
+	FPUSHR	f5
+	FPUSHR	f6
+	FPUSHR	f7
+	cfi_adjust_cfa_offset (18*REGSZ)
+#else
+	cfi_adjust_cfa_offset (10*REGSZ)
+#endif
+
+	PUSHR	blink
+	cfi_adjust_cfa_offset (REGSZ)
 	cfi_rel_offset (blink, 0)
 
-	mov_s 	r1, r12
+	MOVR 	r1, r12
 	bl.d  	_dl_fixup
-	mov   	r0, r11
+	MOVR   	r0, r11
 
 	/* restore regs back.  */
-	ld.ab	blink,[sp, 4]
-	cfi_adjust_cfa_offset (-4)
+	POPR	blink
+	cfi_adjust_cfa_offset (-REGSZ)
 	cfi_restore (blink)
-	ld.ab	r9, [sp, 4]
-	ld.ab	r8, [sp, 4]
-	ld.ab	r7, [sp, 4]
-	ld.ab	r6, [sp, 4]
-	ld.ab	r5, [sp, 4]
-	ld.ab	r4, [sp, 4]
-	pop_s   r3
-	pop_s   r2
-	pop_s   r1
-	cfi_adjust_cfa_offset (-36)
 
-	j_s.d   [r0]    /* r0 has resolved function addr.  */
-	pop_s   r0      /* restore first arg to resolved call.  */
-	cfi_adjust_cfa_offset (-4)
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FPOPR	f7
+	FPOPR	f6
+	FPOPR	f5
+	FPOPR	f4
+	FPOPR	f3
+	FPOPR	f2
+	FPOPR	f1
+	FPOPR	f0
+#endif
+	POPR    r9
+	POPR    r8
+	POPR    r7
+	POPR    r6
+	POPR    r5
+	POPR    r4
+	POPR    r3
+	POPR    r2
+	POPR    r1
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	cfi_adjust_cfa_offset (-17*REGSZ)
+#else
+	cfi_adjust_cfa_offset (-9*REGSZ)
+#endif
+
+	j.d   [r0]    /* r0 has resolved function addr.  */
+	POPR    r0      /* restore first arg to resolved call.  */
+	cfi_adjust_cfa_offset (-REGSZ)
 	cfi_restore (r0)
 END (_dl_runtime_resolve)
diff --git a/sysdeps/arc/fpu/math-use-builtins-fma.h b/sysdeps/arc/fpu/math-use-builtins-fma.h
index 2acd8113ce..59c7ed0343 100644
--- a/sysdeps/arc/fpu/math-use-builtins-fma.h
+++ b/sysdeps/arc/fpu/math-use-builtins-fma.h
@@ -1,13 +1,17 @@
-#if defined __ARC_FPU_DP_FMA__
+#if defined __ARCV3__
 # define USE_FMA_BUILTIN 1
-#else
-# define USE_FMA_BUILTIN 0
-#endif
-
-#if defined __ARC_FPU_SP_FMA__
 # define USE_FMAF_BUILTIN 1
 #else
-# define USE_FMAF_BUILTIN 0
+# if defined __ARC_FPU_DP_FMA__
+#  define USE_FMA_BUILTIN 1
+# else
+#  define USE_FMA_BUILTIN 0
+# endif
+# if defined __ARC_FPU_SP_FMA__
+#  define USE_FMAF_BUILTIN 1
+# else
+#  define USE_FMAF_BUILTIN 0
+# endif
 #endif
 
 #define USE_FMAL_BUILTIN 0
diff --git a/sysdeps/arc/fpu/math-use-builtins-sqrt.h b/sysdeps/arc/fpu/math-use-builtins-sqrt.h
index a449bc6092..40a07730ea 100644
--- a/sysdeps/arc/fpu/math-use-builtins-sqrt.h
+++ b/sysdeps/arc/fpu/math-use-builtins-sqrt.h
@@ -1,13 +1,17 @@
-#if defined __ARC_FPU_DP_DIV__
+#if defined __ARCV3__
 # define USE_SQRT_BUILTIN 1
-#else
-# define USE_SQRT_BUILTIN 0
-#endif
-
-#if defined __ARC_FPU_SP_DIV__
 # define USE_SQRTF_BUILTIN 1
 #else
-# define USE_SQRTF_BUILTIN 0
+# if defined __ARC_FPU_DP_DIV__
+#  define USE_SQRT_BUILTIN 1
+# else
+#  define USE_SQRT_BUILTIN 0
+# endif
+# if defined __ARC_FPU_SP_DIV__
+#  define USE_SQRTF_BUILTIN 1
+# else
+#  define USE_SQRTF_BUILTIN 0
+# endif
 #endif
 
 #define USE_SQRTL_BUILTIN 0
diff --git a/sysdeps/arc/isa-asm-macro-32.h b/sysdeps/arc/isa-asm-macro-32.h
new file mode 100644
index 0000000000..98cd249059
--- /dev/null
+++ b/sysdeps/arc/isa-asm-macro-32.h
@@ -0,0 +1,61 @@
+#  define REGSZ 4
+
+.irp    aa,,.as
+.macro LDR\aa d, s, off=0
+	ld\aa  \d, [\s, \off]
+.endm
+.endr
+
+.irp    aa,,.as
+.macro STR\aa d, s, off=0
+	st\aa \d, [\s, \off]
+.endm
+.endr
+
+.macro PUSHR r
+	push \r
+.endm
+
+.macro POPR r
+	pop \r
+.endm
+
+.irp    cc,,.f
+.macro MOVR\cc d, s
+        mov\cc \d, \s
+.endm
+.endr
+
+.irp    cc,,.nz
+.macro ADDR\cc d, s, v
+	add\cc \d, \s, \v
+.endm
+.endr
+
+.macro ADD2R d, s, v
+	add2   \d, \s, \v
+.endm
+
+.macro ADD3R d, s, v
+	add3   \d, \s, \v
+.endm
+
+.macro SUBR d, s, v
+	sub    \d, \s, \v
+.endm
+
+.macro ANDR d, s, v
+	and    \d, \s, \v
+.endm
+
+.irp    cc,,eq,hi
+.macro BRR\cc d, s, v
+	br\cc  \d, \s, \v
+.endm
+.endr
+
+.irp    cc,,.ne
+.macro CMPR\cc d, s
+	cmp\cc \d, \s
+.endm
+.endr
diff --git a/sysdeps/arc/isa-asm-macro-64.h b/sysdeps/arc/isa-asm-macro-64.h
new file mode 100644
index 0000000000..02b1dc2c37
--- /dev/null
+++ b/sysdeps/arc/isa-asm-macro-64.h
@@ -0,0 +1,86 @@
+#  define REGSZ 8
+
+.irp    aa,,.as
+.macro LDR\aa d, s, off=0
+	ldl\aa \d, [\s, \off]
+.endm
+.endr
+
+.irp    aa,,.as
+.macro STR\aa d, s, off=0
+	stl\aa \d, [\s, \off]
+.endm
+.endr
+
+.macro PUSHR r
+	pushl \r
+.endm
+
+.macro POPR r
+	popl \r
+.endm
+
+.irp    cc,,.f
+.macro MOVR\cc d, s
+        movl\cc \d, \s
+.endm
+.endr
+
+.irp    cc,,.nz
+.macro ADDR\cc d, s, v
+	addl\cc \d, \s, \v
+.endm
+.endr
+
+.macro ADD2R d, s, v
+	add2l   \d, \s, \v
+.endm
+
+.macro ADD3R d, s, v
+	add3l   \d, \s, \v
+.endm
+
+.macro SUBR d, s, v
+	subl    \d, \s, \v
+.endm
+
+.macro ANDR d, s, v
+	andl    \d, \s, \v
+.endm
+
+.irp    cc,eq,hi
+.macro BRR\cc d, s, v
+; arc64 gas doesn't support BRHIL pseudo-instruction
+.ifeqs "\cc","hi"
+	brlo\()l  \s, \d, \v
+.else
+	br\cc\()l \d, \s, \v
+.endif
+.endm
+.endr
+
+.irp    cc,,.ne
+.macro CMPR\cc d, s
+	cmpl\cc \d, \s
+.endm
+.endr
+
+.irp    aa,,.as,.aw,.ab
+.macro FLDR\aa d, s, off=0
+	fld64\aa \d, [\s, \off]
+.endm
+.endr
+
+.irp    aa,,.as,.aw,.ab
+.macro FSTR\aa d, s, off=0
+	fst64\aa \d, [\s, \off]
+.endm
+.endr
+
+.macro FPUSHR r
+	FSTR.aw  \r, sp, -REGSZ
+.endm
+
+.macro FPOPR r
+	FLDR.ab  \r, sp, REGSZ
+.endm
diff --git a/sysdeps/arc/isa-asm-macros.h b/sysdeps/arc/isa-asm-macros.h
new file mode 100644
index 0000000000..f9f5e4f630
--- /dev/null
+++ b/sysdeps/arc/isa-asm-macros.h
@@ -0,0 +1,35 @@
+/* ISA Specific Assembler macros for ARC.
+   Copyright (C) 2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifdef	__ASSEMBLER__
+
+# ifdef __ARC64_ARCH64__
+# include <sysdeps/arc/isa-asm-macro-64.h>
+# else
+# include <sysdeps/arc/isa-asm-macro-32.h>
+# endif
+
+#else
+
+# ifdef __ARC64_ARCH64__
+asm(".include \"sysdeps/arc/isa-asm-macro-64.h\"\n");
+# else
+asm(".include \"sysdeps/arc/isa-asm-macro-32.h\"\n");
+# endif
+
+#endif
diff --git a/sysdeps/arc/nofpu/libm-test-ulps b/sysdeps/arc/nofpu/libm-test-ulps
index 6ac2830b25..26632ff8f2 100644
--- a/sysdeps/arc/nofpu/libm-test-ulps
+++ b/sysdeps/arc/nofpu/libm-test-ulps
@@ -205,6 +205,7 @@ float: 7
 
 Function: "hypot":
 double: 1
+float: 1
 
 Function: "j0":
 double: 2
diff --git a/sysdeps/arc/nptl/pthreaddef.h b/sysdeps/arc/nptl/pthreaddef.h
index 336eded15c..3b51e59a35 100644
--- a/sysdeps/arc/nptl/pthreaddef.h
+++ b/sysdeps/arc/nptl/pthreaddef.h
@@ -23,7 +23,7 @@
 #define ARCH_MIN_GUARD_SIZE 0
 
 /* Required stack pointer alignment at beginning.  */
-#define STACK_ALIGN		4
+#define STACK_ALIGN		8
 
 /* Minimal stack size after allocating thread descriptor and guard size.  */
 #define MINIMAL_REST_STACK	2048
diff --git a/sysdeps/arc/preconfigure b/sysdeps/arc/preconfigure
index a79db0239a..eab4af0eab 100644
--- a/sysdeps/arc/preconfigure
+++ b/sysdeps/arc/preconfigure
@@ -1,14 +1,22 @@
 case "$machine" in
 arc*)
-  base_machine=arc
-  machine=arc
+  with_fp_cond=0
+  isarc64=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __LP64__| wc -l`
+
+  case "$isarc64" in
+  0)
+    base_machine=arc
+    machine=arc/arc32
+    ;;
+  1)
+    base_machine=arc
+    machine=arc/arc64
+    ;;
+  esac
 
   gccfloat=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | grep __ARC_FPU_| wc -l`
   if test "$gccfloat" != "0"; then
     with_fp_cond=1
-  else
-    with_fp_cond=0
   fi
   ;;
-
 esac
diff --git a/sysdeps/arc/setjmp.S b/sysdeps/arc/setjmp.S
index 9ecdb9daae..e39b526837 100644
--- a/sysdeps/arc/setjmp.S
+++ b/sysdeps/arc/setjmp.S
@@ -41,24 +41,47 @@ ENTRY (__sigsetjmp)
 	   that will be right next to this setjmp call-site in BLINK
 	   since "C" caller of this routine will do a branch-n-link.  */
 
-	STR (blink, r0,  0)
-	STR (sp,    r0,  1)
-	STR (fp,    r0,  2)
-	STR (gp,    r0,  3)
+	STR.as blink, r0,  0
+	STR.as sp,    r0,  1
+	STR.as fp,    r0,  2
+	STR.as gp,    r0,  3
 
-	STR (r13,   r0,  4)
-	STR (r14,   r0,  5)
-	STR (r15,   r0,  6)
-	STR (r16,   r0,  7)
-	STR (r17,   r0,  8)
-	STR (r18,   r0,  9)
-	STR (r19,   r0, 10)
-	STR (r20,   r0, 11)
-	STR (r21,   r0, 12)
-	STR (r22,   r0, 13)
-	STR (r23,   r0, 14)
-	STR (r24,   r0, 15)
+	STR.as r13,   r0,  4
+	STR.as r14,   r0,  5
+	STR.as r15,   r0,  6
+	STR.as r16,   r0,  7
+	STR.as r17,   r0,  8
+	STR.as r18,   r0,  9
+	STR.as r19,   r0, 10
+	STR.as r20,   r0, 11
+	STR.as r21,   r0, 12
+	STR.as r22,   r0, 13
+	STR.as r23,   r0, 14
+	STR.as r24,   r0, 15
 
+#if defined(__ARCV3__)
+	STR.as r25,   r0, 16
+	STR.as r26,   r0, 17
+#endif
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FSTR.as	f16,  r0, 18
+	FSTR.as	f17,  r0, 19
+	FSTR.as	f18,  r0, 20
+	FSTR.as	f19,  r0, 21
+	FSTR.as	f20,  r0, 22
+	FSTR.as	f21,  r0, 23
+	FSTR.as	f22,  r0, 24
+	FSTR.as	f23,  r0, 25
+	FSTR.as	f24,  r0, 26
+	FSTR.as	f25,  r0, 27
+	FSTR.as	f26,  r0, 28
+	FSTR.as	f27,  r0, 29
+	FSTR.as	f28,  r0, 30
+	FSTR.as	f29,  r0, 31
+	FSTR.as	f30,  r0, 32
+	FSTR.as	f31,  r0, 33
+#endif
 	b    __sigjmp_save
 
 END (__sigsetjmp)
diff --git a/sysdeps/arc/sfp-machine.h b/sysdeps/arc/sfp-machine.h
index 0917a7ae17..4743b694a2 100644
--- a/sysdeps/arc/sfp-machine.h
+++ b/sysdeps/arc/sfp-machine.h
@@ -17,10 +17,12 @@
    <https://www.gnu.org/licenses/>.  */
 
 
-#define _FP_W_TYPE_SIZE		32
-#define _FP_W_TYPE		unsigned long
-#define _FP_WS_TYPE		signed long
-#define _FP_I_TYPE		long
+#ifndef __ARC64__
+
+# define _FP_W_TYPE_SIZE	32
+# define _FP_W_TYPE		unsigned long
+# define _FP_WS_TYPE		signed long
+# define _FP_I_TYPE		long
 
 #define _FP_MUL_MEAT_S(R,X,Y)				\
   _FP_MUL_MEAT_1_wide(_FP_WFRACBITS_S,R,X,Y,umul_ppmm)
@@ -67,4 +69,49 @@
     R##_c = FP_CLS_NAN;						\
   } while (0)
 
+#else
+
+# define _FP_W_TYPE_SIZE	64
+# define _FP_W_TYPE		unsigned long long
+# define _FP_WS_TYPE		signed long long
+# define _FP_I_TYPE		long long
+
+# define _FP_MUL_MEAT_S(R, X, Y)					\
+  _FP_MUL_MEAT_1_imm (_FP_WFRACBITS_S, R, X, Y)
+# define _FP_MUL_MEAT_D(R, X, Y)					\
+  _FP_MUL_MEAT_1_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_Q(R, X, Y)					\
+  _FP_MUL_MEAT_2_wide_3mul (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_MUL_MEAT_DW_S(R, X, Y)					\
+  _FP_MUL_MEAT_DW_1_imm (_FP_WFRACBITS_S, R, X, Y)
+# define _FP_MUL_MEAT_DW_D(R, X, Y)					\
+  _FP_MUL_MEAT_DW_1_wide (_FP_WFRACBITS_D, R, X, Y, umul_ppmm)
+# define _FP_MUL_MEAT_DW_Q(R, X, Y)					\
+  _FP_MUL_MEAT_DW_2_wide_3mul (_FP_WFRACBITS_Q, R, X, Y, umul_ppmm)
+
+# define _FP_DIV_MEAT_S(R, X, Y)	_FP_DIV_MEAT_1_imm (S, R, X, Y, _FP_DIV_HELP_imm)
+# define _FP_DIV_MEAT_D(R, X, Y)	_FP_DIV_MEAT_1_udiv_norm (D, R, X, Y)
+# define _FP_DIV_MEAT_Q(R, X, Y)	_FP_DIV_MEAT_2_udiv (Q, R, X, Y)
+
+# define _FP_NANFRAC_S		_FP_QNANBIT_S
+# define _FP_NANFRAC_D		_FP_QNANBIT_D
+# define _FP_NANFRAC_Q		_FP_QNANBIT_Q, 0
+
+#define _FP_NANSIGN_S		0
+#define _FP_NANSIGN_D		0
+#define _FP_NANSIGN_Q		0
+
+#define _FP_KEEPNANFRACP 0
+#define _FP_QNANNEGATEDP 0
+
+#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)	\
+  do {						\
+    R##_s = _FP_NANSIGN_##fs;			\
+    _FP_FRAC_SET_##wc (R, _FP_NANFRAC_##fs);	\
+    R##_c = FP_CLS_NAN;				\
+  } while (0)
+
+#endif
+
 #define _FP_TININESS_AFTER_ROUNDING 1
diff --git a/sysdeps/arc/start.S b/sysdeps/arc/start.S
index db3bab6395..42ead9d302 100644
--- a/sysdeps/arc/start.S
+++ b/sysdeps/arc/start.S
@@ -57,12 +57,12 @@ ENTRY (ENTRY_POINT)
 	cfi_undefined (blink)
 
 	mov	fp, 0
-	ld_s	r1, [sp]	/* argc.  */
+	LDR	r1, sp		/* argc.  */
 
-	mov_s	r5, r0		/* rltd_fini.  */
-	add_s	r2, sp, 4	/* argv.  */
-	and	sp, sp, -8
-	mov	r6, sp
+	MOVR	r5, r0		/* rltd_fini.  */
+	ADDR	r2, sp, REGSZ	/* argv.  */
+	ANDR	sp, sp, -2*REGSZ
+	MOVR	r6, sp
 
 	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end).  */
 
@@ -70,10 +70,10 @@ ENTRY (ENTRY_POINT)
 	mov	r4, 0		/* Used to be fini.  */
 
 #ifdef SHARED
-	ld	r0, [pcl, @main@gotpc]
+	LDR	r0, pcl, @main@gotpc
 	bl	__libc_start_main@plt
 #else
-	mov_s	r0, main
+	MOVR	r0, main
 	bl	__libc_start_main
 #endif
 
diff --git a/sysdeps/arc/sysdep.h b/sysdeps/arc/sysdep.h
index 4f024f6b73..ba6ecddbac 100644
--- a/sysdeps/arc/sysdep.h
+++ b/sysdeps/arc/sysdep.h
@@ -47,7 +47,6 @@
 
 # define CALL_MCOUNT		/* Do nothing for now.  */
 
-# define STR(reg, rbase, off)	st  reg, [rbase, off * 4]
-# define LDR(reg, rbase, off)	ld  reg, [rbase, off * 4]
-
 #endif	/* __ASSEMBLER__ */
+
+#include <sysdeps/arc/isa-asm-macros.h>
diff --git a/sysdeps/unix/sysv/linux/arc/Makefile b/sysdeps/unix/sysv/linux/arc/Makefile
index eca9a9fd3a..00d655bcd3 100644
--- a/sysdeps/unix/sysv/linux/arc/Makefile
+++ b/sysdeps/unix/sysv/linux/arc/Makefile
@@ -12,11 +12,13 @@ sysdep_headers += sys/cachectl.h
 sysdep_routines += cacheflush
 endif
 
-abi-variants := arcle arcbe
+abi-variants := arcle arcbe arc32le arc64le
 
 ifeq (,$(filter $(default-abi),$(abi-variants)))
 $(error Unknown ABI $(default-abi), must be one of $(abi-variants))
 endif
 
-abi-arcle-condition := !defined __BIG_ENDIAN__
-abi-arcbe-condition := defined __BIG_ENDIAN__
+abi-arcle-condition   := !defined __ARC64__        && !defined __BIG_ENDIAN__
+abi-arcbe-condition   := !defined __ARC64__        &&  defined __BIG_ENDIAN__
+abi-arc32le-condition :=  defined __ARC64_ARCH32__ && !defined __BIG_ENDIAN__
+abi-arc64le-condition :=  defined __ARC64_ARCH64__ && !defined __BIG_ENDIAN__
diff --git a/sysdeps/unix/sysv/linux/arc/arc32/Implies b/sysdeps/unix/sysv/linux/arc/arc32/Implies
new file mode 100644
index 0000000000..9670973cfa
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/arc32/Implies
@@ -0,0 +1 @@
+unix/sysv/linux/arc
diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arc32/arch-syscall.h
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/arch-syscall.h
copy to sysdeps/unix/sysv/linux/arc/arc32/arch-syscall.h
diff --git a/sysdeps/unix/sysv/linux/arc/c++-types.data b/sysdeps/unix/sysv/linux/arc/arc32/c++-types.data
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/c++-types.data
copy to sysdeps/unix/sysv/linux/arc/arc32/c++-types.data
diff --git a/sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/arc/arc32/fixup-asm-unistd.h
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h
rename to sysdeps/unix/sysv/linux/arc/arc32/fixup-asm-unistd.h
diff --git a/sysdeps/unix/sysv/linux/arc/ld.abilist b/sysdeps/unix/sysv/linux/arc/arc32/ld.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/ld.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/ld.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libBrokenLocale.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libBrokenLocale.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libanl.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libanl.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libanl.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libc.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libc.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libc.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libc_malloc_debug.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libc_malloc_debug.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libcrypt.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libcrypt.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libcrypt.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libcrypt.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libdl.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libdl.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libdl.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libdl.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libm.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libm.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libm.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libm.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libpthread.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libpthread.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libpthread.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libresolv.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libresolv.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libresolv.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libresolv.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/librt.abilist b/sysdeps/unix/sysv/linux/arc/arc32/librt.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/librt.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/librt.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libthread_db.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libthread_db.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libthread_db.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libthread_db.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libutil.abilist b/sysdeps/unix/sysv/linux/arc/arc32/libutil.abilist
similarity index 100%
copy from sysdeps/unix/sysv/linux/arc/libutil.abilist
copy to sysdeps/unix/sysv/linux/arc/arc32/libutil.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/arc64/Implies b/sysdeps/unix/sysv/linux/arc/arc64/Implies
new file mode 100644
index 0000000000..05abf4461a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/arc64/Implies
@@ -0,0 +1,2 @@
+unix/sysv/linux/arc
+unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/arc/arch-syscall.h b/sysdeps/unix/sysv/linux/arc/arc64/arch-syscall.h
similarity index 89%
rename from sysdeps/unix/sysv/linux/arc/arch-syscall.h
rename to sysdeps/unix/sysv/linux/arc/arc64/arch-syscall.h
index c1207aaa12..c73f38e567 100644
--- a/sysdeps/unix/sysv/linux/arc/arch-syscall.h
+++ b/sysdeps/unix/sysv/linux/arc/arc64/arch-syscall.h
@@ -15,11 +15,11 @@
 #define __NR_capset 91
 #define __NR_chdir 49
 #define __NR_chroot 51
-#define __NR_clock_adjtime64 405
-#define __NR_clock_getres_time64 406
-#define __NR_clock_gettime64 403
-#define __NR_clock_nanosleep_time64 407
-#define __NR_clock_settime64 404
+#define __NR_clock_adjtime 266
+#define __NR_clock_getres 114
+#define __NR_clock_gettime 113
+#define __NR_clock_nanosleep 115
+#define __NR_clock_settime 112
 #define __NR_clone 220
 #define __NR_clone3 435
 #define __NR_close 57
@@ -40,7 +40,7 @@
 #define __NR_exit_group 94
 #define __NR_faccessat 48
 #define __NR_faccessat2 439
-#define __NR_fadvise64_64 223
+#define __NR_fadvise64 223
 #define __NR_fallocate 47
 #define __NR_fanotify_init 262
 #define __NR_fanotify_mark 263
@@ -49,7 +49,7 @@
 #define __NR_fchmodat 53
 #define __NR_fchown 55
 #define __NR_fchownat 54
-#define __NR_fcntl64 25
+#define __NR_fcntl 25
 #define __NR_fdatasync 83
 #define __NR_fgetxattr 10
 #define __NR_finit_module 273
@@ -61,10 +61,11 @@
 #define __NR_fsmount 432
 #define __NR_fsopen 430
 #define __NR_fspick 433
-#define __NR_fstatfs64 44
+#define __NR_fstat 80
+#define __NR_fstatfs 44
 #define __NR_fsync 82
-#define __NR_ftruncate64 46
-#define __NR_futex_time64 422
+#define __NR_ftruncate 46
+#define __NR_futex 98
 #define __NR_futex_waitv 449
 #define __NR_get_mempolicy 236
 #define __NR_get_robust_list 100
@@ -101,7 +102,6 @@
 #define __NR_io_destroy 1
 #define __NR_io_getevents 4
 #define __NR_io_pgetevents 292
-#define __NR_io_pgetevents_time64 416
 #define __NR_io_setup 0
 #define __NR_io_submit 2
 #define __NR_io_uring_enter 426
@@ -123,9 +123,9 @@
 #define __NR_listen 201
 #define __NR_listxattr 11
 #define __NR_llistxattr 12
-#define __NR_llseek 62
 #define __NR_lookup_dcookie 18
 #define __NR_lremovexattr 15
+#define __NR_lseek 62
 #define __NR_lsetxattr 6
 #define __NR_madvise 233
 #define __NR_mbind 235
@@ -138,7 +138,7 @@
 #define __NR_mlock 228
 #define __NR_mlock2 284
 #define __NR_mlockall 230
-#define __NR_mmap2 222
+#define __NR_mmap 222
 #define __NR_mount 40
 #define __NR_mount_setattr 442
 #define __NR_move_mount 429
@@ -147,8 +147,8 @@
 #define __NR_mq_getsetattr 185
 #define __NR_mq_notify 184
 #define __NR_mq_open 180
-#define __NR_mq_timedreceive_time64 419
-#define __NR_mq_timedsend_time64 418
+#define __NR_mq_timedreceive 183
+#define __NR_mq_timedsend 182
 #define __NR_mq_unlink 181
 #define __NR_mremap 216
 #define __NR_msgctl 187
@@ -161,6 +161,7 @@
 #define __NR_munmap 215
 #define __NR_name_to_handle_at 264
 #define __NR_nanosleep 101
+#define __NR_newfstatat 79
 #define __NR_nfsservctl 42
 #define __NR_open_by_handle_at 265
 #define __NR_open_tree 428
@@ -176,7 +177,7 @@
 #define __NR_pkey_alloc 289
 #define __NR_pkey_free 290
 #define __NR_pkey_mprotect 288
-#define __NR_ppoll_time64 414
+#define __NR_ppoll 73
 #define __NR_prctl 167
 #define __NR_pread64 67
 #define __NR_preadv 69
@@ -186,7 +187,7 @@
 #define __NR_process_mrelease 448
 #define __NR_process_vm_readv 270
 #define __NR_process_vm_writev 271
-#define __NR_pselect6_time64 413
+#define __NR_pselect6 72
 #define __NR_ptrace 117
 #define __NR_pwrite64 68
 #define __NR_pwritev 70
@@ -199,7 +200,7 @@
 #define __NR_readv 65
 #define __NR_reboot 142
 #define __NR_recvfrom 207
-#define __NR_recvmmsg_time64 417
+#define __NR_recvmmsg 243
 #define __NR_recvmsg 212
 #define __NR_remap_file_pages 234
 #define __NR_removexattr 14
@@ -214,7 +215,7 @@
 #define __NR_rt_sigqueueinfo 138
 #define __NR_rt_sigreturn 139
 #define __NR_rt_sigsuspend 133
-#define __NR_rt_sigtimedwait_time64 421
+#define __NR_rt_sigtimedwait 137
 #define __NR_rt_tgsigqueueinfo 240
 #define __NR_sched_get_priority_max 125
 #define __NR_sched_get_priority_min 126
@@ -222,7 +223,7 @@
 #define __NR_sched_getattr 275
 #define __NR_sched_getparam 121
 #define __NR_sched_getscheduler 120
-#define __NR_sched_rr_get_interval_time64 423
+#define __NR_sched_rr_get_interval 127
 #define __NR_sched_setaffinity 122
 #define __NR_sched_setattr 274
 #define __NR_sched_setparam 118
@@ -232,8 +233,8 @@
 #define __NR_semctl 191
 #define __NR_semget 190
 #define __NR_semop 193
-#define __NR_semtimedop_time64 420
-#define __NR_sendfile64 71
+#define __NR_semtimedop 192
+#define __NR_sendfile 71
 #define __NR_sendmmsg 269
 #define __NR_sendmsg 211
 #define __NR_sendto 206
@@ -271,7 +272,7 @@
 #define __NR_socket 198
 #define __NR_socketpair 199
 #define __NR_splice 76
-#define __NR_statfs64 43
+#define __NR_statfs 43
 #define __NR_statx 291
 #define __NR_swapoff 225
 #define __NR_swapon 224
@@ -287,21 +288,21 @@
 #define __NR_timer_create 107
 #define __NR_timer_delete 111
 #define __NR_timer_getoverrun 109
-#define __NR_timer_gettime64 408
-#define __NR_timer_settime64 409
+#define __NR_timer_gettime 108
+#define __NR_timer_settime 110
 #define __NR_timerfd_create 85
-#define __NR_timerfd_gettime64 410
-#define __NR_timerfd_settime64 411
+#define __NR_timerfd_gettime 87
+#define __NR_timerfd_settime 86
 #define __NR_times 153
 #define __NR_tkill 130
-#define __NR_truncate64 45
+#define __NR_truncate 45
 #define __NR_umask 166
 #define __NR_umount2 39
 #define __NR_uname 160
 #define __NR_unlinkat 35
 #define __NR_unshare 97
 #define __NR_userfaultfd 282
-#define __NR_utimensat_time64 412
+#define __NR_utimensat 88
 #define __NR_vhangup 58
 #define __NR_vmsplice 75
 #define __NR_wait4 260
diff --git a/sysdeps/unix/sysv/linux/arc/c++-types.data b/sysdeps/unix/sysv/linux/arc/arc64/c++-types.data
similarity index 73%
rename from sysdeps/unix/sysv/linux/arc/c++-types.data
rename to sysdeps/unix/sysv/linux/arc/arc64/c++-types.data
index 0fb0143ae7..ac925ccb36 100644
--- a/sysdeps/unix/sysv/linux/arc/c++-types.data
+++ b/sysdeps/unix/sysv/linux/arc/arc64/c++-types.data
@@ -1,32 +1,32 @@
-blkcnt64_t:x
-blkcnt_t:x
+blkcnt64_t:l
+blkcnt_t:l
 blksize_t:i
 caddr_t:Pc
 clockid_t:i
 clock_t:l
 daddr_t:i
-dev_t:y
+dev_t:m
 fd_mask:l
-fsblkcnt64_t:y
-fsblkcnt_t:y
-fsfilcnt64_t:y
-fsfilcnt_t:y
+fsblkcnt64_t:m
+fsblkcnt_t:m
+fsfilcnt64_t:m
+fsfilcnt_t:m
 fsid_t:8__fsid_t
 gid_t:j
 id_t:j
-ino64_t:y
-ino_t:y
+ino64_t:m
+ino_t:m
 int16_t:s
 int32_t:i
-int64_t:x
+int64_t:l
 int8_t:a
-intptr_t:i
+intptr_t:l
 key_t:i
-loff_t:x
+loff_t:l
 mode_t:j
 nlink_t:j
-off64_t:x
-off_t:x
+off64_t:l
+off_t:l
 pid_t:i
 pthread_attr_t:14pthread_attr_t
 pthread_barrier_t:17pthread_barrier_t
@@ -41,27 +41,27 @@ pthread_rwlock_t:16pthread_rwlock_t
 pthread_rwlockattr_t:20pthread_rwlockattr_t
 pthread_spinlock_t:i
 pthread_t:m
-quad_t:x
-register_t:i
-rlim64_t:y
-rlim_t:y
+quad_t:l
+register_t:l
+rlim64_t:m
+rlim_t:m
 sigset_t:10__sigset_t
-size_t:j
+size_t:m
 socklen_t:j
-ssize_t:i
-suseconds_t:x
-time_t:x
+ssize_t:l
+suseconds_t:l
+time_t:l
 u_char:h
 uid_t:j
 uint:j
 u_int:j
 u_int16_t:t
 u_int32_t:j
-u_int64_t:y
+u_int64_t:m
 u_int8_t:h
 ulong:m
 u_long:m
-u_quad_t:y
+u_quad_t:m
 useconds_t:j
 ushort:t
 u_short:t
diff --git a/sysdeps/unix/sysv/linux/arc/ld.abilist b/sysdeps/unix/sysv/linux/arc/arc64/ld.abilist
similarity index 54%
rename from sysdeps/unix/sysv/linux/arc/ld.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/ld.abilist
index 55f0c2ab9c..3a4bcb95f2 100644
--- a/sysdeps/unix/sysv/linux/arc/ld.abilist
+++ b/sysdeps/unix/sysv/linux/arc/arc64/ld.abilist
@@ -1,9 +1,9 @@
-GLIBC_2.32 __libc_stack_end D 0x4
-GLIBC_2.32 __stack_chk_guard D 0x4
+GLIBC_2.32 __libc_stack_end D 0x8
+GLIBC_2.32 __stack_chk_guard D 0x8
 GLIBC_2.32 __tls_get_addr F
 GLIBC_2.32 _dl_mcount F
-GLIBC_2.32 _r_debug D 0x14
+GLIBC_2.32 _r_debug D 0x28
 GLIBC_2.34 __rtld_version_placeholder F
 GLIBC_2.35 __rseq_flags D 0x4
-GLIBC_2.35 __rseq_offset D 0x4
+GLIBC_2.35 __rseq_offset D 0x8
 GLIBC_2.35 __rseq_size D 0x4
diff --git a/sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libBrokenLocale.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libBrokenLocale.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libanl.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libanl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libanl.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libanl.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libc.abilist
similarity index 97%
rename from sysdeps/unix/sysv/linux/arc/libc.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libc.abilist
index dfe0c3f7b6..d07723e742 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/arc64/libc.abilist
@@ -1,7 +1,7 @@
 GLIBC_2.32 _Exit F
-GLIBC_2.32 _IO_2_1_stderr_ D 0x9c
-GLIBC_2.32 _IO_2_1_stdin_ D 0x9c
-GLIBC_2.32 _IO_2_1_stdout_ D 0x9c
+GLIBC_2.32 _IO_2_1_stderr_ D 0xe0
+GLIBC_2.32 _IO_2_1_stdin_ D 0xe0
+GLIBC_2.32 _IO_2_1_stdout_ D 0xe0
 GLIBC_2.32 _IO_adjust_column F
 GLIBC_2.32 _IO_adjust_wcolumn F
 GLIBC_2.32 _IO_default_doallocate F
@@ -27,7 +27,7 @@ GLIBC_2.32 _IO_file_doallocate F
 GLIBC_2.32 _IO_file_finish F
 GLIBC_2.32 _IO_file_fopen F
 GLIBC_2.32 _IO_file_init F
-GLIBC_2.32 _IO_file_jumps D 0x54
+GLIBC_2.32 _IO_file_jumps D 0xa8
 GLIBC_2.32 _IO_file_open F
 GLIBC_2.32 _IO_file_overflow F
 GLIBC_2.32 _IO_file_read F
@@ -67,7 +67,7 @@ GLIBC_2.32 _IO_iter_file F
 GLIBC_2.32 _IO_iter_next F
 GLIBC_2.32 _IO_least_wmarker F
 GLIBC_2.32 _IO_link_in F
-GLIBC_2.32 _IO_list_all D 0x4
+GLIBC_2.32 _IO_list_all D 0x8
 GLIBC_2.32 _IO_list_lock F
 GLIBC_2.32 _IO_list_resetlock F
 GLIBC_2.32 _IO_list_unlock F
@@ -120,7 +120,7 @@ GLIBC_2.32 _IO_wdefault_xsgetn F
 GLIBC_2.32 _IO_wdefault_xsputn F
 GLIBC_2.32 _IO_wdo_write F
 GLIBC_2.32 _IO_wdoallocbuf F
-GLIBC_2.32 _IO_wfile_jumps D 0x54
+GLIBC_2.32 _IO_wfile_jumps D 0xa8
 GLIBC_2.32 _IO_wfile_overflow F
 GLIBC_2.32 _IO_wfile_seekoff F
 GLIBC_2.32 _IO_wfile_sync F
@@ -128,9 +128,9 @@ GLIBC_2.32 _IO_wfile_underflow F
 GLIBC_2.32 _IO_wfile_xsputn F
 GLIBC_2.32 _IO_wmarker_delta F
 GLIBC_2.32 _IO_wsetb F
-GLIBC_2.32 ___brk_addr D 0x4
+GLIBC_2.32 ___brk_addr D 0x8
 GLIBC_2.32 __adjtimex F
-GLIBC_2.32 __after_morecore_hook D 0x4
+GLIBC_2.32 __after_morecore_hook D 0x8
 GLIBC_2.32 __argz_count F
 GLIBC_2.32 __argz_next F
 GLIBC_2.32 __argz_stringify F
@@ -155,7 +155,7 @@ GLIBC_2.32 __ctype_b_loc F
 GLIBC_2.32 __ctype_get_mb_cur_max F
 GLIBC_2.32 __ctype_tolower_loc F
 GLIBC_2.32 __ctype_toupper_loc F
-GLIBC_2.32 __curbrk D 0x4
+GLIBC_2.32 __curbrk D 0x8
 GLIBC_2.32 __cxa_at_quick_exit F
 GLIBC_2.32 __cxa_atexit F
 GLIBC_2.32 __cxa_finalize F
@@ -173,7 +173,7 @@ GLIBC_2.32 __dprintf_chk F
 GLIBC_2.32 __dup2 F
 GLIBC_2.32 __duplocale F
 GLIBC_2.32 __endmntent F
-GLIBC_2.32 __environ D 0x4
+GLIBC_2.32 __environ D 0x8
 GLIBC_2.32 __errno_location F
 GLIBC_2.32 __explicit_bzero_chk F
 GLIBC_2.32 __fbufsize F
@@ -197,7 +197,7 @@ GLIBC_2.32 __fread_chk F
 GLIBC_2.32 __fread_unlocked_chk F
 GLIBC_2.32 __freadable F
 GLIBC_2.32 __freading F
-GLIBC_2.32 __free_hook D 0x4
+GLIBC_2.32 __free_hook D 0x8
 GLIBC_2.32 __freelocale F
 GLIBC_2.32 __fsetlocking F
 GLIBC_2.32 __fwprintf_chk F
@@ -289,20 +289,20 @@ GLIBC_2.32 __longjmp_chk F
 GLIBC_2.32 __lseek F
 GLIBC_2.32 __lxstat F
 GLIBC_2.32 __lxstat64 F
-GLIBC_2.32 __malloc_hook D 0x4
+GLIBC_2.32 __malloc_hook D 0x8
 GLIBC_2.32 __mbrlen F
 GLIBC_2.32 __mbrtowc F
 GLIBC_2.32 __mbsnrtowcs_chk F
 GLIBC_2.32 __mbsrtowcs_chk F
 GLIBC_2.32 __mbstowcs_chk F
-GLIBC_2.32 __memalign_hook D 0x4
+GLIBC_2.32 __memalign_hook D 0x8
 GLIBC_2.32 __memcpy_chk F
 GLIBC_2.32 __memmove_chk F
 GLIBC_2.32 __mempcpy F
 GLIBC_2.32 __mempcpy_chk F
 GLIBC_2.32 __memset_chk F
 GLIBC_2.32 __monstartup F
-GLIBC_2.32 __morecore D 0x4
+GLIBC_2.32 __morecore D 0x8
 GLIBC_2.32 __mq_open_2 F
 GLIBC_2.32 __nanosleep F
 GLIBC_2.32 __newlocale F
@@ -329,8 +329,8 @@ GLIBC_2.32 __pread_chk F
 GLIBC_2.32 __printf_chk F
 GLIBC_2.32 __printf_fp F
 GLIBC_2.32 __profile_frequency F
-GLIBC_2.32 __progname D 0x4
-GLIBC_2.32 __progname_full D 0x4
+GLIBC_2.32 __progname D 0x8
+GLIBC_2.32 __progname_full D 0x8
 GLIBC_2.32 __pthread_cleanup_routine F
 GLIBC_2.32 __pthread_getspecific F
 GLIBC_2.32 __pthread_key_create F
@@ -359,12 +359,12 @@ GLIBC_2.32 __pthread_unwind_next F
 GLIBC_2.32 __ptsname_r_chk F
 GLIBC_2.32 __pwrite64 F
 GLIBC_2.32 __rawmemchr F
-GLIBC_2.32 __rcmd_errstr D 0x4
+GLIBC_2.32 __rcmd_errstr D 0x8
 GLIBC_2.32 __read F
 GLIBC_2.32 __read_chk F
 GLIBC_2.32 __readlink_chk F
 GLIBC_2.32 __readlinkat_chk F
-GLIBC_2.32 __realloc_hook D 0x4
+GLIBC_2.32 __realloc_hook D 0x8
 GLIBC_2.32 __realpath_chk F
 GLIBC_2.32 __recv_chk F
 GLIBC_2.32 __recvfrom_chk F
@@ -452,7 +452,7 @@ GLIBC_2.32 __swprintf_chk F
 GLIBC_2.32 __sysconf F
 GLIBC_2.32 __syslog_chk F
 GLIBC_2.32 __sysv_signal F
-GLIBC_2.32 __timezone D 0x4
+GLIBC_2.32 __timezone D 0x8
 GLIBC_2.32 __toascii_l F
 GLIBC_2.32 __tolower_l F
 GLIBC_2.32 __toupper_l F
@@ -461,7 +461,7 @@ GLIBC_2.32 __towctrans_l F
 GLIBC_2.32 __towlower_l F
 GLIBC_2.32 __towupper_l F
 GLIBC_2.32 __ttyname_r_chk F
-GLIBC_2.32 __tzname D 0x8
+GLIBC_2.32 __tzname D 0x10
 GLIBC_2.32 __uflow F
 GLIBC_2.32 __underflow F
 GLIBC_2.32 __uselocale F
@@ -531,7 +531,7 @@ GLIBC_2.32 __xstat F
 GLIBC_2.32 __xstat64 F
 GLIBC_2.32 _dl_mcount_wrapper F
 GLIBC_2.32 _dl_mcount_wrapper_check F
-GLIBC_2.32 _environ D 0x4
+GLIBC_2.32 _environ D 0x8
 GLIBC_2.32 _exit F
 GLIBC_2.32 _flush_cache F
 GLIBC_2.32 _flushlbf F
@@ -540,7 +540,7 @@ GLIBC_2.32 _longjmp F
 GLIBC_2.32 _mcleanup F
 GLIBC_2.32 _mcount F
 GLIBC_2.32 _nl_default_dirname D 0x12
-GLIBC_2.32 _nl_domain_bindings D 0x4
+GLIBC_2.32 _nl_domain_bindings D 0x8
 GLIBC_2.32 _nl_msg_cat_cntr D 0x4
 GLIBC_2.32 _obstack_allocated_p F
 GLIBC_2.32 _obstack_begin F
@@ -552,8 +552,8 @@ GLIBC_2.32 _pthread_cleanup_pop F
 GLIBC_2.32 _pthread_cleanup_pop_restore F
 GLIBC_2.32 _pthread_cleanup_push F
 GLIBC_2.32 _pthread_cleanup_push_defer F
-GLIBC_2.32 _res D 0x200
-GLIBC_2.32 _res_hconf D 0x30
+GLIBC_2.32 _res D 0x238
+GLIBC_2.32 _res_hconf D 0x48
 GLIBC_2.32 _setjmp F
 GLIBC_2.32 _tolower F
 GLIBC_2.32 _toupper F
@@ -592,9 +592,9 @@ GLIBC_2.32 argp_error F
 GLIBC_2.32 argp_failure F
 GLIBC_2.32 argp_help F
 GLIBC_2.32 argp_parse F
-GLIBC_2.32 argp_program_bug_address D 0x4
-GLIBC_2.32 argp_program_version D 0x4
-GLIBC_2.32 argp_program_version_hook D 0x4
+GLIBC_2.32 argp_program_bug_address D 0x8
+GLIBC_2.32 argp_program_version D 0x8
+GLIBC_2.32 argp_program_version_hook D 0x8
 GLIBC_2.32 argp_state_help F
 GLIBC_2.32 argp_usage F
 GLIBC_2.32 argz_add F
@@ -734,7 +734,7 @@ GLIBC_2.32 endttyent F
 GLIBC_2.32 endusershell F
 GLIBC_2.32 endutent F
 GLIBC_2.32 endutxent F
-GLIBC_2.32 environ D 0x4
+GLIBC_2.32 environ D 0x8
 GLIBC_2.32 envz_add F
 GLIBC_2.32 envz_entry F
 GLIBC_2.32 envz_get F
@@ -753,7 +753,7 @@ GLIBC_2.32 error F
 GLIBC_2.32 error_at_line F
 GLIBC_2.32 error_message_count D 0x4
 GLIBC_2.32 error_one_per_line D 0x4
-GLIBC_2.32 error_print_progname D 0x4
+GLIBC_2.32 error_print_progname D 0x8
 GLIBC_2.32 errx F
 GLIBC_2.32 ether_aton F
 GLIBC_2.32 ether_aton_r F
@@ -1078,7 +1078,7 @@ GLIBC_2.32 grantpt F
 GLIBC_2.32 group_member F
 GLIBC_2.32 gsignal F
 GLIBC_2.32 gtty F
-GLIBC_2.32 h_errlist D 0x14
+GLIBC_2.32 h_errlist D 0x28
 GLIBC_2.32 h_nerr D 0x4
 GLIBC_2.32 hasmntopt F
 GLIBC_2.32 hcreate F
@@ -1260,7 +1260,7 @@ GLIBC_2.32 malloc_stats F
 GLIBC_2.32 malloc_trim F
 GLIBC_2.32 malloc_usable_size F
 GLIBC_2.32 mallopt F
-GLIBC_2.32 mallwatch D 0x4
+GLIBC_2.32 mallwatch D 0x8
 GLIBC_2.32 mblen F
 GLIBC_2.32 mbrlen F
 GLIBC_2.32 mbrtoc16 F
@@ -1367,7 +1367,7 @@ GLIBC_2.32 ntohs F
 GLIBC_2.32 ntp_adjtime F
 GLIBC_2.32 ntp_gettime F
 GLIBC_2.32 ntp_gettimex F
-GLIBC_2.32 obstack_alloc_failed_handler D 0x4
+GLIBC_2.32 obstack_alloc_failed_handler D 0x8
 GLIBC_2.32 obstack_exit_failure D 0x4
 GLIBC_2.32 obstack_free F
 GLIBC_2.32 obstack_printf F
@@ -1383,7 +1383,7 @@ GLIBC_2.32 openat64 F
 GLIBC_2.32 opendir F
 GLIBC_2.32 openlog F
 GLIBC_2.32 openpty F
-GLIBC_2.32 optarg D 0x4
+GLIBC_2.32 optarg D 0x8
 GLIBC_2.32 opterr D 0x4
 GLIBC_2.32 optind D 0x4
 GLIBC_2.32 optopt D 0x4
@@ -1449,8 +1449,8 @@ GLIBC_2.32 prlimit64 F
 GLIBC_2.32 process_vm_readv F
 GLIBC_2.32 process_vm_writev F
 GLIBC_2.32 profil F
-GLIBC_2.32 program_invocation_name D 0x4
-GLIBC_2.32 program_invocation_short_name D 0x4
+GLIBC_2.32 program_invocation_name D 0x8
+GLIBC_2.32 program_invocation_short_name D 0x8
 GLIBC_2.32 pselect F
 GLIBC_2.32 psiginfo F
 GLIBC_2.32 psignal F
@@ -1637,7 +1637,7 @@ GLIBC_2.32 re_search F
 GLIBC_2.32 re_search_2 F
 GLIBC_2.32 re_set_registers F
 GLIBC_2.32 re_set_syntax F
-GLIBC_2.32 re_syntax_options D 0x4
+GLIBC_2.32 re_syntax_options D 0x8
 GLIBC_2.32 read F
 GLIBC_2.32 readahead F
 GLIBC_2.32 readdir F
@@ -1850,9 +1850,9 @@ GLIBC_2.32 statfs64 F
 GLIBC_2.32 statvfs F
 GLIBC_2.32 statvfs64 F
 GLIBC_2.32 statx F
-GLIBC_2.32 stderr D 0x4
-GLIBC_2.32 stdin D 0x4
-GLIBC_2.32 stdout D 0x4
+GLIBC_2.32 stderr D 0x8
+GLIBC_2.32 stdin D 0x8
+GLIBC_2.32 stdout D 0x8
 GLIBC_2.32 stpcpy F
 GLIBC_2.32 stpncpy F
 GLIBC_2.32 strcasecmp F
@@ -1984,7 +1984,7 @@ GLIBC_2.32 timerfd_gettime F
 GLIBC_2.32 timerfd_settime F
 GLIBC_2.32 times F
 GLIBC_2.32 timespec_get F
-GLIBC_2.32 timezone D 0x4
+GLIBC_2.32 timezone D 0x8
 GLIBC_2.32 tmpfile F
 GLIBC_2.32 tmpfile64 F
 GLIBC_2.32 tmpnam F
@@ -2013,7 +2013,7 @@ GLIBC_2.32 ttyname_r F
 GLIBC_2.32 ttyslot F
 GLIBC_2.32 twalk F
 GLIBC_2.32 twalk_r F
-GLIBC_2.32 tzname D 0x8
+GLIBC_2.32 tzname D 0x10
 GLIBC_2.32 tzset F
 GLIBC_2.32 ualarm F
 GLIBC_2.32 ulckpwdf F
diff --git a/sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libc_malloc_debug.abilist
similarity index 80%
rename from sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libc_malloc_debug.abilist
index cf9f611403..c50393d8cc 100644
--- a/sysdeps/unix/sysv/linux/arc/libc_malloc_debug.abilist
+++ b/sysdeps/unix/sysv/linux/arc/arc64/libc_malloc_debug.abilist
@@ -1,7 +1,7 @@
-GLIBC_2.32 __free_hook D 0x4
-GLIBC_2.32 __malloc_hook D 0x4
-GLIBC_2.32 __memalign_hook D 0x4
-GLIBC_2.32 __realloc_hook D 0x4
+GLIBC_2.32 __free_hook D 0x8
+GLIBC_2.32 __malloc_hook D 0x8
+GLIBC_2.32 __memalign_hook D 0x8
+GLIBC_2.32 __realloc_hook D 0x8
 GLIBC_2.32 aligned_alloc F
 GLIBC_2.32 calloc F
 GLIBC_2.32 free F
diff --git a/sysdeps/unix/sysv/linux/arc/libcrypt.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libcrypt.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libcrypt.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libcrypt.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libdl.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libdl.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libdl.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libdl.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libm.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libm.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libm.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libm.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libpthread.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libpthread.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libpthread.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libpthread.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libresolv.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libresolv.abilist
similarity index 95%
rename from sysdeps/unix/sysv/linux/arc/libresolv.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libresolv.abilist
index 47c5072f61..76ab1dedfb 100644
--- a/sysdeps/unix/sysv/linux/arc/libresolv.abilist
+++ b/sysdeps/unix/sysv/linux/arc/arc64/libresolv.abilist
@@ -10,7 +10,7 @@ GLIBC_2.32 __loc_ntoa F
 GLIBC_2.32 __p_cdname F
 GLIBC_2.32 __p_cdnname F
 GLIBC_2.32 __p_class F
-GLIBC_2.32 __p_class_syms D 0x54
+GLIBC_2.32 __p_class_syms D 0xa8
 GLIBC_2.32 __p_fqname F
 GLIBC_2.32 __p_fqnname F
 GLIBC_2.32 __p_option F
@@ -18,7 +18,7 @@ GLIBC_2.32 __p_query F
 GLIBC_2.32 __p_rcode F
 GLIBC_2.32 __p_time F
 GLIBC_2.32 __p_type F
-GLIBC_2.32 __p_type_syms D 0x228
+GLIBC_2.32 __p_type_syms D 0x450
 GLIBC_2.32 __putlong F
 GLIBC_2.32 __putshort F
 GLIBC_2.32 __res_close F
diff --git a/sysdeps/unix/sysv/linux/arc/librt.abilist b/sysdeps/unix/sysv/linux/arc/arc64/librt.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/librt.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/librt.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libthread_db.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libthread_db.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libthread_db.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libthread_db.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/libutil.abilist b/sysdeps/unix/sysv/linux/arc/arc64/libutil.abilist
similarity index 100%
rename from sysdeps/unix/sysv/linux/arc/libutil.abilist
rename to sysdeps/unix/sysv/linux/arc/arc64/libutil.abilist
diff --git a/sysdeps/unix/sysv/linux/arc/bits/fcntl.h b/sysdeps/unix/sysv/linux/arc/bits/fcntl.h
new file mode 100644
index 0000000000..20292fd32f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/bits/fcntl.h
@@ -0,0 +1,62 @@
+/* O_*, F_*, FD_* bit values for Linux / ARC
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef	_FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+/* In 64-bit ISA files are always with 64bit off_t and F_*LK64 are the same as
+   non-64-bit versions.  It will need to be revised for 128-bit.  */
+#if __WORDSIZE == 64
+# define __O_LARGEFILE	0
+
+# define F_GETLK64	5	/* Get record locking info.  */
+# define F_SETLK64	6	/* Set record locking info (non-blocking).  */
+# define F_SETLKW64	7	/* Set record locking info (blocking).	*/
+#endif
+
+struct flock
+  {
+    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
+#if __WORDSIZE == 64 || !defined __USE_FILE_OFFSET64
+    __off_t l_start;    /* Offset where the lock begins.  */
+    __off_t l_len;      /* Size of the locked area; zero means until EOF.  */
+#else
+    __off64_t l_start;  /* Offset where the lock begins.  */
+    __off64_t l_len;    /* Size of the locked area; zero means until EOF.  */
+#endif
+    __pid_t l_pid;      /* Process holding the lock.  */
+  };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+  {
+    short int l_type;   /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK.  */
+    short int l_whence; /* Where `l_start' is relative to (like `lseek').  */
+    __off64_t l_start;  /* Offset where the lock begins.  */
+    __off64_t l_len;    /* Size of the locked area; zero means until EOF.  */
+    __pid_t l_pid;      /* Process holding the lock.  */
+  };
+#endif
+
+/* Include generic Linux declarations.  */
+#include <bits/fcntl-linux.h>
diff --git a/sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h b/sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
index 795638a30b..6be69437f8 100644
--- a/sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
+++ b/sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
@@ -3,7 +3,7 @@
 #define ____sigset_t_defined
 
 /* Linux asm-generic syscall ABI expects sigset_t to hold 64 signals.  */
-#define _SIGSET_NWORDS (64 / (8 * sizeof (unsigned long int)))
+#define _SIGSET_NWORDS  2
 typedef struct
 {
   unsigned long int __val[_SIGSET_NWORDS];
diff --git a/sysdeps/unix/sysv/linux/arc/clone.S b/sysdeps/unix/sysv/linux/arc/clone.S
index d8c7b93d1c..364fa1edde 100644
--- a/sysdeps/unix/sysv/linux/arc/clone.S
+++ b/sysdeps/unix/sysv/linux/arc/clone.S
@@ -31,41 +31,41 @@
  clone syscall in kernel (ABI: CONFIG_CLONE_BACKWARDS)
 
   int sys_clone(unsigned long int clone_flags,
-	        unsigned long int newsp,
+		unsigned long int newsp,
 		int __user *parent_tidptr,
 		void *tls,
 		int __user *child_tidptr).  */
 
 ENTRY (__clone)
-	cmp	r0, 0		/* @fn can't be NULL.  */
-	and	r1,r1,-4	/* @child_stack be 4 bytes aligned per ABI.  */
-	cmp.ne	r1, 0		/* @child_stack can't be NULL.  */
+	CMPR	r0, 0		/* @fn can't be NULL.  */
+	ANDR	r1, r1, -REGSZ	/* @child_stack 4/8 aligned per ABI.  */
+	CMPR.ne	r1, 0		/* @child_stack can't be NULL.  */
 	bz	L (__sys_err)
 
 	/* save some of the orig args
 	   r0 containing @fn will be clobbered AFTER syscall (with ret val)
 	   rest are clobbered BEFORE syscall due to different arg ordering.  */
-	mov	r10, r0		/* @fn.  */
-	mov	r11, r3		/* @args.  */
-	mov	r12, r2		/* @clone_flags.  */
-	mov	r9,  r5		/* @tls.  */
+	MOVR	r10, r0		/* @fn.  */
+	MOVR	r11, r3		/* @args.  */
+	MOVR	r12, r2		/* @clone_flags.  */
+	MOVR	r9,  r5		/* @tls.  */
 
 	/* adjust libc args for syscall.  */
 
-	mov 	r0, r2		/* libc @flags is 1st syscall arg.  */
-	mov	r2, r4		/* libc @ptid.  */
-	mov	r3, r5		/* libc @tls.  */
-	mov	r4, r6		/* libc @ctid.  */
+	MOVR	r0, r2		/* libc @flags is 1st syscall arg.  */
+	MOVR	r2, r4		/* libc @ptid.  */
+	MOVR	r3, r5		/* libc @tls.  */
+	MOVR	r4, r6		/* libc @ctid.  */
 	mov	r8, __NR_clone
 	ARC_TRAP_INSN
 
-	cmp	r0, 0		/* return code : 0 new process, !0 parent.  */
+	CMPR	r0, 0		/* return code : 0 new process, !0 parent.  */
 	beq	thread_start_clone
 	blt	L (__sys_err2)	/* < 0 (signed) error.  */
 	j	[blink]		/* Parent returns.  */
 
 L (__sys_err):
-	mov	r0, -EINVAL
+	MOVR	r0, -EINVAL
 L (__sys_err2):
 	/* (1) No need to make -ve kernel error code as positive errno
 	       __syscall_error expects the -ve error code returned by kernel
@@ -87,7 +87,7 @@ thread_start_clone:
 
 	/* Child jumps off to @fn with @arg as argument.  */
 	jl.d	[r10]
-	mov	r0, r11
+	MOVR	r0, r11
 
 	/* exit() with result from @fn (already in r0).  */
 	mov	r8, __NR_exit
diff --git a/sysdeps/unix/sysv/linux/arc/clone3.S b/sysdeps/unix/sysv/linux/arc/clone3.S
index 87a8272a39..7fc61524b5 100644
--- a/sysdeps/unix/sysv/linux/arc/clone3.S
+++ b/sysdeps/unix/sysv/linux/arc/clone3.S
@@ -37,9 +37,9 @@
 ENTRY(__clone3)
 
 	/* Save args for the child.  */
-	mov	r10, r0		/* cl_args  */
-	mov	r11, r2		/* func	 */
-	mov	r12, r3		/* args  */
+	MOVR	r10, r0		/* cl_args  */
+	MOVR	r11, r2		/* func  */
+	MOVR	r12, r3		/* args  */
 
 	/* Sanity check args.  */
 	breq	r10, 0, L (__sys_err)	/* No NULL cl_args pointer.  */
@@ -49,17 +49,17 @@ ENTRY(__clone3)
 	   r8: system call number
 	   r0: cl_args
 	   r1: size  */
-	mov	r0, r10
+	MOVR	r0, r10
 	mov	r8, __NR_clone3
 	ARC_TRAP_INSN
 
-	cmp	r0, 0
+	CMPR	r0, 0
 	beq	thread_start_clone3	/* Child returns.  */
 	blt	L (__sys_err2)
 	j	[blink]			/* Parent returns.  */
 
 L (__sys_err):
-	mov	r0, -EINVAL
+	MOVR	r0, -EINVAL
 L (__sys_err2):
 	b	__syscall_error
 PSEUDO_END (__clone3)
@@ -74,7 +74,7 @@ thread_start_clone3:
 
 	/* Child jumps off to @fn with @arg as argument.  */
 	jl.d	[r11]
-	mov	r0, r12
+	MOVR	r0, r12
 
 	/* exit() with result from @fn (already in r0).  */
 	mov	r8, __NR_exit
diff --git a/sysdeps/unix/sysv/linux/arc/getcontext.S b/sysdeps/unix/sysv/linux/arc/getcontext.S
index eb75c8ce02..851981b64c 100644
--- a/sysdeps/unix/sysv/linux/arc/getcontext.S
+++ b/sysdeps/unix/sysv/linux/arc/getcontext.S
@@ -26,39 +26,58 @@
 ENTRY (__getcontext)
 
 	/* Callee saved registers.  */
-	add r2, r0, UCONTEXT_MCONTEXT
-	STR (r13,   r2, 37)
-	STR (r14,   r2, 36)
-	STR (r15,   r2, 35)
-	STR (r16,   r2, 34)
-	STR (r17,   r2, 33)
-	STR (r18,   r2, 32)
-	STR (r19,   r2, 31)
-	STR (r20,   r2, 30)
-	STR (r21,   r2, 29)
-	STR (r22,   r2, 28)
-	STR (r23,   r2, 27)
-	STR (r24,   r2, 26)
+	ADDR r2, r0, UCONTEXT_MCONTEXT
+	STR.as r13,   r2, 37
+	STR.as r14,   r2, 36
+	STR.as r15,   r2, 35
+	STR.as r16,   r2, 34
+	STR.as r17,   r2, 33
+	STR.as r18,   r2, 32
+	STR.as r19,   r2, 31
+	STR.as r20,   r2, 30
+	STR.as r21,   r2, 29
+	STR.as r22,   r2, 28
+	STR.as r23,   r2, 27
+	STR.as r24,   r2, 26
 
-	STR (blink, r2,  7)
-	STR (fp,    r2,  8)
-	STR (gp,    r2,  9)
-	STR (sp,    r2, 23)
+	STR.as blink, r2,  7
+	STR.as fp,    r2,  8
+	STR.as gp,    r2,  9
+	STR.as sp,    r2, 23
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FSTR.as	f16,  r2, 51
+	FSTR.as	f17,  r2, 52
+	FSTR.as	f18,  r2, 53
+	FSTR.as	f19,  r2, 54
+	FSTR.as	f20,  r2, 55
+	FSTR.as	f21,  r2, 56
+	FSTR.as	f22,  r2, 57
+	FSTR.as	f23,  r2, 58
+	FSTR.as	f24,  r2, 59
+	FSTR.as	f25,  r2, 60
+	FSTR.as	f26,  r2, 61
+	FSTR.as	f27,  r2, 62
+	FSTR.as	f28,  r2, 63
+	FSTR.as	f29,  r2, 64
+	FSTR.as	f30,  r2, 65
+	FSTR.as	f31,  r2, 66
+#endif
 
 	/* Save 0 in r0 placeholder to return 0 when this @ucp activated.  */
-	mov r9, 0
-	STR (r9,    r2, 22)
+	mov    r9, 0
+	STR.as r9,    r2, 22
 
 	/* rt_sigprocmask (SIG_BLOCK, NULL, &ucp->uc_sigmask, _NSIG8).  */
-	mov r3, _NSIG8
-	add r2, r0, UCONTEXT_SIGMASK
-	mov r1, 0
-	mov r0, SIG_BLOCK
-	mov r8, __NR_rt_sigprocmask
+	mov    r3, _NSIG8
+	ADDR   r2, r0, UCONTEXT_SIGMASK
+	mov    r1, 0
+	mov    r0, SIG_BLOCK
+	mov    r8, __NR_rt_sigprocmask
 	ARC_TRAP_INSN
-	brhi    r0, -1024, L (call_syscall_err)
+	BRRhi   r0, -1024, L (call_syscall_err)
 	j.d	[blink]
-	mov r0, 0	/* Success, error handled in .Lcall_syscall_err.  */
+	mov     r0, 0	/* Success, error handled in .Lcall_syscall_err.  */
 
 PSEUDO_END (__getcontext)
 weak_alias (__getcontext, getcontext)
diff --git a/sysdeps/unix/sysv/linux/arc/setcontext.S b/sysdeps/unix/sysv/linux/arc/setcontext.S
index 12708379d2..e0b8b1a183 100644
--- a/sysdeps/unix/sysv/linux/arc/setcontext.S
+++ b/sysdeps/unix/sysv/linux/arc/setcontext.S
@@ -24,46 +24,74 @@
 
 ENTRY (__setcontext)
 
-	mov  r9, r0	/* Stash @ucp across syscall.  */
+	MOVR  r9, r0	/* Stash @ucp across syscall.  */
 
 	/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, NULL, _NSIG8).  */
 	mov  r3, _NSIG8
 	mov  r2, 0
-	add  r1, r0, UCONTEXT_SIGMASK
+	ADDR  r1, r0, UCONTEXT_SIGMASK
 	mov  r0, SIG_SETMASK
 	mov  r8, __NR_rt_sigprocmask
 	ARC_TRAP_INSN
-	brhi r0, -1024, L (call_syscall_err)
+	BRRhi r0, -1024, L (call_syscall_err)
 
 	/* Restore scratch/arg regs for makecontext case.  */
 	add r9, r9, UCONTEXT_MCONTEXT
-	LDR (r0,    r9, 22)
-	LDR (r1,    r9, 21)
-	LDR (r2,    r9, 20)
-	LDR (r3,    r9, 19)
-	LDR (r4,    r9, 18)
-	LDR (r5,    r9, 17)
-	LDR (r6,    r9, 16)
-	LDR (r7,    r9, 15)
+	LDR.as r0,    r9, 22
+	LDR.as r1,    r9, 21
+	LDR.as r2,    r9, 20
+	LDR.as r3,    r9, 19
+	LDR.as r4,    r9, 18
+	LDR.as r5,    r9, 17
+	LDR.as r6,    r9, 16
+	LDR.as r7,    r9, 15
 
 	/* Restore callee saved registers.  */
-	LDR (r13,   r9, 37)
-	LDR (r14,   r9, 36)
-	LDR (r15,   r9, 35)
-	LDR (r16,   r9, 34)
-	LDR (r17,   r9, 33)
-	LDR (r18,   r9, 32)
-	LDR (r19,   r9, 31)
-	LDR (r20,   r9, 30)
-	LDR (r21,   r9, 29)
-	LDR (r22,   r9, 28)
-	LDR (r23,   r9, 27)
-	LDR (r24,   r9, 26)
-
-	LDR (blink, r9,  7)
-	LDR (fp,    r9,  8)
-	LDR (gp,    r9,  9)
-	LDR (sp,    r9, 23)
+	LDR.as r13,   r9, 37
+	LDR.as r14,   r9, 36
+	LDR.as r15,   r9, 35
+	LDR.as r16,   r9, 34
+	LDR.as r17,   r9, 33
+	LDR.as r18,   r9, 32
+	LDR.as r19,   r9, 31
+	LDR.as r20,   r9, 30
+	LDR.as r21,   r9, 29
+	LDR.as r22,   r9, 28
+	LDR.as r23,   r9, 27
+	LDR.as r24,   r9, 26
+
+	LDR.as blink, r9,  7
+	LDR.as fp,    r9,  8
+	LDR.as gp,    r9,  9
+	LDR.as sp,    r9, 23
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FLDR.as	f0,   r9, 43
+	FLDR.as	f1,   r9, 44
+	FLDR.as	f2,   r9, 45
+	FLDR.as	f3,   r9, 46
+	FLDR.as	f4,   r9, 47
+	FLDR.as	f5,   r9, 48
+	FLDR.as	f6,   r9, 49
+	FLDR.as	f7,   r9, 50
+
+	FLDR.as	f16,  r9, 51
+	FLDR.as	f17,  r9, 52
+	FLDR.as	f18,  r9, 53
+	FLDR.as	f19,  r9, 54
+	FLDR.as	f20,  r9, 55
+	FLDR.as	f21,  r9, 56
+	FLDR.as	f22,  r9, 57
+	FLDR.as	f23,  r9, 58
+	FLDR.as	f24,  r9, 59
+	FLDR.as	f25,  r9, 60
+	FLDR.as	f26,  r9, 61
+	FLDR.as	f27,  r9, 62
+	FLDR.as	f28,  r9, 63
+	FLDR.as	f29,  r9, 64
+	FLDR.as	f30,  r9, 66
+	FLDR.as	f31,  r9, 68
+#endif
 
 	j    [blink]
 
@@ -83,8 +111,8 @@ ENTRY (__startcontext)
 	jl   [r14]
 
 	/* If uc_link (r15) call setcontext with that.  */
-	mov  r0, r15
-	breq r0, 0, 1f
+	MOVR  r0, r15
+	BRReq r0, 0, 1f
 
 	bl   __setcontext
 1:
diff --git a/sysdeps/unix/sysv/linux/arc/shlib-versions b/sysdeps/unix/sysv/linux/arc/shlib-versions
index 343c0a0450..92a61e53fc 100644
--- a/sysdeps/unix/sysv/linux/arc/shlib-versions
+++ b/sysdeps/unix/sysv/linux/arc/shlib-versions
@@ -1,7 +1,15 @@
 DEFAULT                 GLIBC_2.32
 
+%ifdef HAVE_ARC32
+ld=ld-linux-arc32.so.2
+%else
+%ifdef HAVE_ARC64
+ld=ld-linux-arc64.so.2
+%else
 %ifdef HAVE_ARC_BE
 ld=ld-linux-arceb.so.2
 %else
 ld=ld-linux-arc.so.2
 %endif
+%endif
+%endif
diff --git a/sysdeps/unix/sysv/linux/arc/swapcontext.S b/sysdeps/unix/sysv/linux/arc/swapcontext.S
index 76111af596..ff1741a08a 100644
--- a/sysdeps/unix/sysv/linux/arc/swapcontext.S
+++ b/sysdeps/unix/sysv/linux/arc/swapcontext.S
@@ -24,69 +24,88 @@ ENTRY (__swapcontext)
 
 	/* Save context into @oucp pointed to by r0.  */
 
-	add r2, r0, UCONTEXT_MCONTEXT
-	STR (r13,   r2, 37)
-	STR (r14,   r2, 36)
-	STR (r15,   r2, 35)
-	STR (r16,   r2, 34)
-	STR (r17,   r2, 33)
-	STR (r18,   r2, 32)
-	STR (r19,   r2, 31)
-	STR (r20,   r2, 30)
-	STR (r21,   r2, 29)
-	STR (r22,   r2, 28)
-	STR (r23,   r2, 27)
-	STR (r24,   r2, 26)
-
-	STR (blink, r2,  7)
-	STR (fp,    r2,  8)
-	STR (gp,    r2,  9)
-	STR (sp,    r2, 23)
+	ADDR   r2, r0, UCONTEXT_MCONTEXT
+	STR.as r13,   r2, 37
+	STR.as r14,   r2, 36
+	STR.as r15,   r2, 35
+	STR.as r16,   r2, 34
+	STR.as r17,   r2, 33
+	STR.as r18,   r2, 32
+	STR.as r19,   r2, 31
+	STR.as r20,   r2, 30
+	STR.as r21,   r2, 29
+	STR.as r22,   r2, 28
+	STR.as r23,   r2, 27
+	STR.as r24,   r2, 26
+
+	STR.as blink, r2,  7
+	STR.as fp,    r2,  8
+	STR.as gp,    r2,  9
+	STR.as sp,    r2, 23
+
+#if defined (__ARC_FLOAT_ABI_HARD__)
+	FSTR.as	f16,  r2, 51
+	FSTR.as	f17,  r2, 52
+	FSTR.as	f18,  r2, 53
+	FSTR.as	f19,  r2, 54
+	FSTR.as	f20,  r2, 55
+	FSTR.as	f21,  r2, 56
+	FSTR.as	f22,  r2, 57
+	FSTR.as	f23,  r2, 58
+	FSTR.as	f24,  r2, 59
+	FSTR.as	f25,  r2, 60
+	FSTR.as	f26,  r2, 61
+	FSTR.as	f27,  r2, 62
+	FSTR.as	f28,  r2, 63
+	FSTR.as	f29,  r2, 64
+	FSTR.as	f30,  r2, 65
+	FSTR.as	f31,  r2, 66
+#endif
 
 	/* Save 0 in r0 placeholder to return 0 when @oucp activated.  */
-	mov r9, 0
-	STR (r9,    r2, 22)
+	mov   r9, 0
+	STR.as r9,    r2, 22
 
 	/* Load context from @ucp.  */
 
-	mov r9, r1	/* Safekeep @ucp across syscall.  */
+	MOVR   r9, r1	/* Safekeep @ucp across syscall.  */
 
 	/* rt_sigprocmask (SIG_SETMASK, &ucp->uc_sigmask, &oucp->uc_sigmask, _NSIG8) */
-	mov r3, _NSIG8
-	add r2, r0, UCONTEXT_SIGMASK
-	add r1, r1, UCONTEXT_SIGMASK
-	mov r0, SIG_SETMASK
-	mov r8, __NR_rt_sigprocmask
+	mov   r3, _NSIG8
+	ADDR   r2, r0, UCONTEXT_SIGMASK
+	ADDR   r1, r1, UCONTEXT_SIGMASK
+	mov   r0, SIG_SETMASK
+	mov   r8, __NR_rt_sigprocmask
 	ARC_TRAP_INSN
-	brhi r0, -1024, L (call_syscall_err)
-
-	add r9, r9, UCONTEXT_MCONTEXT
-	LDR (r0,    r9, 22)
-	LDR (r1,    r9, 21)
-	LDR (r2,    r9, 20)
-	LDR (r3,    r9, 19)
-	LDR (r4,    r9, 18)
-	LDR (r5,    r9, 17)
-	LDR (r6,    r9, 16)
-	LDR (r7,    r9, 15)
-
-	LDR (r13,   r9, 37)
-	LDR (r14,   r9, 36)
-	LDR (r15,   r9, 35)
-	LDR (r16,   r9, 34)
-	LDR (r17,   r9, 33)
-	LDR (r18,   r9, 32)
-	LDR (r19,   r9, 31)
-	LDR (r20,   r9, 30)
-	LDR (r21,   r9, 29)
-	LDR (r22,   r9, 28)
-	LDR (r23,   r9, 27)
-	LDR (r24,   r9, 26)
-
-	LDR (blink, r9,  7)
-	LDR (fp,    r9,  8)
-	LDR (gp,    r9,  9)
-	LDR (sp,    r9, 23)
+	BRRhi  r0, -1024, L (call_syscall_err)
+
+	ADDR   r9, r9, UCONTEXT_MCONTEXT
+	LDR.as r0,    r9, 22
+	LDR.as r1,    r9, 21
+	LDR.as r2,    r9, 20
+	LDR.as r3,    r9, 19
+	LDR.as r4,    r9, 18
+	LDR.as r5,    r9, 17
+	LDR.as r6,    r9, 16
+	LDR.as r7,    r9, 15
+
+	LDR.as r13,   r9, 37
+	LDR.as r14,   r9, 36
+	LDR.as r15,   r9, 35
+	LDR.as r16,   r9, 34
+	LDR.as r17,   r9, 33
+	LDR.as r18,   r9, 32
+	LDR.as r19,   r9, 31
+	LDR.as r20,   r9, 30
+	LDR.as r21,   r9, 29
+	LDR.as r22,   r9, 28
+	LDR.as r23,   r9, 27
+	LDR.as r24,   r9, 26
+
+	LDR.as blink, r9,  7
+	LDR.as fp,    r9,  8
+	LDR.as gp,    r9,  9
+	LDR.as sp,    r9, 23
 
 	j    [blink]
 
diff --git a/sysdeps/unix/sysv/linux/arc/sys/ucontext.h b/sysdeps/unix/sysv/linux/arc/sys/ucontext.h
index 831b81a922..3a0f1d4aba 100644
--- a/sysdeps/unix/sysv/linux/arc/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/arc/sys/ucontext.h
@@ -42,6 +42,7 @@ typedef struct
   unsigned long int __efa;
   unsigned long int __stop_pc;
   unsigned long int __r30, __r58, __r59;
+  unsigned long int __fpr[32];
 } mcontext_t;
 
 /* Userlevel context.  */
diff --git a/sysdeps/unix/sysv/linux/arc/syscall.S b/sysdeps/unix/sysv/linux/arc/syscall.S
index c6ca329e9a..db1ffdad2a 100644
--- a/sysdeps/unix/sysv/linux/arc/syscall.S
+++ b/sysdeps/unix/sysv/linux/arc/syscall.S
@@ -19,15 +19,15 @@
 #include <sysdep.h>
 
 ENTRY (syscall)
-	mov_s	r8, r0
-	mov_s	r0, r1
-	mov_s	r1, r2
-	mov_s	r2, r3
-	mov_s	r3, r4
-	mov_s	r4, r5
-	mov_s	r5, r6
+	MOVR	r8, r0
+	MOVR	r0, r1
+	MOVR	r1, r2
+	MOVR	r2, r3
+	MOVR	r3, r4
+	MOVR	r4, r5
+	MOVR	r5, r6
 
 	ARC_TRAP_INSN
-	brhi	r0, -4096, L (call_syscall_err)
+	BRRhi	r0, -4096, L (call_syscall_err)
 	j	[blink]
 PSEUDO_END (syscall)
diff --git a/sysdeps/unix/sysv/linux/arc/sysdep.h b/sysdeps/unix/sysv/linux/arc/sysdep.h
index 7f90d64124..14d11f038b 100644
--- a/sysdeps/unix/sysv/linux/arc/sysdep.h
+++ b/sysdeps/unix/sysv/linux/arc/sysdep.h
@@ -26,6 +26,8 @@
 
 /* "workarounds" for generic code needing to handle 64-bit time_t.  */
 
+#ifndef __ARC64_ARCH64__
+
 /* Fix sysdeps/unix/sysv/linux/clock_getcpuclockid.c.  */
 #define __NR_clock_getres	__NR_clock_getres_time64
 /* Fix sysdeps/nptl/lowlevellock-futex.h.  */
@@ -43,6 +45,8 @@
 /* Hack sysdeps/unix/sysv/linux/generic/utimes.c.  */
 #define __NR_utimensat		__NR_utimensat_time64
 
+#endif
+
 /* For RTLD_PRIVATE_ERRNO.  */
 #include <dl-sysdep.h>
 
@@ -59,7 +63,7 @@
 # undef PSEUDO
 # define PSEUDO(name, syscall_name, args)			\
   PSEUDO_NOERRNO(name, syscall_name, args)	ASM_LINE_SEP	\
-    brhi   r0, -4096, L (call_syscall_err)	ASM_LINE_SEP
+    BRRhi   r0, -4096, L (call_syscall_err)	ASM_LINE_SEP
 
 # define ret	j_s  [blink]
 
@@ -98,7 +102,7 @@
 
 /* Don't set errno, return kernel error (in errno form) or zero.  */
 # define ret_ERRVAL						\
-  rsub   r0, r0, 0				ASM_LINE_SEP	\
+  SUBR   r0, 0, r0				ASM_LINE_SEP	\
   ret_NOERRNO
 
 # undef PSEUDO_END_ERRVAL
@@ -117,12 +121,12 @@
 
 # define SYSCALL_ERROR_HANDLER				\
 L (call_syscall_err):			ASM_LINE_SEP	\
-    push_s   blink			ASM_LINE_SEP	\
-    cfi_adjust_cfa_offset (4)		ASM_LINE_SEP	\
+    PUSHR blink				ASM_LINE_SEP	\
+    cfi_adjust_cfa_offset (REGSZ)	ASM_LINE_SEP	\
     cfi_rel_offset (blink, 0)		ASM_LINE_SEP	\
     CALL_ERRNO_SETTER_C			ASM_LINE_SEP	\
-    pop_s  blink			ASM_LINE_SEP	\
-    cfi_adjust_cfa_offset (-4)		ASM_LINE_SEP	\
+    POPR  blink				ASM_LINE_SEP	\
+    cfi_adjust_cfa_offset (-REGSZ)	ASM_LINE_SEP	\
     cfi_restore (blink)			ASM_LINE_SEP	\
     j_s      [blink]
 
diff --git a/sysdeps/unix/sysv/linux/arc/vfork.S b/sysdeps/unix/sysv/linux/arc/vfork.S
index 57b85988e3..57bd8d3d81 100644
--- a/sysdeps/unix/sysv/linux/arc/vfork.S
+++ b/sysdeps/unix/sysv/linux/arc/vfork.S
@@ -28,11 +28,11 @@
 
 ENTRY (__vfork)
 	mov	r0, CLONE_FLAGS_FOR_VFORK
-	mov_s	r1, sp
+	MOVR	r1, sp
 	mov	r8, __NR_clone
 	ARC_TRAP_INSN
 
-	cmp	r0, 0
+	CMPR	r0, 0
 	jge	[blink]	; child continues
 
 	b   __syscall_error
diff --git a/timezone/zic.c b/timezone/zic.c
index 2875b5544c..3d606c8e6e 100644
--- a/timezone/zic.c
+++ b/timezone/zic.c
@@ -39,7 +39,7 @@ typedef int_fast64_t	zic_t;
 #include <sys/stat.h>
 #endif
 #ifdef S_IRUSR
-#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)
+#define MKDIR_UMASK (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH|S_IWOTH)
 #else
 #define MKDIR_UMASK 0755
 #endif
-- 
2.31.1