Comments (8)
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.
yeah, /usr/bin/ld exists
from bear.
Can you show me what the gcc -print-prog-name=ld
prints? Or what the gcc -v
prints out?
from bear.
/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.
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.
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.
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.
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)
- Can cause link errors during cross compilation HOT 1
- Running 'nrfutil pkg' through bear won't find GLIBCXX_3.4.30 - add a "de-wrapper"? HOT 3
- Bear spawns an endless number of processes on FreeBSD HOT 2
- [Feature Request] Enable preload mode on macOS with SIP disabled HOT 2
- How does bear work? HOT 1
- Calling `bear -- emmake make` from makefile has different output than without the makefile HOT 3
- `bear intercept` prints empty events.json with dynamically linked arm-none-eabi-gcc HOT 3
- Compile option "--include <path>" generates incorrect database entry HOT 2
- compile asan, but the content of compile_commands.json is empty HOT 4
- makeopts ignored HOT 3
- can't install bear without sudo HOT 2
- has no member named ‘always_print_primitive_fields’ HOT 7
- How can I create the compile_commands.json for the Bear project? HOT 3
- Combining compile & link with Clang results in erroneous entry HOT 3
- Empty compilation database when compiling OpenBSD kernel HOT 2
- [Build failed] ld cannot find stdc++fs: ld: undefined reference to std::filesystem HOT 4
- Question - how to capture built in compiler options HOT 1
- How to support emcc compiler? HOT 1
- bear 3.1.4 hangs when proxy is enabled in ubuntu 24.04 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bear.