Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bear::func_test failed 7 tests (3.1.4) #575

Open
DarthGandalf opened this issue May 25, 2024 · 8 comments
Open

bear::func_test failed 7 tests (3.1.4) #575

DarthGandalf opened this issue May 25, 2024 · 8 comments

Comments

@DarthGandalf
Copy link

Describe the bug
Tests fail

To Reproduce

ctest --verbose in subprojects/Build/BearTest

Expected behavior
Tests should pass

Environment:

  • OS name: Linux
  • OS version: Gentoo
  • OS architecture: x86_64
  • Bear version: 3.1.4
  • Bear install method: using ebuild (I'm currently maintainer of Bear in Gentoo, and tried to add the newly released 3.1.4; the new ebuild is just like one for 3.1.3); I had to disable sandbox features of emerge for tests to run at all.

Additional context
I haven't checked whether 3.1.3 also fails.

build.log
LastTest.log

Before you send...

  • Have you read the README.md file or man bear? Yeah
  • Have you looked what other open issues Bear has? bear::func_test fails on aarch64 #492 seems related, however, this is x86_64, and 7 tests are failing, more than in that issue.
  • Are you sure that the build works without Bear? it's hard to run Bear's tests without Bear :)
@rizsotto
Copy link
Owner

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.)

@DarthGandalf
Copy link
Author

yeah, /usr/bin/ld exists

@rizsotto
Copy link
Owner

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

@DarthGandalf
Copy link
Author

/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)

@rizsotto
Copy link
Owner

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?

@DarthGandalf
Copy link
Author

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

@rizsotto
Copy link
Owner

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.

@rizsotto
Copy link
Owner

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.
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants