public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir
@ 2021-02-04 11:07 Daniel Cordero
  2021-02-21  2:05 ` Matt Turner
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Cordero @ 2021-02-04 11:07 UTC (permalink / raw
  To: gentoo-catalyst

From: Daniel Cordero <catalyst@0xdc.io>

On amd64 (17.1), distcc does not create /usr/lib64/distcc, despite get_libdir
returning 'lib64'.

Signed-off-by: Daniel Cordero <catalyst@0xdc.io>
---
 targets/support/chroot-functions.sh | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
index 2aec018e..0c77ac75 100755
--- a/targets/support/chroot-functions.sh
+++ b/targets/support/chroot-functions.sh
@@ -86,12 +86,14 @@ setup_features() {
 		# This sets up automatic cross-distcc-fu according to
 		# https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling
 		CHOST=$(portageq envvar CHOST)
-		LIBDIR=$(get_libdir)
-		cd /usr/${LIBDIR}/distcc/bin
-		rm cc gcc g++ c++ 2>/dev/null
-		echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
-		chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
-		for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
+		for LIBDIR in lib $(get_libdir); do
+			test -d /usr/${LIBDIR}/distcc/bin || continue
+			cd /usr/${LIBDIR}/distcc/bin
+			rm cc gcc g++ c++ 2>/dev/null
+			echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
+			chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
+			for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
+		done
 	fi
 
 	if [ -n "${clst_ICECREAM}" ]
@@ -174,13 +176,15 @@ setup_gcc(){
 }
 
 cleanup_distcc() {
-	LIBDIR=$(get_libdir)
-	rm -rf /etc/distcc/hosts
-	for i in cc gcc c++ g++; do
-		rm -f /usr/${LIBDIR}/distcc/bin/${i}
-		ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
+	rm -f /etc/distcc/hosts
+	for LIBDIR in lib $(get_libdir); do
+		test -d /usr/${LIBDIR}/distcc/bin || continue
+		for i in cc gcc c++ g++; do
+			rm -f /usr/${LIBDIR}/distcc/bin/${i}
+			ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
+		done
+		rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
 	done
-	rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
 }
 
 cleanup_icecream() {
-- 
2.26.2



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

* Re: [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir
  2021-02-04 11:07 [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir Daniel Cordero
@ 2021-02-21  2:05 ` Matt Turner
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Turner @ 2021-02-21  2:05 UTC (permalink / raw
  To: gentoo-catalyst

On Thu, Feb 4, 2021 at 6:08 AM Daniel Cordero <gentoo.catalyst@xxoo.ws> wrote:
>
> From: Daniel Cordero <catalyst@0xdc.io>
>
> On amd64 (17.1), distcc does not create /usr/lib64/distcc, despite get_libdir
> returning 'lib64'.

Looks like the couple of commits for bug 651030 [1] made it so
regardless of $(get_libdir) distcc always uses /usr/lib, so we can
simplify the patch. I'll do that locally and commit it.

Thanks!

[1] https://bugs.gentoo.org/651030


> Signed-off-by: Daniel Cordero <catalyst@0xdc.io>
> ---
>  targets/support/chroot-functions.sh | 28 ++++++++++++++++------------
>  1 file changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
> index 2aec018e..0c77ac75 100755
> --- a/targets/support/chroot-functions.sh
> +++ b/targets/support/chroot-functions.sh
> @@ -86,12 +86,14 @@ setup_features() {
>                 # This sets up automatic cross-distcc-fu according to
>                 # https://wiki.gentoo.org/wiki/Distcc/Cross-Compiling
>                 CHOST=$(portageq envvar CHOST)
> -               LIBDIR=$(get_libdir)
> -               cd /usr/${LIBDIR}/distcc/bin
> -               rm cc gcc g++ c++ 2>/dev/null
> -               echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
> -               chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
> -               for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
> +               for LIBDIR in lib $(get_libdir); do
> +                       test -d /usr/${LIBDIR}/distcc/bin || continue
> +                       cd /usr/${LIBDIR}/distcc/bin
> +                       rm cc gcc g++ c++ 2>/dev/null
> +                       echo -e '#!/bin/bash\nexec /usr/'${LIBDIR}'/distcc/bin/'${CHOST}'-g${0:$[-2]} "$@"' > ${CHOST}-wrapper
> +                       chmod a+x /usr/${LIBDIR}/distcc/bin/${CHOST}-wrapper
> +                       for i in cc gcc g++ c++; do ln -s ${CHOST}-wrapper ${i}; done
> +               done
>         fi
>
>         if [ -n "${clst_ICECREAM}" ]
> @@ -174,13 +176,15 @@ setup_gcc(){
>  }
>
>  cleanup_distcc() {
> -       LIBDIR=$(get_libdir)
> -       rm -rf /etc/distcc/hosts
> -       for i in cc gcc c++ g++; do
> -               rm -f /usr/${LIBDIR}/distcc/bin/${i}
> -               ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
> +       rm -f /etc/distcc/hosts
> +       for LIBDIR in lib $(get_libdir); do
> +               test -d /usr/${LIBDIR}/distcc/bin || continue
> +               for i in cc gcc c++ g++; do
> +                       rm -f /usr/${LIBDIR}/distcc/bin/${i}
> +                       ln -s /usr/bin/distcc /usr/${LIBDIR}/distcc/bin/${i}
> +               done
> +               rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
>         done
> -       rm -f /usr/${LIBDIR}/distcc/bin/*-wrapper
>  }
>
>  cleanup_icecream() {
> --
> 2.26.2
>
>


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

end of thread, other threads:[~2021-02-21  2:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-04 11:07 [gentoo-catalyst] [PATCH] distcc: try more combinations of libdir Daniel Cordero
2021-02-21  2:05 ` Matt Turner

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