public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Qing Zhao <qing.zhao@oracle.com>
To: Jeff Law <jeffreyalaw@gmail.com>
Cc: Nick Alcock via Gcc-patches <gcc-patches@gcc.gnu.org>,
	John Henning <john.henning@oracle.com>
Subject: Re: [Patch][doc][PR101843]clarification on building gcc and binutils together
Date: Thu, 9 Sep 2021 15:05:37 +0000	[thread overview]
Message-ID: <DC53F68C-DED4-4B11-BABC-97DB3020D763@oracle.com> (raw)
In-Reply-To: <72d8eff5-5a0f-9e4d-68be-476c4bc1fc5c@gmail.com>

Hi, Jeff,

Sorry for the late reply.

The following is the reply from John Henning and the updated patch based on your suggestions, 
Please take a look and let us know any issue there.

Thanks.

Qing

======================================================================
Jeff Law suggested that the documentation should recommend building binutils
separately.  The same suggestion was made in the discussion of bug 101843.  

OK.  Rev.2 of the suggested doc patch DOES make that recommendation.

Rev.2 of the patch DOES NOT remove all documentation of GCC+binutils
combined builds, out of respect for existing user practice (*).

Rev.2 of the patch DOES remove mention of unpacking binutils 
   "in the same directory"
which is clearly dangerous for subdirectories that have the same 
name but different content (such as libiberty/, which is what led 
to bug 101843).

(*) There are many google tracks, and it has been documented >20 years
    https://web.archive.org/web/20001014203336/http://gcc.gnu.org:80/install/download.html
    Therefore I (jhenning) suggest that it is useful to provide the clue on
    how to have the best chance that a combined build will succeed.


From b0034a941ff6a74589369a1f79cfc12295edf5d3 Mon Sep 17 00:00:00 2001
From: Qing Zhao <qing.zhao@oracle.com>
Date: Thu, 9 Sep 2021 15:00:26 +0000
Subject: [PATCH] doc/install.texi: add a generic advice on building gcc and
 binutils together.

---
 gcc/doc/install.texi | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 8e974d2952ef..a5ac462933b9 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -562,8 +562,14 @@ language front end and the language runtime (where appropriate).

 If you also intend to build binutils (either to upgrade an existing
 installation or for use in place of the corresponding tools of your
-OS), unpack the binutils distribution either in the same directory or
-a separate one.  In the latter case, add symbolic links to any
+OS), begin by identifying a version of binutils that was created at
+about the same time as your version of GCC.  It is recommended to build
+and install binutils first, before building GCC. You can set the prefix
+directory to the same as will be used for the GCC installation.
+
+Alternatively, it is often possible to build binutils at the same time
+that you build GCC.  If you wish to try this method, unpack the binutils
+distribution in a separate directory, and add symbolic links to any
 components of the binutils you intend to build alongside the compiler
 (@file{bfd}, @file{binutils}, @file{gas}, @file{gprof}, @file{ld},
 @file{opcodes}, @dots{}) to the directory containing the GCC sources.
-- 
2.27.0


> On Aug 23, 2021, at 12:45 AM, Jeff Law via Gcc-patches <gcc-patches@gcc.gnu.org> wrote:
> 
> 
> 
> On 8/19/2021 4:27 PM, Qing Zhao via Gcc-patches wrote:
>> Hi,
>> 
>> This patch is on behalf of John Henning, who opened PR 101843:
>> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101843
>> 
>> He proposed the following doc change, please take a look and let me know whether this is Okay for commit?
> I think we need to get away from suggesting single tree builds. Instead what we should recommend is to identify the right version of binutils, build and install it into the same prefix as GCC will be installed, then build and install GCC.
> 
> jeff
> 


  reply	other threads:[~2021-09-09 15:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 22:27 Qing Zhao
2021-08-23  5:45 ` Jeff Law
2021-09-09 15:05   ` Qing Zhao [this message]
2021-09-19 16:57     ` Jeff Law
2021-09-23 11:07       ` John Henning

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=DC53F68C-DED4-4B11-BABC-97DB3020D763@oracle.com \
    --to=qing.zhao@oracle.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=john.henning@oracle.com \
    /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).