public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Yvan Roux <yvan.roux@linaro.org>
To: Bruce Korb <bkorb@gnu.org>
Cc: Bernd Edlinger <bernd.edlinger@hotmail.de>,
		"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH] Fix fixincludes for canadian cross builds
Date: Wed, 12 Apr 2017 15:59:00 -0000	[thread overview]
Message-ID: <CAD57uCdjjVuo4Us=htfO7w-V=nJOa77VfiMoVpD7-hqW+z4S1A@mail.gmail.com> (raw)
In-Reply-To: <4b114aec-1ab7-7054-1086-a06d3b358a27@gnu.org>

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

Hi,

On 20 February 2017 at 18:53, Bruce Korb <bkorb@gnu.org> wrote:
> On 02/18/17 01:01, Bernd Edlinger wrote:
>> On 02/18/17 00:37, Bruce Korb wrote:
>>> On 02/06/17 10:44, Bernd Edlinger wrote:
>>>> I tested this change with different arm-linux-gnueabihf cross
>>>> compilers, and verified that mkheaders still works on the host system.
>>>>
>>>> Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
>>>> Is it OK for trunk?
>>>
>>> As long as you certify that this is correct for all systems we care about:
>>>
>>> +BUILD_SYSTEM_HEADER_DIR = `
>>> +    echo $(CROSS_SYSTEM_HEADER_DIR) | \
>>> +        sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
>>>
>>> that is pretty obtuse sed-speak to me.  I suggest a comment
>>> explaining what sed is supposed to be doing.  What should
>>> "$(CROSS_SYSTEM_HEADER_DIR)" look like?
>>>
>>
>> I took it just from a few lines above, so I thought that comment would
>> sufficiently explain the syntax:
>
> I confess, I didn't pull a new copy of gcc, sorry.
> So it looks good to me.


We just noticed that this patch brakes canadian cross builds when
configured with --with-build-sysroot, since headers are searched into
the target sysroot instead of the one specified for builds.

Maybe there's a cleaner way to fix this and avoid the duplication but
I didn't find another to test if --with-build-sysroot is used.  The
attached patch fixes the issue.  Tested with a Full canadian cross
build for i686-w64-mingw32 host and arm-linux-gnueabihf.

Thanks
Yvan

2017-04-12  Yvan Roux  <yvan.roux@linaro.org>

       * Makefile.in (BUILD_SYSTEM_HEADER_DIR): Set to SYSTEM_HEADER_DIR
       when configured with --with-build-sysroot.

[-- Attachment #2: fixinc.diff --]
[-- Type: text/plain, Size: 545 bytes --]

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index e38b726..7aed942 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -520,6 +520,8 @@ SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e 's,[^/]*/\.\.\/,,'
 # Path to the system headers on the build machine
 ifeq ($(build),$(host))
 BUILD_SYSTEM_HEADER_DIR = $(SYSTEM_HEADER_DIR)
+else ifdef SYSROOT_CFLAGS_FOR_TARGET
+BUILD_SYSTEM_HEADER_DIR = $(SYSTEM_HEADER_DIR)
 else
 BUILD_SYSTEM_HEADER_DIR = `echo $(CROSS_SYSTEM_HEADER_DIR) | sed -e :a -e 's,[^/]*/\.\.\/,,' -e ta`
 endif

  reply	other threads:[~2017-04-12 15:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 18:44 Bernd Edlinger
2017-02-18  1:07 ` Bruce Korb
2017-02-18 11:39   ` Bernd Edlinger
2017-02-20 18:18     ` Bruce Korb
2017-04-12 15:59       ` Yvan Roux [this message]
2017-04-12 16:22         ` Bruce Korb
2017-04-14  4:18         ` Bernd Edlinger
2017-04-14  8:24           ` Yvan Roux
2017-04-14 10:37             ` Bernd Edlinger
2017-04-14 11:20               ` Yvan Roux
2017-04-18 18:29               ` Bernd Edlinger
2017-04-19  7:56                 ` Yvan Roux
2017-04-20 20:29                   ` [PATCH] Fix fixincludes for canadian cross builds - next try Bernd Edlinger
2017-04-20 20:35                     ` Matthew Fortune
2017-04-21 10:41                     ` Yvan Roux
2017-04-28 19:13                     ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAD57uCdjjVuo4Us=htfO7w-V=nJOa77VfiMoVpD7-hqW+z4S1A@mail.gmail.com' \
    --to=yvan.roux@linaro.org \
    --cc=bernd.edlinger@hotmail.de \
    --cc=bkorb@gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).