Skip to content
This repository was archived by the owner on Nov 22, 2025. It is now read-only.
/ libc-abi-tools Public archive

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

NetBSD libc ABI tools

This directory contains .abilist files from every version of NetBSD libc starting from NetBSD 10.1. These files are consolidated to generate a single 106 KB symbol mapping file that is shipped with Zig to target any version of NetBSD starting from that point.

Unlike glibc, these .abilist files are generated by inspecting the actual libc.so ELF file. We do it this way because NetBSD does not have .abilist files for its libc, and in fact does not use symbol versioning at all.

Generating .abilist files for a new NetBSD libc version

  1. Follow these instructions.

  2. Make sure that arches and libs are up to date.

  3. Run the tool to generate the new .abilist files:

    zig run collect.zig -- $NETBSD_SYSROOT_PATH $NETBSD_VERSION

    Where:

    • NETBSD_SYSROOT_PATH contains amd64, i386, etc directories.
    • NETBSD_VERSION should be e.g. 10.1.

    Pay attention to any warnings printed; make adjustments as necessary, e.g. to blacklist.

  4. This inspects the ELF shared libraries for each target you built earlier and generates .abilist files namespaced under the version number.

  5. Inspect the changes and then commit these new files into Git.

Updating Zig

  1. Add the new NetBSD libc versions to the versions global constant.

  2. Make sure that lib_names and zig_targets are up to date.

  3. Run consolidate.zig in this directory.

    zig run consolidate.zig

This will generate the file abilists which you can then inspect and make sure it is OK. Copy it to $ZIG_GIT_REPO_PATH/lib/libc/netbsd/abilists.

Format Quirks

Compared to glibc, the .abilist files here have some differences:

  • The first field containing the version name is missing because NetBSD does not use symbol versioning.
  • There can be an extra field containing a W before the category field. If present, this indicates that the symbol has weak linkage.