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

GCC 10.3.0 fails to compile on Manjaro (GCC 12.2, binutils 2.39.0) #16235

Open
baloe opened this issue Sep 11, 2022 · 15 comments
Open

GCC 10.3.0 fails to compile on Manjaro (GCC 12.2, binutils 2.39.0) #16235

baloe opened this issue Sep 11, 2022 · 15 comments
Milestone

Comments

@baloe
Copy link

baloe commented Sep 11, 2022

I am unable to build GCC 10.3.0. Here is the output:

== Temporary log file in case of crash /tmp/eb-qe86ahz6/easybuild-ubithjku.log
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
Dry run: printing build status of easyconfigs and dependencies
CFGS=/tmp/bastian/eb_tmp/easybuild/easyconfigs
 * [x] $CFGS/m/M4/M4-1.4.19.eb (module: M4/1.4.19)
 * [x] $CFGS/b/Bison/Bison-3.8.2.eb (module: Bison/3.8.2)
 * [x] $CFGS/f/flex/flex-2.6.4.eb (module: flex/2.6.4)
 * [x] $CFGS/z/zlib/zlib-1.2.11.eb (module: zlib/1.2.11)
 * [x] $CFGS/b/binutils/binutils-2.36.1.eb (module: binutils/2.36.1)
 * [ ] $CFGS/g/GCCcore/GCCcore-10.3.0.eb (module: GCCcore/10.3.0)
 * [ ] $CFGS/z/zlib/zlib-1.2.11-GCCcore-10.3.0.eb (module: zlib/1.2.11-GCCcore-10.3.0)
 * [ ] $CFGS/h/help2man/help2man-1.48.3-GCCcore-10.3.0.eb (module: help2man/1.48.3-GCCcore-10.3.0)
 * [ ] $CFGS/m/M4/M4-1.4.18-GCCcore-10.3.0.eb (module: M4/1.4.18-GCCcore-10.3.0)
 * [ ] $CFGS/b/Bison/Bison-3.7.6-GCCcore-10.3.0.eb (module: Bison/3.7.6-GCCcore-10.3.0)
 * [ ] $CFGS/f/flex/flex-2.6.4-GCCcore-10.3.0.eb (module: flex/2.6.4-GCCcore-10.3.0)
 * [ ] $CFGS/b/binutils/binutils-2.36.1-GCCcore-10.3.0.eb (module: binutils/2.36.1-GCCcore-10.3.0)
 * [ ] $CFGS/g/GCC/GCC-10.3.0.eb (module: GCC/10.3.0)
== Temporary log file(s) /tmp/eb-qe86ahz6/easybuild-ubithjku.log* have been removed.
== Temporary directory /tmp/eb-qe86ahz6 has been removed.
== Temporary log file in case of crash /tmp/eb-u4d40mvn/easybuild-e7ypgify.log
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== resolving dependencies ...
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== processing EasyBuild easyconfig /tmp/bastian/eb_tmp/easybuild/easyconfigs/g/GCCcore/GCCcore-10.3.0.eb
== building and installing GCCcore/10.3.0...
== fetching files...
== creating build dir, resetting environment...
== starting iteration #0 ...
== ... (took 2 secs)
== unpacking...
== ... (took 10 secs)
== patching...
== preparing...
== configuring...
== FAILED: Installation ended unsuccessfully (build directory: /soft/modules/build/GCCcore/10.3.0/system-system): 
build failed (first 300 chars): cmd " ../configure   --enable-languages=c,c++,fortran --without-cuda-driver 
--enable-offload-targets=nvptx-none --enable-lto --enable-checking=release  --disable-multilib --enable-shared=yes 
--enable-static=yes  --enable-threads=posix  --enable-plugins  --enable-gold=default --enable-ld --with-plugi (took 
15 secs)
== Results of the build can be found in the log file(s) 
/tmp/eb-u4d40mvn/easybuild-GCCcore-10.3.0-20220911.094514.mAgTh.log
0:00:15  0 out of 8 easyconfigs done
ERROR: Build of /tmp/bastian/eb_tmp/easybuild/easyconfigs/g/GCCcore/GCCcore-10.3.0.eb failed (err: 'build failed (first 300 chars): cmd " ../configure   --enable-languages=c,c++,fortran --without-cuda-driver --enable-offload-targets=nvptx-none --enable-lto --enable-checking=release  --disable-multilib --enable-shared=yes --enable-static=yes  --enable-threads=posix  --enable-plugins  --enable-gold=default --enable-ld --with-plugi')

And here is the mentioned log file:
/tmp/eb-u4d40mvn/easybuild-GCCcore-10.3.0-20220911.094514.mAgTh.log

Is this issue possibly related to #16144 ? I think not, because the error message is very different.

The log reads:

configure: error: in `/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj':
configure: error: C compiler cannot create executables
See `config.log' for more details

Here is the config.log file:
/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj/config.log

This one mentions a bunch of errors, but I have no idea how to fix them:

> grep -nir error /soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj/config.log
99:gcc: error: unrecognized command-line option '-V'
100:gcc: fatal error: no input files
104:gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
105:gcc: fatal error: no input files
120:collect2: error: ld returned 1 exit status
140:configure:4535: error: in `/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj':
141:configure:4537: error: C compiler cannot create executables
@baloe
Copy link
Author

baloe commented Sep 27, 2022

I guess my system GCC is too new for it to be able to compile the old GCC 10.3.0 module.

Here is the config.log file: /soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj/config.log

The first error appears in line 99, reading

gcc version 12.1.1 20220730 (GCC) 
configure:4446: $? = 0
configure:4435: gcc -V >&5
gcc: error: unrecognized command-line option '-V'
gcc: fatal error: no input files
compilation terminated.

I just tried a few versions of GCC on an HPC, ranging from 4 to 11. With none of them gcc -V is valid.
I don't get how this could ever have worked.

Is the intended command gcc -v?

Aha, this sheds light on the -V parameter:
https://superuser.com/a/847156

@baloe baloe changed the title GCC 10.3.0 fails GCC 10.3.0 fails to compile Sep 27, 2022
@baloe
Copy link
Author

baloe commented Sep 27, 2022

Once the issue regarding the unrecognized command line option -V is fixed, this fix may be needed as well: #16145

@baloe
Copy link
Author

baloe commented Sep 27, 2022

related:
#3405

@jfgrimm
Copy link
Member

jfgrimm commented Oct 3, 2022

the unrecognized command line option error is not actually an issue, it's just configure determining what compiler is found. It iterates a bunch of options, and some will fail (and this is recorded in the logs).

To me, the following looks like the actual issue :

/soft/modules/software/binutils/2.36.1/bin/ld: /usr/lib/libc.so.6: unknown type [0x13] section `.relr.dyn'
/soft/modules/software/binutils/2.36.1/bin/ld: skipping incompatible /usr/lib/libc.so.6 when searching for /usr/lib/libc.so.6
/soft/modules/software/binutils/2.36.1/bin/ld: cannot find /usr/lib/libc.so.6
/soft/modules/software/binutils/2.36.1/bin/ld: /usr/lib/libc.so.6: unknown type [0x13] section `.relr.dyn'
/soft/modules/software/binutils/2.36.1/bin/ld: skipping incompatible /usr/lib/libc.so.6 when searching for /usr/lib/libc.so.6
/soft/modules/software/binutils/2.36.1/bin/ld: /usr/lib/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
/soft/modules/software/binutils/2.36.1/bin/ld: skipping incompatible /usr/lib/ld-linux-x86-64.so.2 when searching for /usr/lib/ld-linux-x86-64.so.2
/soft/modules/software/binutils/2.36.1/bin/ld: cannot find /usr/lib/ld-linux-x86-64.so.2
/soft/modules/software/binutils/2.36.1/bin/ld: /usr/lib/ld-linux-x86-64.so.2: unknown type [0x13] section `.relr.dyn'
/soft/modules/software/binutils/2.36.1/bin/ld: skipping incompatible /usr/lib/ld-linux-x86-64.so.2 when searching for /usr/lib/ld-linux-x86-64.so.2

What operating system are you building on, and what are your system compiler and binutils versions?

@baloe
Copy link
Author

baloe commented Oct 3, 2022

I am on Manjaro, with

  • gcc version 12.2.0 (GCC)
  • GNU ld (GNU Binutils) 2.39.0

@ocaisa
Copy link
Member

ocaisa commented Oct 26, 2022

Looking at https://bbs.archlinux.org/viewtopic.php?id=278679, I believe the issue here is that the linker the build wants to use (binutils 2.36.1) is too old for your system. The way out of this is probably to just use the system linker (which is newer). You can do this with

eb --filter-deps=binutils GCCcore-10.3.0.eb

to set this for all your installations (probably a wise move) you can use the easybuild config file or

export EASYBUILD_FILTER_DEPS=binutils

@boegel boegel added this to the 4.x milestone Oct 26, 2022
@boegel boegel changed the title GCC 10.3.0 fails to compile GCC 10.3.0 fails to compile on Manjaro (GCC 12.2, binutils 2.39.0) Oct 26, 2022
@baloe
Copy link
Author

baloe commented Oct 27, 2022

The way out of this is probably to just use the system linker (which is newer). You can do this with

eb --filter-deps=binutils GCCcore-10.3.0.eb

Unfortunately, I was still not successful on my system:

== Temporary log file in case of crash /tmp/eb-wdd3b94y/easybuild-oe4qol7c.log
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
Dry run: printing build status of easyconfigs and dependencies
CFGS=/tmp/bastian/eb_tmp/easybuild/easyconfigs
 * [x] $CFGS/m/M4/M4-1.4.19.eb (module: M4/1.4.19)
 * [ ] $CFGS/g/GCCcore/GCCcore-10.3.0.eb (module: GCCcore/10.3.0)
 * [ ] $CFGS/g/GCC/GCC-10.3.0.eb (module: GCC/10.3.0)
== Temporary log file(s) /tmp/eb-wdd3b94y/easybuild-oe4qol7c.log* have been removed.
== Temporary directory /tmp/eb-wdd3b94y has been removed.
== Temporary log file in case of crash /tmp/eb-n9qdjdfy/easybuild-rqgo0e52.log
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== resolving dependencies ...
== found valid index for /tmp/bastian/eb_tmp/easybuild/easyconfigs, so using it...
== processing EasyBuild easyconfig /tmp/bastian/eb_tmp/easybuild/easyconfigs/g/GCCcore/GCCcore-10.3.0.eb
== building and installing GCCcore/10.3.0...
== fetching files...
== ... (took 3 secs)
== creating build dir, resetting environment...
== starting iteration #0 ...
== ... (took 4 secs)
== unpacking...
== ... (took 10 secs)
== patching...
== preparing...
== configuring...
== ... (took 3 secs)
== building...
== ... (took 21 mins 53 secs)
== FAILED: Installation ended unsuccessfully (build directory: /soft/modules/build/GCCcore/10.3.0/system-system): build failed (first 300 chars): cmd " make -j 4 " exited with exit code 2 and output:
make[1]: Entering directory '/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj'
mkdir -p -- ./intl
mkdir -p -- ./libiberty
mkdir -p -- ./fixincludes
mkdir -p -- ./gmp
Configuring in ./intl
Configuring in ./libiberty
Configuri (took 22 mins 14 secs)
== Results of the build can be found in the log file(s) /tmp/eb-n9qdjdfy/easybuild-GCCcore-10.3.0-20221027.224031.hjDGl.log
0:22:14  0 out of 2 easyconfigs done
ERROR: Build of /tmp/bastian/eb_tmp/easybuild/easyconfigs/g/GCCcore/GCCcore-10.3.0.eb failed (err: 'build failed (first 300 chars): cmd " make -j 4 " exited with exit code 2 and output:\nmake[1]: Entering directory \'/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj\'\nmkdir -p -- ./intl\nmkdir -p -- ./libiberty\nmkdir -p -- ./fixincludes\nmkdir -p -- ./gmp\nConfiguring in ./intl\nConfiguring in ./libiberty\nConfiguri')

/tmp/eb-n9qdjdfy/easybuild-GCCcore-10.3.0-20221027.224031.hjDGl.log

@baloe
Copy link
Author

baloe commented Oct 27, 2022

The remaining error is probably

In file included from /usr/include/linux/fs.h:19,
                 from ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:75:
/usr/include/linux/mount.h:95:6: error: multiple definition of enum fsconfig_command
   95 | enum fsconfig_command {
      |      ^~~~~~~~~~~~~~~~
In file included from ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:62:
/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj/gcc/include-fixed/sys/mount.h:249:6: note: previous definition here
  249 | enum fsconfig_command
      |      ^~~~~~~~~~~~~~~~
In file included from /usr/include/linux/fs.h:19,
                 from ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:75:
/usr/include/linux/mount.h:129:8: error: redefinition of struct mount_attr
  129 | struct mount_attr {
      |        ^~~~~~~~~~
In file included from ../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:62:
/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage1_obj/gcc/include-fixed/sys/mount.h:219:8: note: previous definition of struct mount_attr
  219 | struct mount_attr
      |        ^~~~~~~~~~
make[4]: *** [Makefile:611: sanitizer_platform_limits_posix.lo] Error 1

I had run into the exact same issue when trying to install GCC 11, and @branfosj and @boegel were able to fix it: #16144 (comment)

@boegel
Copy link
Member

boegel commented Oct 31, 2022

@baloe The problem should be fixed with the changes in #16502, can you verify with "eb --from-pr 16502 GCCcore-10.3.0.eb --robot?

@baloe
Copy link
Author

baloe commented Nov 5, 2022

Unfortunately

eb --prefix $PATH_MODULES --filter-deps=binutils --from-pr 16502 GCCcore-10.3.0.eb --robot -Dr
eb --prefix $PATH_MODULES --filter-deps=binutils --from-pr 16502 GCCcore-10.3.0.eb --robot

fails with

 * [x] /tmp/bastian/eb_tmp/easybuild/easyconfigs/m/M4/M4-1.4.19.eb (module: M4/1.4.19)
 * [ ] /tmp/eb-7b200ztj/files_pr16502/g/GCCcore/GCCcore-10.3.0.eb (module: GCCcore/10.3.0)

...

configure: error: could not find a working compiler, see config.log for details
 (at easybuild/tools/run.py:641 in parse_cmd_output)
== 2022-11-05 01:01:03,662 build_log.py:265 INFO ... (took 31 mins 11 secs)
== 2022-11-05 01:01:03,665 filetools.py:2014 INFO Removing lock /soft/modules/software/.locks/_soft_modules_software_GCCcore_10.3.0.lock...
== 2022-11-05 01:01:03,666 filetools.py:382 INFO Path /soft/modules/software/.locks/_soft_modules_software_GCCcore_10.3.0.lock successfully removed.
== 2022-11-05 01:01:03,666 filetools.py:2018 INFO Lock removed: /soft/modules/software/.locks/_soft_modules_software_GCCcore_10.3.0.lock
== 2022-11-05 01:01:03,666 easyblock.py:4097 WARNING build failed (first 300 chars): cmd " ./configure --prefix=/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage2_stuff --with-pic --disable-shared --enable-cxx  --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu" exited with exit code 1 and output:
checking build system type... x86_64-pc-linux-gnu
checking host sy

easybuild-GCCcore-10.3.0-20221105.002931.NKcuT.log

@boegel
Copy link
Member

boegel commented Nov 5, 2022

@baloe Can you also share the config.log from the build directory?

@baloe
Copy link
Author

baloe commented Nov 5, 2022

I think that this is the one that is relevant.
/soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage2_stuff/gmp/config.log
(The timestamps don't match the ones in my previous post, because I ran easybuild again, wrongly assuming that the build log would have been in my /tmp/ directory.)

It contains

/usr/bin/ld.gold: /soft/modules/build/GCCcore/10.3.0/system-system/GCC_stage1_eb/lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /usr/bin/ld.gold)
/usr/bin/ld.gold: /soft/modules/build/GCCcore/10.3.0/system-system/GCC_stage1_eb/lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/bin/ld.gold)

Mh, I am using --filter-deps=binutils, because @ocaisa observed:

Looking at https://bbs.archlinux.org/viewtopic.php?id=278679, I believe the issue here is that the linker the build wants to use (binutils 2.36.1) is too old for your system. The way out of this is probably to just use the system linker (which is newer).

but then my system binutils 2.39.0 appears to be too new for GCCcore/10.3.0. I have binutils/2.38 in my module system. Should I try to make eb use that one?

@baloe
Copy link
Author

baloe commented Nov 18, 2022

When using binutils/2.38 (instead of the 2.36.1, which eb would attempt to use, and instead of 2.39.0, which is my system binutils),

module load binutils/2.38
eb --prefix /soft/modules --allow-loaded-modules=binutils --filter-deps=binutils --from-pr 16502 GCCcore-10.3.0.eb --robot

I still get a failure:

msgfmt: /soft/modules/build/GCCcore/10.3.0/system-system/gcc-10.3.0/stage3_obj/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/libicuuc.so.72)
make[5]: *** [Makefile:551: de.mo] Error 1

/tmp/eb-winj2kvt/easybuild-GCCcore-10.3.0-20221118.044301.kgzOS.log

I guess that's it, uninstallable on Manjaro.

@ocaisa
Copy link
Member

ocaisa commented Nov 18, 2022

Hmm, that's disappointing but in the EasyBuild slack today it was mentioned that this worked on Arch Linux a little while ago. Part of the problem is that the ground is shifting all the time on something like Manjaro, another is that EasyBuild is not isolated enough from the host OS (it is very hard to avoid some level of leakage though).

Are you aware of the EESSI project? That uses Gentoo Prefix to provide us with a compatibility OS on top of the system. Currently that includes GCC 10.3.0 and should work on any linux OS.

@ocaisa
Copy link
Member

ocaisa commented Nov 18, 2022

If you adopt some of the configuration used by EESSI, you can build on top of it, here's something that I use:

export EASYBUILD_PREFIX=/project/def-sponsor00/easybuild
export EASYBUILD_IGNORE_OSDEPS=1
export EASYBUILD_SYSROOT=${EPREFIX}
export EASYBUILD_RPATH=1
export EASYBUILD_FILTER_ENV_VARS=LD_LIBRARY_PATH
export EASYBUILD_FILTER_DEPS=Autoconf,Automake,Autotools,binutils,bzip2,cURL,DBus,flex,gettext,gperf,help2man,intltool,libreadline,libtool,Lua,M4,makeinfo,ncurses,util-linux,XZ,zlib
export EASYBUILD_MODULE_EXTENSIONS=1

Of course you'd have to customise EASYBUILD_PREFIX. With that you'd get additional modules under

module use $EASYBUILD_PREFIX/modules/all

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

No branches or pull requests

4 participants