Skip to content

incorrect native glibc version detection #17626

@andrewrk

Description

@andrewrk

Zig Version

0.12.0-dev.1138+530dc0405

Steps to Reproduce and Observed Behavior

$ zig env | jq .target
"x86_64-linux.6.1.53...6.1.53-gnu.2.19"

Notice that the result is glibc 2.19. This is currently the cross-compiling default (related: #17628):

.glibc = .{ .major = 2, .minor = 19, .patch = 0 },

Expected Behavior

This is incorrect on my system, which is

$ uname -a
Linux ark 6.1.53 #1-NixOS SMP PREEMPT_DYNAMIC Wed Sep 13 07:43:05 UTC 2023 x86_64 GNU/Linux
$ nixos-version 
23.05.3580.5d017a8822e0 (Stoat)

We can easily see the correct value here:

$ ldd /usr/bin/env | grep glibc
	libc.so.6 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/libc.so.6 (0x00007f306c6ad000)
	/nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib/ld-linux-x86-64.so.2 => /nix/store/46m4xx889wlhsdj72j38fnlyyvvvvbyb-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007f306c948000)

It should be 2.37.

Related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.os-linuxLinux

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions