authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-06-22 21:55:55+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-07-29 09:50:41+02:00
loge0b9ebf322341fd17183ab9f0621e9ed985467c1
tree2bf35f1e7009bce1e3185aa299f8d707299cd0e3
parenta59ab5ffa5aacbc2fb372c45c23868bcd92a6385
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

gen_stubs: Add riscv32 handling in a few more places.


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

tools/gen_stubs.zig+7-2
......@@ -2,13 +2,14 @@
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 riscv64 x86_64
5//! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64
66//!
77//! ...each with 'lib/libc.so' inside of them.
88//!
99//! When building the resulting libc.S file, these defines are required:
1010//! * `-DPTR64`: when the architecture is 64-bit
1111//! * One of the following, corresponding to the CPU architecture:
12//! - `-DARCH_riscv32`
1213//! - `-DARCH_riscv64`
1314//! - `-DARCH_mips`
1415//! - `-DARCH_mips64`
......@@ -68,7 +69,8 @@ const MultiSym = struct {
6869 }
6970
7071 fn is32Only(ms: MultiSym) bool {
71 return ms.present[archIndex(.riscv64)] == false and
72 return ms.present[archIndex(.riscv32)] == true and
73 ms.present[archIndex(.riscv64)] == false and
7274 ms.present[archIndex(.mips)] == true and
7375 ms.present[archIndex(.mips64)] == false and
7476 ms.present[archIndex(.x86)] == true and
......@@ -110,6 +112,7 @@ const MultiSym = struct {
110112
111113 fn isPtrSize(ms: MultiSym) bool {
112114 const map = .{
115 .{ .riscv32, 4 },
113116 .{ .riscv64, 8 },
114117 .{ .mips, 4 },
115118 .{ .mips64, 8 },
......@@ -132,6 +135,7 @@ const MultiSym = struct {
132135
133136 fn isPtr2Size(ms: MultiSym) bool {
134137 const map = .{
138 .{ .riscv32, 8 },
135139 .{ .riscv64, 16 },
136140 .{ .mips, 8 },
137141 .{ .mips64, 16 },
......@@ -154,6 +158,7 @@ const MultiSym = struct {
154158
155159 fn isWeak64(ms: MultiSym) bool {
156160 const map = .{
161 .{ .riscv32, 1 },
157162 .{ .riscv64, 2 },
158163 .{ .mips, 1 },
159164 .{ .mips64, 2 },