Skip to content

support linker files #7

@mchristianl

Description

@mchristianl

Hi there,
During the build of the archlinux aur/julia-git package I've encountered the following issue:

./libwhich -p libm.so
failed to open library: /usr/lib/libm.so: invalid ELF header

And indeed, I have

file /usr/lib/libm.so
/usr/lib/libm.so: ASCII text

On this site it is claimed, that

.so files are not designed to be loaded, but to be used at link time.
Therefore it's perfectly fine for them to be a linker file.

What is should be the correct behaviour here?

strace -e openat ./libwhich -p libm.so
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/tls/x86_64/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/tls/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/x86_64/libm.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (Datei oder Verzeichnis nicht gefunden)
openat(AT_FDCWD, "/usr/lib/libm.so", O_RDONLY|O_CLOEXEC) = 3
failed to open library: /usr/lib/libm.so: invalid ELF header
+++ exited with 1 +++

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions