Skip to content

Commit

Permalink
Add loongarch 64 to gen_stubs.zig.
Browse files Browse the repository at this point in the history
  • Loading branch information
yxd-ym authored and andrewrk committed Aug 4, 2024
1 parent a182932 commit ea84753
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tools/gen_stubs.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//! ./gen_stubs /path/to/musl/build-all >libc.S
//!
//! The directory 'build-all' is expected to contain these subdirectories:
//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64
//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64 loongarch64
//!
//! ...each with 'lib/libc.so' inside of them.
//!
Expand All @@ -18,6 +18,7 @@
//! - `-DARCH_powerpc`
//! - `-DARCH_powerpc64`
//! - `-DARCH_aarch64`
//! - `-DARCH_loongarch64`

// TODO: pick the best index to put them into instead of at the end
// - e.g. find a common previous symbol and put it after that one
Expand Down Expand Up @@ -77,7 +78,8 @@ const MultiSym = struct {
ms.present[archIndex(.x86_64)] == false and
ms.present[archIndex(.powerpc)] == true and
ms.present[archIndex(.powerpc64)] == false and
ms.present[archIndex(.aarch64)] == false;
ms.present[archIndex(.aarch64)] == false and
ms.present[archIndex(.loongarch64)] == false;
}

fn commonSize(ms: MultiSym) ?u64 {
Expand Down Expand Up @@ -121,6 +123,7 @@ const MultiSym = struct {
.{ .powerpc, 4 },
.{ .powerpc64, 8 },
.{ .aarch64, 8 },
.{ .loongarch64, 8 },
};
inline for (map) |item| {
const arch = item[0];
Expand All @@ -144,6 +147,7 @@ const MultiSym = struct {
.{ .powerpc, 8 },
.{ .powerpc64, 16 },
.{ .aarch64, 16 },
.{ .loongarch64, 16 },
};
inline for (map) |item| {
const arch = item[0];
Expand All @@ -167,6 +171,7 @@ const MultiSym = struct {
.{ .powerpc, 1 },
.{ .powerpc64, 2 },
.{ .aarch64, 2 },
.{ .loongarch64, 2 },
};
inline for (map) |item| {
const arch = item[0];
Expand Down

0 comments on commit ea84753

Please sign in to comment.