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