Skip to content

build fails with musl libc #2013

@tomalok

Description

@tomalok

commits 16612d7 and af9da0a have broken builds on musl libc systems.

# github.com/opencontainers/runc/libcontainer/nsenter
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: $WORK/b123/_x003.o: in function `try_bindfd':
libcontainer/nsenter/cloned_binary.c:354: undefined reference to `secure_getenv'
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: $WORK/b123/_x003.o: in function `make_execfd':
libcontainer/nsenter/cloned_binary.c:252: undefined reference to `secure_getenv'
collect2: error: ld returned 1 exit status
# github.com/opencontainers/runc/libcontainer/nsenter
cloned_binary.c: In function 'make_execfd':
cloned_binary.c:252:17: warning: implicit declaration of function 'secure_getenv' [-Wimplicit-function-declaration]
  char *prefix = secure_getenv("_LIBCONTAINER_STATEDIR");
                 ^~~~~~~~~~~~~
cloned_binary.c:252:17: warning: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
cloned_binary.c: In function 'try_bindfd':
cloned_binary.c:354:17: warning: initialization of 'char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
  char *prefix = secure_getenv("_LIBCONTAINER_STATEDIR");
                 ^~~~~~~~~~~~~
make: *** [Makefile:33: runc] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions