| ... | @@ -2,13 +2,14 @@ | ... | @@ -2,13 +2,14 @@ |
| 2 | //! ./gen_stubs /path/to/musl/build-all >libc.S | 2 | //! ./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 riscv64 x86_64 | 5 | //! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64 |
| 6 | //! | 6 | //! |
| 7 | //! ...each with 'lib/libc.so' inside of them. | 7 | //! ...each with 'lib/libc.so' inside of them. |
| 8 | //! | 8 | //! |
| 9 | //! When building the resulting libc.S file, these defines are required: | 9 | //! When building the resulting libc.S file, these defines are required: |
| 10 | //! * `-DPTR64`: when the architecture is 64-bit | 10 | //! * `-DPTR64`: when the architecture is 64-bit |
| 11 | //! * One of the following, corresponding to the CPU architecture: | 11 | //! * One of the following, corresponding to the CPU architecture: |
| | 12 | //! - `-DARCH_riscv32` |
| 12 | //! - `-DARCH_riscv64` | 13 | //! - `-DARCH_riscv64` |
| 13 | //! - `-DARCH_mips` | 14 | //! - `-DARCH_mips` |
| 14 | //! - `-DARCH_mips64` | 15 | //! - `-DARCH_mips64` |
| ... | @@ -68,7 +69,8 @@ const MultiSym = struct { | ... | @@ -68,7 +69,8 @@ const MultiSym = struct { |
| 68 | } | 69 | } |
| 69 | | 70 | |
| 70 | fn is32Only(ms: MultiSym) bool { | 71 | 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 |
| 72 | ms.present[archIndex(.mips)] == true and | 74 | ms.present[archIndex(.mips)] == true and |
| 73 | ms.present[archIndex(.mips64)] == false and | 75 | ms.present[archIndex(.mips64)] == false and |
| 74 | ms.present[archIndex(.x86)] == true and | 76 | ms.present[archIndex(.x86)] == true and |
| ... | @@ -110,6 +112,7 @@ const MultiSym = struct { | ... | @@ -110,6 +112,7 @@ const MultiSym = struct { |
| 110 | | 112 | |
| 111 | fn isPtrSize(ms: MultiSym) bool { | 113 | fn isPtrSize(ms: MultiSym) bool { |
| 112 | const map = .{ | 114 | const map = .{ |
| | 115 | .{ .riscv32, 4 }, |
| 113 | .{ .riscv64, 8 }, | 116 | .{ .riscv64, 8 }, |
| 114 | .{ .mips, 4 }, | 117 | .{ .mips, 4 }, |
| 115 | .{ .mips64, 8 }, | 118 | .{ .mips64, 8 }, |
| ... | @@ -132,6 +135,7 @@ const MultiSym = struct { | ... | @@ -132,6 +135,7 @@ const MultiSym = struct { |
| 132 | | 135 | |
| 133 | fn isPtr2Size(ms: MultiSym) bool { | 136 | fn isPtr2Size(ms: MultiSym) bool { |
| 134 | const map = .{ | 137 | const map = .{ |
| | 138 | .{ .riscv32, 8 }, |
| 135 | .{ .riscv64, 16 }, | 139 | .{ .riscv64, 16 }, |
| 136 | .{ .mips, 8 }, | 140 | .{ .mips, 8 }, |
| 137 | .{ .mips64, 16 }, | 141 | .{ .mips64, 16 }, |
| ... | @@ -154,6 +158,7 @@ const MultiSym = struct { | ... | @@ -154,6 +158,7 @@ const MultiSym = struct { |
| 154 | | 158 | |
| 155 | fn isWeak64(ms: MultiSym) bool { | 159 | fn isWeak64(ms: MultiSym) bool { |
| 156 | const map = .{ | 160 | const map = .{ |
| | 161 | .{ .riscv32, 1 }, |
| 157 | .{ .riscv64, 2 }, | 162 | .{ .riscv64, 2 }, |
| 158 | .{ .mips, 1 }, | 163 | .{ .mips, 1 }, |
| 159 | .{ .mips64, 2 }, | 164 | .{ .mips64, 2 }, |