Skip to content

zig cc -D_FORTIFY_SOURCE=2 error #24945

@jimying

Description

@jimying

Zig Version

0.15.1

Steps to Reproduce and Observed Behavior

use zig-0.15.1 build follow simple c code error:

ld.lld: error: undefined symbol: __inet_pton_chk
>>> referenced by inet-fortified.h:56 (/home/build/env/zig-x86_64-linux-0.15.1/lib/libc/include/generic-glibc/bits/inet-fortified.h:56)

old zig-0.14.1 no such error

build command:

zig cc -O2  -D_FORTIFY_SOURCE=2  test.c

test.c:

#include <sys/types.h>
#include <arpa/inet.h>
int main()
{
    struct in_addr v4;
    inet_pton(AF_INET, "127.0.0.1", &v4);
    return 0;
}

Expected Behavior

build no error

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.libcIssues related to libzigc and Zig's vendored libc code.os-linux

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions