@@ -1171,22 +1171,29 @@ def pre_configure_hook_extrae(self, *args, **kwargs):
11711171 binutils_lib_path_glob_pattern = os .path .join (eprefix , 'usr' , 'lib*' , 'binutils' , '*-linux-gnu' , '2.*' )
11721172 binutils_lib_path = glob .glob (binutils_lib_path_glob_pattern )
11731173 if len (binutils_lib_path ) == 1 :
1174- self .cfg .update ('configopts' , '--with-binutils=' + binutils_lib_path [0 ])
1174+ if self .version < LooseVersion ('5.0.0' ):
1175+ self .cfg .update ('configopts' , '--with-binutils=' + binutils_lib_path [0 ])
1176+ else :
1177+ # Setting --with-binutils to the real binutils subdir (as for older versions) causes issues for finding addr2line,
1178+ # as it will try to find that binary in $BINUTILS_ROOT/bin,
1179+ # so we use $EPREFIX/usr instead.
1180+ # Also, as of version 5, we can use more specific flags for binutils headers and libraries.
1181+ self .cfg .update ('configopts' , '--with-binutils=' + os .path .join (eprefix , 'usr' ))
1182+ self .cfg .update ('configopts' , '--with-binutils-headers=' + os .path .join (binutils_lib_path [0 ], 'include' ))
1183+ self .cfg .update ('configopts' , '--with-binutils-libs=' + binutils_lib_path [0 ])
11751184 else :
11761185 raise EasyBuildError ("Failed to isolate path for binutils libraries using %s, got %s" ,
11771186 binutils_lib_path_glob_pattern , binutils_lib_path )
11781187
11791188 # zlib is a filtered dependency, so we need to manually specify it's location to avoid the host version
11801189 self .cfg .update ('configopts' , '--with-libz=' + eprefix )
11811190
1182- # replace use of 'which' with 'command -v', since 'which' is broken in EESSI build container;
1183- # this must be done *after* running configure script, because initial configuration re-writes configure script,
1184- # and problem due to use of which only pops up when running make ?!
1191+ # replace use of 'which' with 'command -v' in several files, since 'which' is broken in EESSI build container
11851192 self .cfg .update (
1186- 'prebuildopts ' ,
1187- "cp config/mpi-macros.m4 config/mpi- macros.m4.orig && "
1188- "sed -i 's/`which /`command -v /g' config/mpi-macros.m4 && "
1189- )
1193+ 'preconfigopts ' ,
1194+ "sed -i.orig 's/`which /`command -v /g' config/mpi-macros.m4 configure.ac config/macros.m4 include/Makefile.am Makefile.am tests/overhead/Makefile.am && "
1195+ "autoreconf -fi && "
1196+ )
11901197 else :
11911198 raise EasyBuildError ("Extrae-specific hook triggered for non-Extrae easyconfig?!" )
11921199
0 commit comments