public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] Changes to toolchain.eclass to better support gnat-gpl ebuild
@ 2020-04-02 10:52 Alfredo Tupone
  2020-04-02 17:41 ` [gentoo-dev] " Sergei Trofimovich
  2020-04-02 18:14 ` [gentoo-dev] " Mike Gilbert
  0 siblings, 2 replies; 3+ messages in thread
From: Alfredo Tupone @ 2020-04-02 10:52 UTC (permalink / raw
  To: gentoo-dev, slyfox

[-- Attachment #1: Type: text/plain, Size: 277 bytes --]

I would like to have the attached changes reviewed and, if possible,
applied to the toolchain eclass.

This will simplify the gnat-gpl ebuild and is a step to add ada to
sys-devel/gcc

And also I suggest temporary to mask the ada flag for sys-devel/gcc

Thanks

Alfredo Tupone

[-- Attachment #2: toolchain.diff --]
[-- Type: text/x-patch, Size: 4866 bytes --]

diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
index ee466ee4d904..c18864b60ded 100644
--- a/eclass/toolchain.eclass
+++ b/eclass/toolchain.eclass
@@ -172,31 +172,31 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
 	tc_version_is_at_least 4.2 && IUSE+=" +openmp"
 	tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
 	tc_version_is_at_least 4.7 && IUSE+=" go"
 	# sanitizer support appeared in gcc-4.8, but <gcc-5 does not
 	# support modern glibc.
 	tc_version_is_at_least 5 && IUSE+=" +sanitize"
 	# Note:
 	#   <gcc-4.8 supported graphite, it required forked ppl
 	#     versions which we dropped.  Since graphite was also experimental in
 	#     the older versions, we don't want to bother supporting it.  #448024
 	#   <gcc-5 supported graphite, it required cloog
 	#   <gcc-6.5 supported graphite, it required old incompatible isl
 	tc_version_is_at_least 6.5 &&
 		IUSE+=" graphite" TC_FEATURES+=(graphite)
 	tc_version_is_between 4.9 8 && IUSE+=" cilk"
-	tc_version_is_at_least 4.9 && IUSE+=" +vtv"
+	tc_version_is_at_least 4.9 && IUSE+=" ada +vtv"
 	tc_version_is_at_least 5.0 && IUSE+=" jit"
 	tc_version_is_between 5.0 9 && IUSE+=" mpx"
 	tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
 	# systemtap is a gentoo-specific switch: bug #654748
 	tc_version_is_at_least 8.0 &&
 		IUSE+=" systemtap" TC_FEATURES+=(systemtap)
 	tc_version_is_at_least 9.0 && IUSE+=" d"
 	tc_version_is_at_least 9.1 && IUSE+=" lto"
 	tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
 fi
 
 if tc_version_is_at_least 10; then
 	# Note: currently we pull in releases, snapshots and
 	# git versions into the same SLOT.
 	SLOT="${GCCMAJOR}"
@@ -897,32 +897,31 @@ toolchain_src_configure() {
 	if is_objc || is_objcxx ; then
 		GCC_LANG+=",objc"
 		if tc_version_is_at_least 4 ; then
 			use objc-gc && confgcc+=( --enable-objc-gc )
 		fi
 		is_objcxx && GCC_LANG+=",obj-c++"
 	fi
 
 	# fortran support just got sillier! the lang value can be f77 for
 	# fortran77, f95 for fortran95, or just plain old fortran for the
 	# currently supported standard depending on gcc version.
 	is_fortran && GCC_LANG+=",fortran"
 	is_f77 && GCC_LANG+=",f77"
 	is_f95 && GCC_LANG+=",f95"
 
-	# We do NOT want 'ADA support' in here!
-	# is_ada && GCC_LANG+=",ada"
+	is_ada && GCC_LANG+=",ada"
 
 	confgcc+=( --enable-languages=${GCC_LANG} )
 
 	### general options
 
 	confgcc+=(
 		--enable-obsolete
 		--enable-secureplt
 		--disable-werror
 		--with-system-zlib
 	)
 
 	if use nls ; then
 		confgcc+=( --enable-nls --without-included-gettext )
 	else
@@ -1258,30 +1257,34 @@ toolchain_src_configure() {
 			fi
 			if use_if_iuse ssp; then
 				# On some targets USE="ssp -libssp" is an invalid
 				# configuration as target libc does not provide
 				# stack_chk_* functions. Do not disable libssp there.
 				case ${CTARGET} in
 					mingw*|*-mingw*) ewarn "Not disabling libssp" ;;
 					*) confgcc+=( --disable-libssp ) ;;
 				esac
 			else
 				confgcc+=( --disable-libssp )
 			fi
 		fi
 	fi
 
+	if in_iuse ada ; then
+		confgcc+=( --disable-libada )
+	fi
+
 	if in_iuse cilk ; then
 		confgcc+=( $(use_enable cilk libcilkrts) )
 	fi
 
 	if in_iuse mpx ; then
 		confgcc+=( $(use_enable mpx libmpx) )
 	fi
 
 	if in_iuse systemtap ; then
 		confgcc+=( $(use_enable systemtap) )
 	fi
 
 	if in_iuse vtv ; then
 		confgcc+=(
 			$(use_enable vtv vtable-verify)
@@ -1651,36 +1654,45 @@ gcc-abi-map() {
 	for m in "${map[@]}" ; do
 		l=( ${m} )
 		[[ $1 == ${l[0]} ]] && echo ${l[1]} && break
 	done
 }
 
 #----> src_compile <----
 
 toolchain_src_compile() {
 	touch "${S}"/gcc/c-gperf.h
 
 	# Do not make manpages if we do not have perl ...
 	[[ ! -x /usr/bin/perl ]] \
 		&& find "${WORKDIR}"/build -name '*.[17]' -exec touch {} +
 
+	# Do not set ADAFLAGS to build the compiler
+	unset ADAFLAGS
+
 	# Older gcc versions did not detect bash and re-exec itself, so force the
 	# use of bash.  Newer ones will auto-detect, but this is not harmful.
 	# This needs to be set for compile as well, as it's used in libtool
 	# generation, which will break install otherwise (at least in 3.3.6): #664486
 	CONFIG_SHELL="${EPREFIX}/bin/bash" \
 	gcc_do_make ${GCC_MAKE_TARGET}
+	if use ada; then
+		gcc_do_make "-C gcc gnatlib-shared"
+		ln -s gcc ../build/prev-gcc || die
+		ln -s ${CHOST} ../build/prev-${CHOST} || die
+		gcc_do_make "-C gcc gnattools"
+	fi
 }
 
 gcc_do_make() {
 	# This function accepts one optional argument, the make target to be used.
 	# If omitted, gcc_do_make will try to guess whether it should use all,
 	# or bootstrap-lean depending on CTARGET and arch.
 	# An example of how to use this function:
 	#
 	#	gcc_do_make all-target-libstdc++-v3
 
 	[[ -n ${1} ]] && GCC_MAKE_TARGET=${1}
 
 	# default target
 	if is_crosscompile || tc-is-cross-compiler ; then
 		# 3 stage bootstrapping doesnt quite work when you cant run the

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-dev] Re: Changes to toolchain.eclass to better support gnat-gpl ebuild
  2020-04-02 10:52 [gentoo-dev] Changes to toolchain.eclass to better support gnat-gpl ebuild Alfredo Tupone
@ 2020-04-02 17:41 ` Sergei Trofimovich
  2020-04-02 18:14 ` [gentoo-dev] " Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2020-04-02 17:41 UTC (permalink / raw
  To: Alfredo Tupone; +Cc: gentoo-dev

On Thu, 2 Apr 2020 12:52:13 +0200
Alfredo Tupone <tupone@gentoo.org> wrote:

> +	# Do not set ADAFLAGS to build the compiler
> +	unset ADAFLAGS

Can you clarify in a comment why it's done?

>  	# Older gcc versions did not detect bash and re-exec itself, so force the
>  	# use of bash.  Newer ones will auto-detect, but this is not harmful.
>  	# This needs to be set for compile as well, as it's used in libtool
>  	# generation, which will break install otherwise (at least in 3.3.6): #664486
>  	CONFIG_SHELL="${EPREFIX}/bin/bash" \
>  	gcc_do_make ${GCC_MAKE_TARGET}

> +	if use ada; then
> +		gcc_do_make "-C gcc gnatlib-shared"
> +		ln -s gcc ../build/prev-gcc || die
> +		ln -s ${CHOST} ../build/prev-${CHOST} || die
> +		gcc_do_make "-C gcc gnattools"
> +	fi

Two points:
1. You probably still need CONFIG_SHELL="${EPREFIX}/bin/bash" passed.
2. Can you add an inline comment why it's needed? Why 'make' does not Just Work?

-- 

  Sergei


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [gentoo-dev] Changes to toolchain.eclass to better support gnat-gpl ebuild
  2020-04-02 10:52 [gentoo-dev] Changes to toolchain.eclass to better support gnat-gpl ebuild Alfredo Tupone
  2020-04-02 17:41 ` [gentoo-dev] " Sergei Trofimovich
@ 2020-04-02 18:14 ` Mike Gilbert
  1 sibling, 0 replies; 3+ messages in thread
From: Mike Gilbert @ 2020-04-02 18:14 UTC (permalink / raw
  To: Gentoo Dev; +Cc: Sergei Trofimovich

On Thu, Apr 2, 2020 at 6:52 AM Alfredo Tupone <tupone@gentoo.org> wrote:
>
> I would like to have the attached changes reviewed and, if possible,
> applied to the toolchain eclass.

Please generate patches using git-format-patch, and send them using
git-send-email. This allows them to be easily reviewed in a mail
client.

> +     if use ada; then
> +             gcc_do_make "-C gcc gnatlib-shared"
> +             ln -s gcc ../build/prev-gcc || die
> +             ln -s ${CHOST} ../build/prev-${CHOST} || die
> +             gcc_do_make "-C gcc gnattools"
> +     fi

You probably want "is_ada" instead of "use ada" here. Otherwise,
portage will error if "ada" is not in IUSE.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-02 18:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-02 10:52 [gentoo-dev] Changes to toolchain.eclass to better support gnat-gpl ebuild Alfredo Tupone
2020-04-02 17:41 ` [gentoo-dev] " Sergei Trofimovich
2020-04-02 18:14 ` [gentoo-dev] " Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox