Skip to content

linking against libc fails to find libgcc on openSUSE #2011

@andrewrk

Description

@andrewrk
./zig run hello.zig --cache off --library c
lld: error: /usr/lib64/gcc/x86_64-suse-linux/8/libgcc_s.so:4: unable to find libgcc_s.so.1
>>> GROUP ( libgcc_s.so.1 -lgcc )
>>>         ^

Output of zig libc:

# The directory that contains `stdlib.h`.
# On Linux, can be found with: `cc -E -Wp,-v -xc /dev/null`
include_dir=/usr/include

# The directory that contains `crt1.o`.
# On Linux, can be found with `cc -print-file-name=crt1.o`.
# Not needed when targeting MacOS.
lib_dir=/usr/lib64/gcc/x86_64-suse-linux/8/../../../../lib64

# The directory that contains `crtbegin.o`.
# On Linux, can be found with `cc -print-file-name=crtbegin.o`.
# Not needed when targeting MacOS or Windows.
static_lib_dir=/usr/lib64/gcc/x86_64-suse-linux/8

# The directory that contains `vcruntime.lib`.
# Only needed when targeting Windows.
msvc_lib_dir=

# The directory that contains `kernel32.lib`.
# Only needed when targeting Windows.
kernel32_lib_dir=

# The full path to the dynamic linker, on the target system.
# Only needed when targeting Linux.
dynamic_linker_path=/lib/../lib64/ld-linux-x86-64.so.2

This docker image can reproduce the problem: https://hub.docker.com/r/opensuse/tumbleweed/

Metadata

Metadata

Assignees

Labels

bugObserved behavior contradicts documented or intended behavioros-linuxstage1The process of building from source via WebAssembly and the C backend.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions