@@ -1149,22 +1149,29 @@ def pre_configure_hook_extrae(self, *args, **kwargs):
11491149 binutils_lib_path_glob_pattern = os .path .join (eprefix , 'usr' , 'lib*' , 'binutils' , '*-linux-gnu' , '2.*' )
11501150 binutils_lib_path = glob .glob (binutils_lib_path_glob_pattern )
11511151 if len (binutils_lib_path ) == 1 :
1152- self .cfg .update ('configopts' , '--with-binutils=' + binutils_lib_path [0 ])
1152+ if self .version < LooseVersion ('5.0.0' ):
1153+ self .cfg .update ('configopts' , '--with-binutils=' + binutils_lib_path [0 ])
1154+ else :
1155+ # Setting --with-binutils to the real binutils subdir (as for older versions) causes issues for finding addr2line,
1156+ # as it will try to find that binary in $BINUTILS_ROOT/bin,
1157+ # so we use $EPREFIX/usr instead.
1158+ # Also, as of version 5, we can use more specific flags for binutils headers and libraries.
1159+ self .cfg .update ('configopts' , '--with-binutils=' + os .path .join (eprefix , 'usr' ))
1160+ self .cfg .update ('configopts' , '--with-binutils-headers=' + os .path .join (binutils_lib_path [0 ], 'include' ))
1161+ self .cfg .update ('configopts' , '--with-binutils-libs=' + binutils_lib_path [0 ])
11531162 else :
11541163 raise EasyBuildError ("Failed to isolate path for binutils libraries using %s, got %s" ,
11551164 binutils_lib_path_glob_pattern , binutils_lib_path )
11561165
11571166 # zlib is a filtered dependency, so we need to manually specify it's location to avoid the host version
11581167 self .cfg .update ('configopts' , '--with-libz=' + eprefix )
11591168
1160- # replace use of 'which' with 'command -v', since 'which' is broken in EESSI build container;
1161- # this must be done *after* running configure script, because initial configuration re-writes configure script,
1162- # and problem due to use of which only pops up when running make ?!
1169+ # replace use of 'which' with 'command -v' in several files, since 'which' is broken in EESSI build container
11631170 self .cfg .update (
1164- 'prebuildopts ' ,
1165- "cp config/mpi-macros.m4 config/mpi- macros.m4.orig && "
1166- "sed -i 's/`which /`command -v /g' config/mpi-macros.m4 && "
1167- )
1171+ 'preconfigopts ' ,
1172+ "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 && "
1173+ "autoreconf -fi && "
1174+ )
11681175 else :
11691176 raise EasyBuildError ("Extrae-specific hook triggered for non-Extrae easyconfig?!" )
11701177
0 commit comments