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 @@
22//! ./gen_stubs /path/to/musl/build-all >libc.S
33//!
44//! The directory 'build-all' is expected to contain these subdirectories:
5//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64
5//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64 loongarch64
66//!
77//! ...each with 'lib/libc.so' inside of them.
88//!
......@@ -18,6 +18,7 @@
1818//! - `-DARCH_powerpc`
1919//! - `-DARCH_powerpc64`
2020//! - `-DARCH_aarch64`
21//! - `-DARCH_loongarch64`
2122
2223// TODO: pick the best index to put them into instead of at the end
2324// - e.g. find a common previous symbol and put it after that one
......@@ -77,7 +78,8 @@ const MultiSym = struct {
7778 ms.present[archIndex(.x86_64)] == false and
7879 ms.present[archIndex(.powerpc)] == true and
7980 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;
8183 }
8284
8385 fn commonSize(ms: MultiSym) ?u64 {
......@@ -121,6 +123,7 @@ const MultiSym = struct {
121123 .{ .powerpc, 4 },
122124 .{ .powerpc64, 8 },
123125 .{ .aarch64, 8 },
126 .{ .loongarch64, 8 },
124127 };
125128 inline for (map) |item| {
126129 const arch = item[0];
......@@ -144,6 +147,7 @@ const MultiSym = struct {
144147 .{ .powerpc, 8 },
145148 .{ .powerpc64, 16 },
146149 .{ .aarch64, 16 },
150 .{ .loongarch64, 16 },
147151 };
148152 inline for (map) |item| {
149153 const arch = item[0];
......@@ -167,6 +171,7 @@ const MultiSym = struct {
167171 .{ .powerpc, 1 },
168172 .{ .powerpc64, 2 },
169173 .{ .aarch64, 2 },
174 .{ .loongarch64, 2 },
170175 };
171176 inline for (map) |item| {
172177 const arch = item[0];