conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
954 stars 1.75k forks source link

GCC: not able to build using official recipe #20292

Open gillesgui opened 1 year ago

gillesgui commented 1 year ago

What is your question?

HI,

I am trying to compile GCC using the official recipe and Conan 2.0.13. My target is 11.3.0 but I have also tried 12.2.0 with the same result.

My build environement is a Alma 8 docker image, fully up to date. I am using stock GCC version and a failry simple profile (only specific thing is I set cppstd to 11 to comply with gcc request):

[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu11
compiler.libcxx=libstdc++11
compiler.version=8
os=Linux

Every build attempt ends up with the same error:

/root/.conan/data/binutils/2.38/_/_/package/094dda2f30c71059ad65f91f508e55a3fc48d0b3/bin/exec_prefix/x86_64-pc-linux-gnu/bin/ld: cannot find crti.o: No such file or directory
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:995: libgcc_s.so] Error 1
make[2]: Leaving directory '/gcc/build-release/x86_64-pc-linux-gnu/libgcc'
make[1]: *** [Makefile:14203: all-target-libgcc] Error 2
make[1]: Leaving directory '/gcc/build-release'
make: *** [Makefile:963: all] Error 2
ERROR: conanfile.py (gcc/None): Error in build() method, line 133
    autotools.make()
    ConanException: Error 2 while executing make -j80

For some reason only /lib is used as a system path for shared libs. No search is done in /lib64. I've tried a few tricks (with no result) but I have to admit I am a bit confused. Shouldn't there be an easy way to make sure /lib64 is used for resolving those libs (especially when we are not cross-compiling)?

I hope I haven't missed the piece of documentation covering this.

Thankq for your help!

Have you read the CONTRIBUTING guide?

franramirez688 commented 1 year ago

Hi @gillesgui

This seems an issue related to the GCC recipe and not to the Conan client, so let me transfer it to the conan-center-index repository.

franramirez688 commented 1 year ago

Hi @gillesgui - Thanks again for reporting the issue.

Just a follow-up to get more context about your use case, and to know if you're completely stuck with this failure. Is it not possible to install directly the GCC 11.3.0 compiler in your system via apt or something similar? Or do you need to use this recipe for another reason?

gillesgui commented 11 months ago

Hi,

Sorry I didn't follow-up on this, lots of things going on in October.

I found the solution to my issue, and can't really figure out the logic behind.

For gcc 11.3.0 to build properly, I need the compiler.cppstd statement to be removed from the profile I use. I tried keeping it with several values (11, gnu11, 14, etc.), nothing worked. The only final solution was to remove it in a specific profile I use for building gcc.

If someone knows the reason why, I would be interested.