This repository contains .abilist
files from glibc. These files are used to generate symbol mapping files that are used with zig cc
- Clone glibc
git clone git://sourceware.org/git/glibc.git
-
Add new version to
TARGET_VERSIONS
tuple inimport_glibc_abilist.py
-
Run
import_glibc_abilist.py
import_glibc_abilist.py path/to/glibc/repo
- Run
update_glibc.zig
at the root of this repo
zig run update_glibc.zig -- glibc/ path/to/zig/lib
symbol mapping files will be updated in path/to/zig/lib/libc/glibc
.
- 1 byte - number of glibc versions
- ordered list of glibc versions terminated by newline byte
- 1 byte - number of targets
- ordered list of targets terminated by newline byte
- number of targets amount of entries x 7 (one entry for each library). Each entry is:
- u64 (8 bytes) bit set for versions available in library for that particular target.
- in total this is 56 bytes (7x8) per each target
- list of symbols:
- null terminated symbol name
- list of inclusions
- u32 (4 bytes) bitset for targets (1 << (INDEX_IN_TARGET_LIST))
- last inclusion is indicated if 1 << 31 bit is set in target bitset
- u64 (8 bytes) glibc version bitset (1 << (INDEX_IN_GLIBC_VERSION_LIST))
- u8 (1 byte) library index from a known library names list
- u32 (4 bytes) bitset for targets (1 << (INDEX_IN_TARGET_LIST))
zig run list_symbols.zig