Skip to content
Snippets Groups Projects

Updated compiler wrappers

Merged Marco Clemencic requested to merge update-compilers into master
45 files
+ 86
11
Compare changes
  • Side-by-side
  • Inline
Files
45
@@ -41,8 +41,10 @@ set_prefix() {
setup_gcc() {
local _version=$1
local _no_binutils=$2
_prefix=""
set_prefix gcc ${_version}binutils
[ -z "${_no_binutils}" ] && set_prefix gcc ${_version}binutils
if [ -n "${_prefix}" ] ; then
# we found a build of the compiler that uses new binutils
# FIXME: new binutils require an extra entry in the LD_LIBRARY_PATH...
@@ -68,18 +70,48 @@ setup_gcc() {
}
setup_clang() {
local _gcc_version _clang_version _base_platform
_prefix=
_clang_version=$1
case ${_clang_version} in
3.2) setup_gcc 4.6.3 ;;
3.3|3.4) setup_gcc 4.8.1 ;;
*) setup_gcc 4.9.3 ;;
if [ "${_clang_version}" = "5.0" ] ; then
_clang_version=5.0.0
fi
_base_platform=${_platform}
for _gcc_version in 7 62 49 48 46 ; do
_platform=${_base_platform}-gcc${_gcc_version}-opt
set_prefix llvm ${_clang_version}
if [ -n "${_prefix}" ] ; then
break;
fi
done
if [ -z "${_prefix}" ] ; then
_platform=${_base_platform}
set_prefix llvm ${_clang_version}
case ${_clang_version} in
3.2) _gcc_version=46 ;;
3.3|3.4) _gcc_version=48 ;;
*) _gcc_version=49 ;;
esac
fi
local _llvm_prefix=${_prefix}
_platform=${_base_platform}
case ${_gcc_version} in
46) _gcc_version=4.6.3 ;;
48) _gcc_version=4.8.1 ;;
49) _gcc_version=4.9.3 ;;
62) _gcc_version=6.2.0 ;;
7 ) _gcc_version=7.1.0 ;;
esac
setup_gcc ${_gcc_version} no-binutils
set_prefix llvm ${_clang_version}
_bin="${_prefix}/bin"
_lib="${_prefix}/lib64"
_bin="${_llvm_prefix}/bin"
_lib="${_llvm_prefix}/lib64"
LD_LIBRARY_PATH=$(echo $LD_LIBRARY_PATH | sed 's-[^:]*/llvm/[^:]*:\?--g')
LD_LIBRARY_PATH="${_lib}${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
PATH="${_bin}${PATH:+:}${PATH}"
Loading