public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Share work directories
@ 2023-02-22 12:19 Yash Shinde
  2023-02-22 15:51 ` Thomas Schwinge
  2023-02-22 16:04 ` Andrew Pinski
  0 siblings, 2 replies; 3+ messages in thread
From: Yash Shinde @ 2023-02-22 12:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: raj.khem, Randy.MacLeod, Sundeep.Kokkonda

From: Khem Raj <raj.khem@gmail.com>

Fix configure and Makefile files to read the defaults.hand t-oe from build directory,
so that the source can be shared between gcc-cross-initial, gcc-cross-intermediate, gcc-cross, gcc-runtime,
and also the sdk build which use a separate build directory compared to source directory.

While compiling gcc-crosssdk-initial-x86_64 on some host, there is
occasionally failure that test the existance of default.h doesn't work,
the reason is tm_include_list='** defaults.h' rather than tm_include_list='** ./defaults.h'.
So we add the test condition for this situation.

gcc/ChangeLog:

	* configure
	* configure.ac
	* mkconfig.sh

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 gcc/configure    | 4 ++--
 gcc/configure.ac | 4 ++--
 gcc/mkconfig.sh  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gcc/configure b/gcc/configure
index 254f9b6c943..ff2a3e26049 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -13471,8 +13471,8 @@ for f in $tm_file; do
        tm_include_list="${tm_include_list} $f"
        ;;
     defaults.h )
-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
-       tm_include_list="${tm_include_list} $f"
+       tm_file_list="${tm_file_list} ./$f"
+       tm_include_list="${tm_include_list} ./$f"
        ;;
     * )
        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 62bc908b991..d36830cf2fb 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2336,8 +2336,8 @@ for f in $tm_file; do
        tm_include_list="${tm_include_list} $f"
        ;;
     defaults.h )
-       tm_file_list="${tm_file_list} \$(srcdir)/$f"
-       tm_include_list="${tm_include_list} $f"
+       tm_file_list="${tm_file_list} ./$f"
+       tm_include_list="${tm_include_list} ./$f"
        ;;
     * )
        tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
index 054ede89647..3b2c2b9df37 100644
--- a/gcc/mkconfig.sh
+++ b/gcc/mkconfig.sh
@@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
     if [ $# -ge 1 ]; then
 	echo '#ifdef IN_GCC' >> ${output}T
 	for file in "$@"; do
-	    if test x"$file" = x"defaults.h"; then
+	    if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
 		postpone_defaults_h="yes"
 	    else
 		echo "# include \"$file\"" >> ${output}T
@@ -106,7 +106,7 @@ esac
 
 # If we postponed including defaults.h, add the #include now.
 if test x"$postpone_defaults_h" = x"yes"; then
-    echo "# include \"defaults.h\"" >> ${output}T
+    echo "# include \"./defaults.h\"" >> ${output}T
 fi
 
 # Add multiple inclusion protection guard, part two.
-- 
2.39.0


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

* Re: [PATCH] Share work directories
  2023-02-22 12:19 [PATCH] Share work directories Yash Shinde
@ 2023-02-22 15:51 ` Thomas Schwinge
  2023-02-22 16:04 ` Andrew Pinski
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2023-02-22 15:51 UTC (permalink / raw)
  To: Yash Shinde, Khem Raj; +Cc: Randy.MacLeod, Sundeep.Kokkonda, gcc-patches

Hi!

On 2023-02-22T04:19:04-0800, Yash Shinde <Yash.Shinde@windriver.com> wrote:
> From: Khem Raj <raj.khem@gmail.com>
>
> Fix configure and Makefile files to read the defaults.h and t-oe from build directory,
> so that the source can be shared between gcc-cross-initial, gcc-cross-intermediate, gcc-cross, gcc-runtime,
> and also the sdk build which use a separate build directory compared to source directory.
>
> While compiling gcc-crosssdk-initial-x86_64 on some host, there is
> occasionally failure that test the existance of default.h doesn't work,

This is about '[source-gcc]/gcc/defaults.h', right?  Why should that ever
fail to test that it exists?

> the reason is tm_include_list='** defaults.h' rather than tm_include_list='** ./defaults.h'.
> So we add the test condition for this situation.

I'm sorry, I understand neither your failure mode, nor your proposed
changes.  Please provide more context?


Grüße
 Thomas


> gcc/ChangeLog:
>
>       * configure
>       * configure.ac
>       * mkconfig.sh
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  gcc/configure    | 4 ++--
>  gcc/configure.ac | 4 ++--
>  gcc/mkconfig.sh  | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/configure b/gcc/configure
> index 254f9b6c943..ff2a3e26049 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -13471,8 +13471,8 @@ for f in $tm_file; do
>         tm_include_list="${tm_include_list} $f"
>         ;;
>      defaults.h )
> -       tm_file_list="${tm_file_list} \$(srcdir)/$f"
> -       tm_include_list="${tm_include_list} $f"
> +       tm_file_list="${tm_file_list} ./$f"
> +       tm_include_list="${tm_include_list} ./$f"
>         ;;
>      * )
>         tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 62bc908b991..d36830cf2fb 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -2336,8 +2336,8 @@ for f in $tm_file; do
>         tm_include_list="${tm_include_list} $f"
>         ;;
>      defaults.h )
> -       tm_file_list="${tm_file_list} \$(srcdir)/$f"
> -       tm_include_list="${tm_include_list} $f"
> +       tm_file_list="${tm_file_list} ./$f"
> +       tm_include_list="${tm_include_list} ./$f"
>         ;;
>      * )
>         tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
> diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
> index 054ede89647..3b2c2b9df37 100644
> --- a/gcc/mkconfig.sh
> +++ b/gcc/mkconfig.sh
> @@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
>      if [ $# -ge 1 ]; then
>       echo '#ifdef IN_GCC' >> ${output}T
>       for file in "$@"; do
> -         if test x"$file" = x"defaults.h"; then
> +         if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
>               postpone_defaults_h="yes"
>           else
>               echo "# include \"$file\"" >> ${output}T
> @@ -106,7 +106,7 @@ esac
>
>  # If we postponed including defaults.h, add the #include now.
>  if test x"$postpone_defaults_h" = x"yes"; then
> -    echo "# include \"defaults.h\"" >> ${output}T
> +    echo "# include \"./defaults.h\"" >> ${output}T
>  fi
>
>  # Add multiple inclusion protection guard, part two.
> --
> 2.39.0
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

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

* Re: [PATCH] Share work directories
  2023-02-22 12:19 [PATCH] Share work directories Yash Shinde
  2023-02-22 15:51 ` Thomas Schwinge
@ 2023-02-22 16:04 ` Andrew Pinski
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Pinski @ 2023-02-22 16:04 UTC (permalink / raw)
  To: Yash Shinde; +Cc: gcc-patches, raj.khem, Randy.MacLeod, Sundeep.Kokkonda

On Wed, Feb 22, 2023 at 4:22 AM Yash Shinde <Yash.Shinde@windriver.com> wrote:
>
> From: Khem Raj <raj.khem@gmail.com>
>
> Fix configure and Makefile files to read the defaults.hand t-oe from build directory,
> so that the source can be shared between gcc-cross-initial, gcc-cross-intermediate, gcc-cross, gcc-runtime,
> and also the sdk build which use a separate build directory compared to source directory.

>
> While compiling gcc-crosssdk-initial-x86_64 on some host, there is
> occasionally failure that test the existance of default.h doesn't work,
> the reason is tm_include_list='** defaults.h' rather than tm_include_list='** ./defaults.h'.
> So we add the test condition for this situation.

This patch does not make sense because $(srcdir)/defaults.h will always exist.
I build all the time with different object directories and I know of
many people who build with a read only source directory; explicitly so
they can test that way.
You are going to have to expand on why you need defaults.h from the
build directory and not the source directory?
As far as I Know there is no defaults.h in the build directory even.
Do you have another patch which changes that?


Thanks,
Andrew Pinski

>
> gcc/ChangeLog:
>
>         * configure
>         * configure.ac
>         * mkconfig.sh
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
> ---
>  gcc/configure    | 4 ++--
>  gcc/configure.ac | 4 ++--
>  gcc/mkconfig.sh  | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/gcc/configure b/gcc/configure
> index 254f9b6c943..ff2a3e26049 100755
> --- a/gcc/configure
> +++ b/gcc/configure
> @@ -13471,8 +13471,8 @@ for f in $tm_file; do
>         tm_include_list="${tm_include_list} $f"
>         ;;
>      defaults.h )
> -       tm_file_list="${tm_file_list} \$(srcdir)/$f"
> -       tm_include_list="${tm_include_list} $f"
> +       tm_file_list="${tm_file_list} ./$f"
> +       tm_include_list="${tm_include_list} ./$f"
>         ;;
>      * )
>         tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> index 62bc908b991..d36830cf2fb 100644
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -2336,8 +2336,8 @@ for f in $tm_file; do
>         tm_include_list="${tm_include_list} $f"
>         ;;
>      defaults.h )
> -       tm_file_list="${tm_file_list} \$(srcdir)/$f"
> -       tm_include_list="${tm_include_list} $f"
> +       tm_file_list="${tm_file_list} ./$f"
> +       tm_include_list="${tm_include_list} ./$f"
>         ;;
>      * )
>         tm_file_list="${tm_file_list} \$(srcdir)/config/$f"
> diff --git a/gcc/mkconfig.sh b/gcc/mkconfig.sh
> index 054ede89647..3b2c2b9df37 100644
> --- a/gcc/mkconfig.sh
> +++ b/gcc/mkconfig.sh
> @@ -77,7 +77,7 @@ if [ -n "$HEADERS" ]; then
>      if [ $# -ge 1 ]; then
>         echo '#ifdef IN_GCC' >> ${output}T
>         for file in "$@"; do
> -           if test x"$file" = x"defaults.h"; then
> +           if test x"$file" = x"./defaults.h" -o x"$file" = x"defaults.h"; then
>                 postpone_defaults_h="yes"
>             else
>                 echo "# include \"$file\"" >> ${output}T
> @@ -106,7 +106,7 @@ esac
>
>  # If we postponed including defaults.h, add the #include now.
>  if test x"$postpone_defaults_h" = x"yes"; then
> -    echo "# include \"defaults.h\"" >> ${output}T
> +    echo "# include \"./defaults.h\"" >> ${output}T
>  fi
>
>  # Add multiple inclusion protection guard, part two.
> --
> 2.39.0
>

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

end of thread, other threads:[~2023-02-22 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 12:19 [PATCH] Share work directories Yash Shinde
2023-02-22 15:51 ` Thomas Schwinge
2023-02-22 16:04 ` Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).