Skip to content

eld does not find namespec libraries in the standard directories within the sysroot #819

@parth-07

Description

@parth-07

eld does not find namespec libraries (such as -lfoo) in the standard directories under the sysroot such as, /lib, /lib64, /usr/lib, and so on.

Reproducer:

#!/usr/bin/env bash

rm -rf A
mkdir -p A/lib64

cat >1.c <<\EOF
int foo() { return 1; }
EOF

cat >script.t <<EOF
GROUP(-l1)
EOF

cat >main.c <<\EOF
int main() { return 0; }
EOF

clang -o lib1.so -target x86_64-unknown-elf 1.c -shared -fPIC
clang -o main.o -target x86_64-unknown-elf main.c -c 

mv lib1.so A/lib64/lib1.so
mv script.t A/script.t
ld.eld --sysroot=A A/script.t main.o 
ld.bfd --sysroot=A A/script.t main.o 

bfd is able to locate the lib1.so in A/lib64/lib1.so but eld fails to do so.

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