aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro-toolchain/recipes-core/glibc/glibc-linaro-2.20/0030-Make-lp64-and-ilp32-directories.patch
blob: 01cbfcd121532e1a28da02000d6d49a58d5a21d1 (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
From 3df8339b4b902af706f313b7848871b0aecb3088 Mon Sep 17 00:00:00 2001
From: Andrew Pinski <apinski@cavium.com>
Date: Mon, 27 Oct 2014 00:59:53 -0700
Subject: [PATCH 30/32] Make lp64 and ilp32 directories.

The patch makes the ilp32 and lp64 have their own directory under aarch64.
Since ILP32 uses most of the same system calls as LP64 and has a 64bit
off_t, we need make the functions that end in 64 the same as the ones without.
We also need not to special case ioctl or use the already provided mmap.c file.

ChangeLog:
	* sysdeps/aarch64/ilp32/Implies: New file.
	* sysdeps/aarch64/Implies: Rename to
	* sysdeps/aarch64/lp64/Implies: This.
	* sysdeps/unix/sysv/linux/aarch64/shlib-versions: Rename to ...
	* sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions: This.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/Implies: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/Versions: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c: New file
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h: New file.
	* sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c: New file.
---
 sysdeps/aarch64/Implies                            |  6 --
 sysdeps/aarch64/ilp32/Implies                      |  6 ++
 sysdeps/aarch64/lp64/Implies                       |  7 +++
 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies      |  3 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/Versions     |  5 ++
 sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c      |  2 +
 .../unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c  |  6 ++
 sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c  |  1 +
 .../unix/sysv/linux/aarch64/ilp32/fallocate64.c    |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c  |  1 +
 .../unix/sysv/linux/aarch64/ilp32/ftruncate64.c    |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c     |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c |  2 +
 .../unix/sysv/linux/aarch64/ilp32/getrlimit64.c    |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c       |  1 +
 .../unix/sysv/linux/aarch64/ilp32/kernel_stat.h    | 24 ++++++++
 sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c     |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c     |  1 +
 .../sysv/linux/aarch64/ilp32/posix_fadvise64.c     |  1 +
 .../sysv/linux/aarch64/ilp32/posix_fallocate.c     |  1 +
 .../sysv/linux/aarch64/ilp32/posix_fallocate64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c    |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c  |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c     | 66 ++++++++++++++++++++++
 sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c |  1 +
 .../unix/sysv/linux/aarch64/ilp32/setrlimit64.c    |  1 +
 .../unix/sysv/linux/aarch64/ilp32/shlib-versions   |  7 +++
 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c   |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c    |  5 ++
 sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c  |  1 +
 .../unix/sysv/linux/aarch64/ilp32/syscalls.list    | 21 +++++++
 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c      |  1 +
 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c    |  1 +
 sysdeps/unix/sysv/linux/aarch64/ioctl.S            | 31 ----------
 sysdeps/unix/sysv/linux/aarch64/lp64/Implies       |  4 ++
 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S       | 31 ++++++++++
 .../unix/sysv/linux/aarch64/lp64/shlib-versions    |  7 +++
 sysdeps/unix/sysv/linux/aarch64/mmap.c             | 34 -----------
 46 files changed, 224 insertions(+), 71 deletions(-)
 delete mode 100644 sysdeps/aarch64/Implies
 create mode 100644 sysdeps/aarch64/ilp32/Implies
 create mode 100644 sysdeps/aarch64/lp64/Implies
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Implies
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/Versions
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/ioctl.S
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/Implies
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S
 create mode 100644 sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions
 delete mode 100644 sysdeps/unix/sysv/linux/aarch64/mmap.c

diff --git a/sysdeps/aarch64/Implies b/sysdeps/aarch64/Implies
deleted file mode 100644
index e5adf4d..0000000
--- a/sysdeps/aarch64/Implies
+++ /dev/null
@@ -1,6 +0,0 @@
-wordsize-64
-ieee754/ldbl-128
-ieee754/dbl-64/wordsize-64
-ieee754/dbl-64
-ieee754/flt-32
-aarch64/soft-fp
diff --git a/sysdeps/aarch64/ilp32/Implies b/sysdeps/aarch64/ilp32/Implies
new file mode 100644
index 0000000..705bc5b
--- /dev/null
+++ b/sysdeps/aarch64/ilp32/Implies
@@ -0,0 +1,6 @@
+aarch64
+wordsize-32
+ieee754/ldbl-128
+ieee754/dbl-64
+ieee754/flt-32
+aarch64/soft-fp
diff --git a/sysdeps/aarch64/lp64/Implies b/sysdeps/aarch64/lp64/Implies
new file mode 100644
index 0000000..d2fbde7
--- /dev/null
+++ b/sysdeps/aarch64/lp64/Implies
@@ -0,0 +1,7 @@
+aarch64
+wordsize-64
+ieee754/ldbl-128
+ieee754/dbl-64/wordsize-64
+ieee754/dbl-64
+ieee754/flt-32
+aarch64/soft-fp
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies b/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies
new file mode 100644
index 0000000..a88511b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/Implies
@@ -0,0 +1,3 @@
+aarch64/nptl
+unix/sysv/linux/aarch64
+unix/sysv/linux/generic
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/Versions b/sysdeps/unix/sysv/linux/aarch64/ilp32/Versions
new file mode 100644
index 0000000..58b6bfb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/Versions
@@ -0,0 +1,5 @@
+libc {
+  GLIBC_2.21 {
+    fallocate64;
+  }
+}
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c
new file mode 100644
index 0000000..05feb3d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/creat.c
@@ -0,0 +1,2 @@
+#include <sysdeps/unix/sysv/linux/generic/creat.c>
+weak_alias (__libc_creat, creat64)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c
new file mode 100644
index 0000000..339e5f4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/dl-fxstatat64.c
@@ -0,0 +1,6 @@
+/* In this implementation we do not really care whether the call fails
+   because of missing kernel support since we do not even call the
+   function in this case.  */
+#undef __ASSUME_ATFCTS
+#define __ASSUME_ATFCTS 1
+#include "fxstatat.c"
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c
new file mode 100644
index 0000000..d3b7218
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate64.c
new file mode 100644
index 0000000..df33112
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fallocate64.c
@@ -0,0 +1 @@
+/* fallocate64 is in posix_fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c
new file mode 100644
index 0000000..2be4e59
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fstatfs64.c
@@ -0,0 +1 @@
+/* fstatfs64 is the same as fstatfs. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c
new file mode 100644
index 0000000..673a8b5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/ftruncate64.c
@@ -0,0 +1 @@
+/* ftruncate64 is the same as ftruncate. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c
new file mode 100644
index 0000000..272b6be
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/fxstat.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c
new file mode 100644
index 0000000..9eff9eb
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstat64.c
@@ -0,0 +1 @@
+/* fxstat64 is in fxstat.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c
new file mode 100644
index 0000000..689cd57
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c
new file mode 100644
index 0000000..05e7f41
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/fxstatat64.c
@@ -0,0 +1 @@
+/* fxstatat64 is in fxstatat.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c
new file mode 100644
index 0000000..14dbbc7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents.c
@@ -0,0 +1 @@
+/* Defined in getdents64.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c
new file mode 100644
index 0000000..08987ea
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getdents64.c
@@ -0,0 +1,2 @@
+#include <sysdeps/unix/sysv/linux/generic/getdents64.c>
+strong_alias (__getdents64, __getdents)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c
new file mode 100644
index 0000000..9feab0e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/getrlimit64.c
@@ -0,0 +1 @@
+/* getrlimit64 is the same as getrlimit. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c
new file mode 100644
index 0000000..e542747
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/glob.c
@@ -0,0 +1 @@
+#include <sysdeps/wordsize-64/glob.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h b/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h
new file mode 100644
index 0000000..91e01ba
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 2011-2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Chris Metcalf <cmetcalf@tilera.com>, 2011.
+
+   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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdeps/unix/sysv/linux/generic/kernel_stat.h>
+
+/* ILP32 has no overflow checks. */
+#ifndef __LP64__
+#define XSTAT_IS_XSTAT64 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c
new file mode 100644
index 0000000..24013a8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/llseek.c
@@ -0,0 +1 @@
+/* lseek() is 64-bit capable already.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c
new file mode 100644
index 0000000..bb5dbd0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/lxstat64.c
@@ -0,0 +1 @@
+/* lxstat64 is in lxstat.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c
new file mode 100644
index 0000000..8e32bae
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/mmap64.c
@@ -0,0 +1 @@
+/* mmap64 is provided by mmap as they are the same. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c
new file mode 100644
index 0000000..c9f72c4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fadvise64.c
@@ -0,0 +1 @@
+/* posix_fadvise64 is in posix_fadvise.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate.c
new file mode 100644
index 0000000..b3fe81b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/wordsize-64/posix_fallocate.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate64.c
new file mode 100644
index 0000000..f466f13
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/posix_fallocate64.c
@@ -0,0 +1 @@
+/* posix_fallocate64 is in posix_fallocate.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c
new file mode 100644
index 0000000..b7f298d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/pread64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c
new file mode 100644
index 0000000..0a20301
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/preadv64.c
@@ -0,0 +1 @@
+/* preadv64 is the same as preadv. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c
new file mode 100644
index 0000000..b7f298d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/pwrite64.c
@@ -0,0 +1 @@
+/* Empty since the pread syscall is equivalent.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c
new file mode 100644
index 0000000..e96c6f2
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/pwritev64.c
@@ -0,0 +1 @@
+/* pwritev64 is the same as pwritev. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c
new file mode 100644
index 0000000..0652405
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/semctl.c
@@ -0,0 +1,66 @@
+/* Copyright (C) 2007-2014 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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <stdarg.h>
+#include <sys/sem.h>
+#include <ipc_priv.h>
+#include <sysdep.h>
+
+/* Define a `union semun' that is for glibc here.  */
+union semun
+{
+  int val;			/* value for SETVAL */
+  struct semid_ds *buf;		/* buffer for IPC_STAT & IPC_SET */
+  unsigned short int *array;	/* array for GETALL & SETALL */
+  struct seminfo *__buf;	/* buffer for IPC_INFO */
+};
+
+union semun_kernel
+{
+  int val;			/* value for SETVAL */
+  unsigned long long kern_ptr;
+};
+
+int __semctl (int semid, int semnum, int cmd, ...);
+
+int
+__semctl (int semid, int semnum, int cmd, ...)
+{
+  union semun arg;
+  union semun_kernel arg_real;
+  va_list ap;
+
+  va_start (ap, cmd);
+
+  /* Get the argument.  */
+  arg = va_arg (ap, union semun);
+
+  va_end (ap);
+
+  arg_real.kern_ptr = 0;
+  if (cmd == SETVAL)
+    arg_real.val = arg.val;
+  else
+    arg_real.kern_ptr = (unsigned long long)(uintptr_t)arg.array;
+
+  return INLINE_SYSCALL (semctl, 4, semid, semnum, cmd,
+			 arg_real.kern_ptr);
+}
+
+#include <shlib-compat.h>
+versioned_symbol (libc, __semctl, semctl, GLIBC_2_0);
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c
new file mode 100644
index 0000000..4c451bd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/sendfile64.c
@@ -0,0 +1 @@
+/* sendfile64 is alias of sendfile syscall.  */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c
new file mode 100644
index 0000000..8edcff0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/setrlimit64.c
@@ -0,0 +1 @@
+/* setrlimit64 is the same as setrlimit. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions b/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions
new file mode 100644
index 0000000..17db764
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions
@@ -0,0 +1,7 @@
+DEFAULT			GLIBC_2.21
+
+%ifdef HAVE_AARCH64_BE
+ld=ld-linux-aarch64_be_ilp32.so.1
+%else
+ld=ld-linux-aarch64_ilp32.so.1
+%endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c
new file mode 100644
index 0000000..06bc688
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/statfs64.c
@@ -0,0 +1 @@
+/* statfs64 is the same as statfs. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c
new file mode 100644
index 0000000..48a1d6d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs.c
@@ -0,0 +1,5 @@
+#define __statvfs64(file, buf) __no_statvfs64(file, buf)
+#define statvfs64(file, buf) no_statvfs64(file, buf)
+#include "sysdeps/unix/sysv/linux/statvfs.c"
+strong_alias (statvfs, __statvfs64)
+weak_alias (statvfs, statvfs64)
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c
new file mode 100644
index 0000000..510015e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/statvfs64.c
@@ -0,0 +1 @@
+/* statvfs64 is the same as statvfs. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list b/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
new file mode 100644
index 0000000..1a3834b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/syscalls.list
@@ -0,0 +1,21 @@
+# File name	Caller	Syscall name	# args	Strong name	Weak names
+
+truncate	-	truncate	i:si	truncate	__truncate truncate64
+ftruncate	-	ftruncate	i:ii	__ftruncate	ftruncate ftruncate64 __ftruncate64
+preadv		-	preadv		Ci:ipii	preadv		preadv64
+pwritev		-	pwritev		Ci:ipii	pwritev		pwritev64
+pread		-	pread64		Ci:ibni	__libc_pread	__libc_pread64 __pread pread __pread64 pread64
+pwrite		-	pwrite64	Ci:ibni	__libc_pwrite	__libc_pwrite64 __pwrite pwrite __pwrite64 pwrite64
+readahead	-	readahead	i:iii	__readahead	readahead
+getrlimit	-	getrlimit	i:ip	__getrlimit	getrlimit getrlimit64
+setrlimit	-	setrlimit	i:ip	__setrlimit	setrlimit setrlimit64
+prlimit		EXTRA	prlimit64	i:iipp	prlimit		
+sendfile	-	sendfile	i:iipi	sendfile	sendfile64
+lseek		-	lseek		Ci:iii	__libc_lseek	__lseek lseek __llseek llseek __libc_lseek64 __lseek64 lseek64
+sync_file_range	-	sync_file_range	Ci:iiii	sync_file_range
+mmap		-	mmap		b:aniiii	__mmap		mmap __mmap64 mmap64
+posix_fadvise   -       fadvise64       Vi:iiii posix_fadvise   posix_fadvise64
+fstatfs		-	fstatfs		i:ip	__fstatfs	fstatfs fstatfs64 __fstatfs64
+statfs		-	statfs		i:sp	__statfs	statfs statfs64 __statfs64
+fanotify_mark	EXTRA	fanotify_mark	i:iiiiis	fanotify_mark
+
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c
new file mode 100644
index 0000000..8999768
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/truncate64.c
@@ -0,0 +1 @@
+/* truncate64 is the same as truncate. */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c
new file mode 100644
index 0000000..96927fe
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat.c
@@ -0,0 +1 @@
+#include <sysdeps/unix/sysv/linux/generic/xstat.c>
diff --git a/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c
new file mode 100644
index 0000000..e7acd3b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/ilp32/xstat64.c
@@ -0,0 +1 @@
+/* xstat64 is in xstat.c */
diff --git a/sysdeps/unix/sysv/linux/aarch64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/ioctl.S
deleted file mode 100644
index 8920a20..0000000
--- a/sysdeps/unix/sysv/linux/aarch64/ioctl.S
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Copyright (C) 2012-2014 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
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-	.text
-ENTRY(__ioctl)
-	mov	x8, #__NR_ioctl
-	sxtw	x0, w0
-	svc	#0x0
-	cmn	x0, #4095
-	b.cs	.Lsyscall_error
-	ret
-PSEUDO_END (__ioctl)
-
-weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/aarch64/lp64/Implies b/sysdeps/unix/sysv/linux/aarch64/lp64/Implies
new file mode 100644
index 0000000..6418211
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/lp64/Implies
@@ -0,0 +1,4 @@
+aarch64/nptl
+unix/sysv/linux/aarch64
+unix/sysv/linux/generic
+unix/sysv/linux/wordsize-64
diff --git a/sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S b/sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S
new file mode 100644
index 0000000..8920a20
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/lp64/ioctl.S
@@ -0,0 +1,31 @@
+/* Copyright (C) 2012-2014 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
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+	.text
+ENTRY(__ioctl)
+	mov	x8, #__NR_ioctl
+	sxtw	x0, w0
+	svc	#0x0
+	cmn	x0, #4095
+	b.cs	.Lsyscall_error
+	ret
+PSEUDO_END (__ioctl)
+
+weak_alias (__ioctl, ioctl)
diff --git a/sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions b/sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions
new file mode 100644
index 0000000..e1768a7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/aarch64/lp64/shlib-versions
@@ -0,0 +1,7 @@
+DEFAULT			GLIBC_2.17
+
+%ifdef HAVE_AARCH64_BE
+ld=ld-linux-aarch64_be.so.1
+%else
+ld=ld-linux-aarch64.so.1
+%endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/mmap.c b/sysdeps/unix/sysv/linux/aarch64/mmap.c
deleted file mode 100644
index 54ecc10..0000000
--- a/sysdeps/unix/sysv/linux/aarch64/mmap.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2009-2014 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
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <errno.h>
-#include <sys/syscall.h>
-#include <sysdep.h>
-#include <unistd.h>
-
-__ptr_t
-__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
-{
-  return (__ptr_t) INLINE_SYSCALL (mmap, 6, addr, len, prot, flags, fd, offset);
-}
-
-weak_alias (__mmap, mmap)
-weak_alias (__mmap, mmap64)
-weak_alias (__mmap, __mmap64)
-- 
1.9.3