Giter VIP home page Giter VIP logo

Comments (8)

rizsotto avatar rizsotto commented on June 30, 2024

Hey @DarthGandalf ,

thanks for the report. What I have noticed from the logs, all the failed tests are involving to compile and link a program. (Other tests are usually stops at compiling, but these are involving linking too.) And that is failing with the message:

collect2: fatal error: cannot find 'ld'

So, I am wondering if the ld is not available in the environment where the test are running? Or anything special happens with the environment variables that make the compiler fail to execute the linker? (My experience that gcc is sensitive about the environment variables to find other tools it executes.)

from bear.

DarthGandalf avatar DarthGandalf commented on June 30, 2024

yeah, /usr/bin/ld exists

from bear.

rizsotto avatar rizsotto commented on June 30, 2024

Can you show me what the gcc -print-prog-name=ld prints? Or what the gcc -v prints out?

from bear.

DarthGandalf avatar DarthGandalf commented on June 30, 2024

/usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/13/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /mnt/portagetmp/portage/sys-devel/gcc-13.2.1_p20240210/work/gcc-13-20240210/configure --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/13 --includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include --datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13 --mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/man --infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/13/info --with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13 --disable-silent-rules --disable-dependency-tracking --with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/13/python --enable-languages=c,c++,fortran --enable-obsolete --enable-secureplt --disable-werror --with-system-zlib --enable-nls --without-included-gettext --disable-libunwind-exceptions --enable-checking=release --with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 13.2.1_p20240210 p14' --with-gcc-major-version-only --enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-multilib --with-multilib-list=m32,m64 --disable-fixed-point --enable-targets=all --enable-libgomp --disable-libssp --disable-libada --enable-cet --disable-systemtap --disable-valgrind-annotations --disable-vtable-verify --disable-libvtv --with-zstd --without-isl --enable-default-pie --enable-default-ssp --disable-fixincludes --with-build-config=bootstrap-cet
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.2.1 20240210 (Gentoo 13.2.1_p20240210 p14)

from bear.

rizsotto avatar rizsotto commented on June 30, 2024

thanks!

Correct me if I am wrong, but is the path /usr/lib/gcc/x86_64-pc-linux-gnu/13/../../../../x86_64-pc-linux-gnu/bin/ld resolves to /usr/x86_64-pc-linux-gnu/bin/ld? So, it looks like gcc is looking for the linker in /usr/x86_64-pc-linux-gnu/bin and not in /usr/bin. Is that correct reading of that?

from bear.

DarthGandalf avatar DarthGandalf commented on June 30, 2024

I guess... And it has ld there.

$ ls -l /usr/x86_64-pc-linux-gnu/bin/ld
lrwxrwxrwx - root 23 мая 23:08 /usr/x86_64-pc-linux-gnu/bin/ld -> /usr/x86_64-pc-linux-gnu/binutils-bin/2.42/ld

$ ls -l /usr/x86_64-pc-linux-gnu/binutils-bin/2.42/ld
.rwxr-xr-x 979k root 21 мая 01:44 /usr/x86_64-pc-linux-gnu/binutils-bin/2.42/ld

$ /usr/x86_64-pc-linux-gnu/binutils-bin/2.42/ld --version
GNU ld (Gentoo 2.42 p3) 2.42.0
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

That is the same ld which /usr/bin/ld symlinks to, through several steps

lrwxrwxrwx - root 23 мая 23:08 /usr/bin/ld -> x86_64-pc-linux-gnu-ld
lrwxrwxrwx - root 23 мая 23:08 /usr/bin/x86_64-pc-linux-gnu-ld -> /usr/x86_64-pc-linux-gnu/bin/ld

from bear.

rizsotto avatar rizsotto commented on June 30, 2024

https://gcc.gnu.org/onlinedocs/gccint/Collect2.html

The GCC documentation about collect2 behavior to resolve the ld. I don't truly understand why it does not find the /usr/bin/ld one.

from bear.

rizsotto avatar rizsotto commented on June 30, 2024

To note here...

$ cat /tmp/main.c 
#include <stdio.h>

int main() {
    return 0;
}
$ /usr/bin/gcc /tmp/main.c
$ env - /usr/bin/gcc /tmp/main.c
collect2: fatal error: cannot find 'ld'
compilation terminated.
$

from bear.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.