| ... | @@ -2,7 +2,7 @@ | ... | @@ -2,7 +2,7 @@ |
| 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 riscv32 riscv64 x86_64 | 5 | //! arm x86 mips mips64 powerpc powerpc64 riscv32 riscv64 x86_64 loongarch64 |
| 6 | //! | 6 | //! |
| 7 | //! ...each with 'lib/libc.so' inside of them. | 7 | //! ...each with 'lib/libc.so' inside of them. |
| 8 | //! | 8 | //! |
| ... | @@ -18,6 +18,7 @@ | ... | @@ -18,6 +18,7 @@ |
| 18 | //! - `-DARCH_powerpc` | 18 | //! - `-DARCH_powerpc` |
| 19 | //! - `-DARCH_powerpc64` | 19 | //! - `-DARCH_powerpc64` |
| 20 | //! - `-DARCH_aarch64` | 20 | //! - `-DARCH_aarch64` |
| | 21 | //! - `-DARCH_loongarch64` |
| 21 | | 22 | |
| 22 | // TODO: pick the best index to put them into instead of at the end | 23 | // TODO: pick the best index to put them into instead of at the end |
| 23 | // - e.g. find a common previous symbol and put it after that one | 24 | // - e.g. find a common previous symbol and put it after that one |
| ... | @@ -77,7 +78,8 @@ const MultiSym = struct { | ... | @@ -77,7 +78,8 @@ const MultiSym = struct { |
| 77 | ms.present[archIndex(.x86_64)] == false and | 78 | ms.present[archIndex(.x86_64)] == false and |
| 78 | ms.present[archIndex(.powerpc)] == true and | 79 | ms.present[archIndex(.powerpc)] == true and |
| 79 | ms.present[archIndex(.powerpc64)] == false and | 80 | 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; |
| 81 | } | 83 | } |
| 82 | | 84 | |
| 83 | fn commonSize(ms: MultiSym) ?u64 { | 85 | fn commonSize(ms: MultiSym) ?u64 { |
| ... | @@ -121,6 +123,7 @@ const MultiSym = struct { | ... | @@ -121,6 +123,7 @@ const MultiSym = struct { |
| 121 | .{ .powerpc, 4 }, | 123 | .{ .powerpc, 4 }, |
| 122 | .{ .powerpc64, 8 }, | 124 | .{ .powerpc64, 8 }, |
| 123 | .{ .aarch64, 8 }, | 125 | .{ .aarch64, 8 }, |
| | 126 | .{ .loongarch64, 8 }, |
| 124 | }; | 127 | }; |
| 125 | inline for (map) |item| { | 128 | inline for (map) |item| { |
| 126 | const arch = item[0]; | 129 | const arch = item[0]; |
| ... | @@ -144,6 +147,7 @@ const MultiSym = struct { | ... | @@ -144,6 +147,7 @@ const MultiSym = struct { |
| 144 | .{ .powerpc, 8 }, | 147 | .{ .powerpc, 8 }, |
| 145 | .{ .powerpc64, 16 }, | 148 | .{ .powerpc64, 16 }, |
| 146 | .{ .aarch64, 16 }, | 149 | .{ .aarch64, 16 }, |
| | 150 | .{ .loongarch64, 16 }, |
| 147 | }; | 151 | }; |
| 148 | inline for (map) |item| { | 152 | inline for (map) |item| { |
| 149 | const arch = item[0]; | 153 | const arch = item[0]; |
| ... | @@ -167,6 +171,7 @@ const MultiSym = struct { | ... | @@ -167,6 +171,7 @@ const MultiSym = struct { |
| 167 | .{ .powerpc, 1 }, | 171 | .{ .powerpc, 1 }, |
| 168 | .{ .powerpc64, 2 }, | 172 | .{ .powerpc64, 2 }, |
| 169 | .{ .aarch64, 2 }, | 173 | .{ .aarch64, 2 }, |
| | 174 | .{ .loongarch64, 2 }, |
| 170 | }; | 175 | }; |
| 171 | inline for (map) |item| { | 176 | inline for (map) |item| { |
| 172 | const arch = item[0]; | 177 | const arch = item[0]; |