glibc 2.33, now with csky

Andrew Kelley 2021-04-04 12:20:44 -07:00
parent 5b1bc4b2e7
commit 80f1106e5c

@ -2,8 +2,6 @@ Here's how to update the libc files that Zig bundles.
## glibc
Note for next time: llvm 12 gained csky support, so these instructions will likely need to be modified to take that into account.
Make sure these dependencies are installed. If the scripts below fail, I'm not aware of a way to make them resume; each command deletes everything and starts over.
* python3
@ -20,24 +18,24 @@ Next, git clone glibc.
```
git clone git://sourceware.org/git/glibc.git
cd glibc
git checkout glibc-2.32 # the tag of the version to update to
git checkout glibc-2.33 # the tag of the version to update to
```
Assuming the path of that is `~/glibc`, make a new directory and go to it. Then run the Python commands, each of which uses all CPU cores and takes a long time. If any of them fail (except for the csky one), look at the logs to find out why, correct it, and then start the command again. Unfortunately each command will delete its own previous progress and start over.
Assuming the path of that is `~/glibc`, make a new directory and go to it. Then run the Python commands, each of which uses all CPU cores and takes a long time. If any of them fail, look at the logs to find out why, correct it, and then start the command again. Unfortunately each command will delete its own previous progress and start over.
```sh
mkdir multi
cd multi
python3 ~/glibc/scripts/build-many-glibcs.py . checkout
cd src/glibc
git checkout glibc-2.32 # the tag of the version to update to
git checkout glibc-2.33 # the tag of the version to update to
cd -
python3 ~/glibc/scripts/build-many-glibcs.py . host-libraries
python3 ~/glibc/scripts/build-many-glibcs.py . compilers # takes upwards of 12 hours with 16 CPU cores, might want to run overnight
python3 ~/glibc/scripts/build-many-glibcs.py . glibcs # took 7 hours for me with 8 CPU cores
```
Next, make sure that the list of architectures in `tools/process_headers.zig` is complete in that it lists all of the glibc targets (except csky) and maps them to Zig targets. Any additional targets you add, add to the `libcs_available` variable in `target.cpp`.
Next, make sure that the list of architectures in `tools/process_headers.zig` is complete in that it lists all of the glibc targets and maps them to Zig targets. Any additional targets you add, add to the `libcs_available` variable in `src/stage1/target.cpp`, as well as `available_libcs` in `src/target.zig`.
Next, from the "build" directory of zig git source, use `tools/process_headers.zig`: