authorgravatar for yangxudong@ymatrix.cnYANG Xudong <yangxudong@ymatrix.cn> 2024-08-03 15:54:01+08:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-04 12:04:39-07:00
logea847535fc393f7f73801285af8960379e9376c8
tree93ead83821c0d677e53f9c14fa0c68f285ec77dc
parenta18293214dbe65f74a1420cd5728e40427236f6e

Add loongarch 64 to gen_stubs.zig.


1 files changed, 7 insertions(+), 2 deletions(-)

tools/gen_stubs.zig+7-2
...@@ -2,7 +2,7 @@...@@ -2,7 +2,7 @@
2//! ./gen_stubs /path/to/musl/build-all >libc.S2//! ./gen_stubs /path/to/musl/build-all >libc.S
3//!3//!
4//! The directory 'build-all' is expected to contain these subdirectories:4//! The directory 'build-all' is expected to contain these subdirectories:
5//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_645//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64 loongarch64
6//!6//!
7//! ...each with 'lib/libc.so' inside of them.7//! ...each with 'lib/libc.so' inside of them.
8//!8//!
...@@ -18,6 +18,7 @@...@@ -18,6 +18,7 @@
18//! - `-DARCH_powerpc`18//! - `-DARCH_powerpc`
19//! - `-DARCH_powerpc64`19//! - `-DARCH_powerpc64`
20//! - `-DARCH_aarch64`20//! - `-DARCH_aarch64`
21//! - `-DARCH_loongarch64`
2122
22// TODO: pick the best index to put them into instead of at the end23// TODO: pick the best index to put them into instead of at the end
23// - e.g. find a common previous symbol and put it after that one24// - e.g. find a common previous symbol and put it after that one
...@@ -77,7 +78,8 @@ const MultiSym = struct {...@@ -77,7 +78,8 @@ const MultiSym = struct {
77 ms.present[archIndex(.x86_64)] == false and78 ms.present[archIndex(.x86_64)] == false and
78 ms.present[archIndex(.powerpc)] == true and79 ms.present[archIndex(.powerpc)] == true and
79 ms.present[archIndex(.powerpc64)] == false and80 ms.present[archIndex(.powerpc64)] == false and
80 ms.present[archIndex(.aarch64)] == false;81 ms.present[archIndex(.aarch64)] == false and
82 ms.present[archIndex(.loongarch64)] == false;
81 }83 }
8284
83 fn commonSize(ms: MultiSym) ?u64 {85 fn commonSize(ms: MultiSym) ?u64 {
...@@ -121,6 +123,7 @@ const MultiSym = struct {...@@ -121,6 +123,7 @@ const MultiSym = struct {
121 .{ .powerpc, 4 },123 .{ .powerpc, 4 },
122 .{ .powerpc64, 8 },124 .{ .powerpc64, 8 },
123 .{ .aarch64, 8 },125 .{ .aarch64, 8 },
126 .{ .loongarch64, 8 },
124 };127 };
125 inline for (map) |item| {128 inline for (map) |item| {
126 const arch = item[0];129 const arch = item[0];
...@@ -144,6 +147,7 @@ const MultiSym = struct {...@@ -144,6 +147,7 @@ const MultiSym = struct {
144 .{ .powerpc, 8 },147 .{ .powerpc, 8 },
145 .{ .powerpc64, 16 },148 .{ .powerpc64, 16 },
146 .{ .aarch64, 16 },149 .{ .aarch64, 16 },
150 .{ .loongarch64, 16 },
147 };151 };
148 inline for (map) |item| {152 inline for (map) |item| {
149 const arch = item[0];153 const arch = item[0];
...@@ -167,6 +171,7 @@ const MultiSym = struct {...@@ -167,6 +171,7 @@ const MultiSym = struct {
167 .{ .powerpc, 1 },171 .{ .powerpc, 1 },
168 .{ .powerpc64, 2 },172 .{ .powerpc64, 2 },
169 .{ .aarch64, 2 },173 .{ .aarch64, 2 },
174 .{ .loongarch64, 2 },
170 };175 };
171 inline for (map) |item| {176 inline for (map) |item| {
172 const arch = item[0];177 const arch = item[0];