diff options
Diffstat (limited to 'eclass/toolchain.eclass')
-rw-r--r-- | eclass/toolchain.eclass | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index d72047e891d1..6eef2a0ec03e 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -971,12 +971,16 @@ toolchain_setup_ada() { if ver_test ${ada_bootstrap} -gt ${PV} || [[ -z ${ada_bootstrap} ]] ; then ebegin "Testing fallback dev-lang/ada-bootstrap for Ada" if has_version -b "<dev-lang/ada-bootstrap-${SLOT}" ; then - # TODO: Figure out ada-bootstrap versioning/slots + # Workaround the old scheme + if has_version -b "=dev-lang/ada-bootstrap-0_p2021*" ; then + ada_bootstrap=10 + else + local latest_ada_bootstrap=$(best_version -b "<dev-lang/ada-bootstrap-${SLOT}") + latest_ada_bootstrap="${latest_ada_bootstrap#dev-lang/ada-bootstrap-}" + latest_ada_bootstrap=$(ver_cut 1 ${latest_ada_bootstrap}) + ada_bootstrap="${latest_ada_bootstrap}" + fi - #local latest_ada_bootstrap=$(best_version -b "<dev-lang/ada-bootstrap-${SLOT}") - #latest_ada_bootstrap="${latest_ada_bootstrap#dev-lang/ada-bootstrap-}" - #latest_ada_bootstrap=$(ver_cut 1 ${latest_ada_bootstrap}) - ada_bootstrap="10" ada_bootstrap_type=ada-bootstrap ada_bootstrap_bin_dir="${BROOT}/usr/lib/ada-bootstrap/bin" @@ -1085,19 +1089,26 @@ toolchain_setup_ada() { # Create bin wrappers because not all of the build system respects # GNATBIND or GNATMAKE. - mkdir "${T}"/ada-wrappers || die - local tool - for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do - cat <<-EOF > "${T}"/ada-wrappers/${tool} || die - #!/bin/sh - exec "${ada_bootstrap_bin_dir}"/${CHOST}-${tool} "\$@" - EOF + _toolchain_make_gnat_wrappers() { + mkdir "${T}"/ada-wrappers || die + local tool + for tool in gnat{,bind,chop,clean,kr,link,ls,make,name,prep} ; do + cat <<-EOF > "${T}"/ada-wrappers/${tool} || die + #!/bin/sh + exec "${ada_bootstrap_bin_dir}"/${CHOST}-${tool} "\$@" + EOF + + export "${tool^^}"="${T}"/ada-wrappers/${tool} + done + chmod +x "${T}"/ada-wrappers/gnat{,bind,chop,clean,kr,link,ls,make,name,prep} || die - export "${tool^^}"="${T}"/ada-wrappers/${tool} - done - chmod +x "${T}"/ada-wrappers/gnat{,bind,chop,clean,kr,link,ls,make,name,prep} || die + export PATH="${T}/ada-wrappers:${old_path}" + } + + # Only make the wrappers for native builds. For cross, we can't + # do it as CBUILD vs CHOST will get mixed up then. + ! tc-is-cross-compiler && _toolchain_make_gnat_wrappers - export PATH="${T}/ada-wrappers:${old_path}" export CC="$(tc-getCC) -specs=${T}/ada.spec" } @@ -1635,8 +1646,9 @@ toolchain_src_configure() { [[ ${CTARGET} == *-darwin* ]] && \ confgcc+=( --enable-version-specific-runtime-libs ) + # Linux specifically here for bug #946397. # TODO: amdgcn-amdhsa? - [[ ${CTARGET} == x86_64* ]] && confgcc+=( + [[ ${CTARGET} == x86_64*-*-linux-* ]] && confgcc+=( --enable-offload-defaulted --enable-offload-targets=nvptx-none ) |