public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41
@ 2023-12-05 21:36 Indu Bhagat
  2023-12-05 21:36 ` [[PATCH][GCC13] 1/2] bfd: linker: merge .sframe sections Indu Bhagat
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Indu Bhagat @ 2023-12-05 21:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: doko, sam, Indu Bhagat

Hello,

To resolve the issue of combined Binutils (2.41) + GCC (13) failing to
install (https://sourceware.org/bugzilla/show_bug.cgi?id=31108), we will
need some backports.  This specific issue is with using --enable-shared
in the combined tree build; it arises due to missing install-*
dependencies in the top-level makefiles.

I think it makes sense to bring both of the following two commits (from
the trunk) to the GCC13 branch:

	commit eff0e7a4ae31d1e4e64ae37bbc10d073d8579255
	Author: Indu Bhagat <indu.bhagat@oracle.com>
	Date:   Wed Jan 18 23:17:49 2023 -0800
	toplevel: Makefile.def: add install-strip dependency on libsframe
    

	commit dab58c93634bef06fd289f49109b5c370cd5c380
	Author: Indu Bhagat <indu.bhagat@oracle.com>
	Date:   Tue Nov 15 15:07:04 2022 -0800
	bfd: linker: merge .sframe sections

This patch set cherry-picks the above two commits to GCC13 branch.  The
patches apply cleanly with no conflicts.

-----------
Testing notes:
 - Combined tree with GCC 13 (releases/gcc-13 branch) with binutils 2.41
   (binutils-2_41-release-point branch) with "--enable-shared
   --disable-bootstrap" builds and installs.
 - Bootstrapped and regression tested releases/gcc-13 branch (make
   check-gcc in a NOT combined tree build).
-----------

Thanks,
Indu Bhagat (2):
  bfd: linker: merge .sframe sections
  toplevel: Makefile.def: add install-strip dependency on libsframe

 Makefile.def |  7 +++++++
 Makefile.in  | 12 ++++++++++++
 2 files changed, 19 insertions(+)

-- 
2.41.0


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

* [[PATCH][GCC13] 1/2] bfd: linker: merge .sframe sections
  2023-12-05 21:36 [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Indu Bhagat
@ 2023-12-05 21:36 ` Indu Bhagat
  2023-12-05 21:36 ` [[PATCH][GCC13] 2/2] toplevel: Makefile.def: add install-strip dependency on libsframe Indu Bhagat
  2023-12-05 21:45 ` [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Jakub Jelinek
  2 siblings, 0 replies; 5+ messages in thread
From: Indu Bhagat @ 2023-12-05 21:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: doko, sam, Indu Bhagat

The linker merges all the input .sframe sections.  When merging, the
linker verifies that all the input .sframe sections have the same
abi/arch.

The linker uses libsframe library to perform key actions on the
.sframe sections - decode, read, and create output data.  This
implies buildsystem changes to make and install libsframe before
libbfd.

The linker places the output .sframe section in a new segment of its
own: PT_GNU_SFRAME.  A new segment is not added, however, if the
generated .sframe section is empty.

When a section is discarded from the final link, the corresponding
entries in the .sframe section for those functions are also deleted.

The linker sorts the SFrame FDEs on start address by default and sets
the SFRAME_F_FDE_SORTED flag in the .sframe section.

This patch also adds support for generation of SFrame unwind
information for the .plt* sections on x86_64.  SFrame unwind info is
generated for IBT enabled PLT, lazy/non-lazy PLT.

The existing linker option --no-ld-generated-unwind-info has been
adapted to include the control of whether .sframe unwind information
will be generated for the linker generated sections like PLT.

Changes to the linker script have been made as necessary.

ChangeLog:

	* Makefile.def: Add install dependency on libsframe for libbfd.
	* Makefile.in: Regenerated.

(cherry picked from commit dab58c93634bef06fd289f49109b5c370cd5c380)
---
 Makefile.def |  4 ++++
 Makefile.in  | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/Makefile.def b/Makefile.def
index 35e994eb77e..41512475042 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -457,11 +457,14 @@ dependencies = { module=all-gdbsupport; on=all-gnulib; };
 dependencies = { module=all-gdbsupport; on=all-intl; };
 
 // Host modules specific to binutils.
+// build libsframe before bfd for encoder/decoder support for linking
+// SFrame sections
 dependencies = { module=configure-bfd; on=configure-libiberty; hard=true; };
 dependencies = { module=configure-bfd; on=configure-intl; };
 dependencies = { module=all-bfd; on=all-libiberty; };
 dependencies = { module=all-bfd; on=all-intl; };
 dependencies = { module=all-bfd; on=all-zlib; };
+dependencies = { module=all-bfd; on=all-libsframe; };
 dependencies = { module=configure-opcodes; on=configure-libiberty; hard=true; };
 dependencies = { module=all-opcodes; on=all-libiberty; };
 
@@ -487,6 +490,7 @@ dependencies = { module=install-binutils; on=install-opcodes; };
 dependencies = { module=install-strip-binutils; on=install-strip-opcodes; };
 
 // Likewise for ld, libctf, and bfd.
+dependencies = { module=install-bfd; on=install-libsframe; };
 dependencies = { module=install-libctf; on=install-bfd; };
 dependencies = { module=install-ld; on=install-bfd; };
 dependencies = { module=install-ld; on=install-libctf; };
diff --git a/Makefile.in b/Makefile.in
index 06a9398e172..076a48944b8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -65849,6 +65849,16 @@ all-stagetrain-bfd: maybe-all-stagetrain-zlib
 all-stagefeedback-bfd: maybe-all-stagefeedback-zlib
 all-stageautoprofile-bfd: maybe-all-stageautoprofile-zlib
 all-stageautofeedback-bfd: maybe-all-stageautofeedback-zlib
+all-bfd: maybe-all-libsframe
+all-stage1-bfd: maybe-all-stage1-libsframe
+all-stage2-bfd: maybe-all-stage2-libsframe
+all-stage3-bfd: maybe-all-stage3-libsframe
+all-stage4-bfd: maybe-all-stage4-libsframe
+all-stageprofile-bfd: maybe-all-stageprofile-libsframe
+all-stagetrain-bfd: maybe-all-stagetrain-libsframe
+all-stagefeedback-bfd: maybe-all-stagefeedback-libsframe
+all-stageautoprofile-bfd: maybe-all-stageautoprofile-libsframe
+all-stageautofeedback-bfd: maybe-all-stageautofeedback-libsframe
 configure-opcodes: configure-libiberty
 configure-stage1-opcodes: configure-stage1-libiberty
 configure-stage2-opcodes: configure-stage2-libiberty
@@ -65981,6 +65991,7 @@ all-stageautoprofile-binutils: maybe-all-stageautoprofile-libsframe
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe
 install-binutils: maybe-install-opcodes
 install-strip-binutils: maybe-install-strip-opcodes
+install-bfd: maybe-install-libsframe
 install-libctf: maybe-install-bfd
 install-ld: maybe-install-bfd
 install-ld: maybe-install-libctf
-- 
2.41.0


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

* [[PATCH][GCC13] 2/2] toplevel: Makefile.def: add install-strip dependency on libsframe
  2023-12-05 21:36 [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Indu Bhagat
  2023-12-05 21:36 ` [[PATCH][GCC13] 1/2] bfd: linker: merge .sframe sections Indu Bhagat
@ 2023-12-05 21:36 ` Indu Bhagat
  2023-12-05 21:45 ` [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Jakub Jelinek
  2 siblings, 0 replies; 5+ messages in thread
From: Indu Bhagat @ 2023-12-05 21:36 UTC (permalink / raw)
  To: gcc-patches; +Cc: doko, sam, Indu Bhagat

As noted in PR libsframe/30014 - FTBFS: install-strip fails because
bfdlib relinks and fails to find libsframe, the install time
dependencies of libbfd need to be updated.

ChangeLog:

	* Makefile.def: Reflect that libsframe needs to installed before
	libbfd.  Reorder a bit to better track libsframe dependencies.
	* Makefile.in: Regenerate.

(cherry picked from commit eff0e7a4ae31d1e4e64ae37bbc10d073d8579255)
---
 Makefile.def | 5 ++++-
 Makefile.in  | 3 ++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 41512475042..0c107cae128 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -490,7 +490,6 @@ dependencies = { module=install-binutils; on=install-opcodes; };
 dependencies = { module=install-strip-binutils; on=install-strip-opcodes; };
 
 // Likewise for ld, libctf, and bfd.
-dependencies = { module=install-bfd; on=install-libsframe; };
 dependencies = { module=install-libctf; on=install-bfd; };
 dependencies = { module=install-ld; on=install-bfd; };
 dependencies = { module=install-ld; on=install-libctf; };
@@ -498,6 +497,10 @@ dependencies = { module=install-strip-libctf; on=install-strip-bfd; };
 dependencies = { module=install-strip-ld; on=install-strip-bfd; };
 dependencies = { module=install-strip-ld; on=install-strip-libctf; };
 
+// libbfd depends on libsframe
+dependencies = { module=install-bfd; on=install-libsframe; };
+dependencies = { module=install-strip-bfd; on=install-strip-libsframe; };
+
 // libopcodes depends on libbfd
 dependencies = { module=configure-opcodes; on=configure-bfd; hard=true; };
 dependencies = { module=install-opcodes; on=install-bfd; };
diff --git a/Makefile.in b/Makefile.in
index 076a48944b8..c1a607ac564 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -65991,13 +65991,14 @@ all-stageautoprofile-binutils: maybe-all-stageautoprofile-libsframe
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-libsframe
 install-binutils: maybe-install-opcodes
 install-strip-binutils: maybe-install-strip-opcodes
-install-bfd: maybe-install-libsframe
 install-libctf: maybe-install-bfd
 install-ld: maybe-install-bfd
 install-ld: maybe-install-libctf
 install-strip-libctf: maybe-install-strip-bfd
 install-strip-ld: maybe-install-strip-bfd
 install-strip-ld: maybe-install-strip-libctf
+install-bfd: maybe-install-libsframe
+install-strip-bfd: maybe-install-strip-libsframe
 configure-opcodes: configure-bfd
 configure-stage1-opcodes: configure-stage1-bfd
 configure-stage2-opcodes: configure-stage2-bfd
-- 
2.41.0


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

* Re: [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41
  2023-12-05 21:36 [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Indu Bhagat
  2023-12-05 21:36 ` [[PATCH][GCC13] 1/2] bfd: linker: merge .sframe sections Indu Bhagat
  2023-12-05 21:36 ` [[PATCH][GCC13] 2/2] toplevel: Makefile.def: add install-strip dependency on libsframe Indu Bhagat
@ 2023-12-05 21:45 ` Jakub Jelinek
  2023-12-05 23:39   ` Indu Bhagat
  2 siblings, 1 reply; 5+ messages in thread
From: Jakub Jelinek @ 2023-12-05 21:45 UTC (permalink / raw)
  To: Indu Bhagat; +Cc: gcc-patches, doko, sam

On Tue, Dec 05, 2023 at 01:36:30PM -0800, Indu Bhagat wrote:
> To resolve the issue of combined Binutils (2.41) + GCC (13) failing to
> install (https://sourceware.org/bugzilla/show_bug.cgi?id=31108), we will
> need some backports.  This specific issue is with using --enable-shared
> in the combined tree build; it arises due to missing install-*
> dependencies in the top-level makefiles.
> 
> I think it makes sense to bring both of the following two commits (from
> the trunk) to the GCC13 branch:
> 
> 	commit eff0e7a4ae31d1e4e64ae37bbc10d073d8579255
> 	Author: Indu Bhagat <indu.bhagat@oracle.com>
> 	Date:   Wed Jan 18 23:17:49 2023 -0800
> 	toplevel: Makefile.def: add install-strip dependency on libsframe
>     
> 
> 	commit dab58c93634bef06fd289f49109b5c370cd5c380
> 	Author: Indu Bhagat <indu.bhagat@oracle.com>
> 	Date:   Tue Nov 15 15:07:04 2022 -0800
> 	bfd: linker: merge .sframe sections
> 
> This patch set cherry-picks the above two commits to GCC13 branch.  The
> patches apply cleanly with no conflicts.

Won't this break building gcc 13 with in-tree older binutils which don't have
libsframe at all?  I think binutils 2.39 and older don't have it.

	Jakub


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

* Re: [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41
  2023-12-05 21:45 ` [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Jakub Jelinek
@ 2023-12-05 23:39   ` Indu Bhagat
  0 siblings, 0 replies; 5+ messages in thread
From: Indu Bhagat @ 2023-12-05 23:39 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches, doko, sam

On 12/5/23 13:45, Jakub Jelinek wrote:
> On Tue, Dec 05, 2023 at 01:36:30PM -0800, Indu Bhagat wrote:
>> To resolve the issue of combined Binutils (2.41) + GCC (13) failing to
>> install (https://sourceware.org/bugzilla/show_bug.cgi?id=31108), we will
>> need some backports.  This specific issue is with using --enable-shared
>> in the combined tree build; it arises due to missing install-*
>> dependencies in the top-level makefiles.
>>
>> I think it makes sense to bring both of the following two commits (from
>> the trunk) to the GCC13 branch:
>>
>> 	commit eff0e7a4ae31d1e4e64ae37bbc10d073d8579255
>> 	Author: Indu Bhagat <indu.bhagat@oracle.com>
>> 	Date:   Wed Jan 18 23:17:49 2023 -0800
>> 	toplevel: Makefile.def: add install-strip dependency on libsframe
>>      
>>
>> 	commit dab58c93634bef06fd289f49109b5c370cd5c380
>> 	Author: Indu Bhagat <indu.bhagat@oracle.com>
>> 	Date:   Tue Nov 15 15:07:04 2022 -0800
>> 	bfd: linker: merge .sframe sections
>>
>> This patch set cherry-picks the above two commits to GCC13 branch.  The
>> patches apply cleanly with no conflicts.
> 
> Won't this break building gcc 13 with in-tree older binutils which don't have
> libsframe at all?  I think binutils 2.39 and older don't have it.
> 

I tested with binutils-2_39-branch and releases/gcc-13 as well (with 
--enable-shared --disable-bootstrap). It builds and installs fine.

Indu


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

end of thread, other threads:[~2023-12-05 23:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-05 21:36 [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Indu Bhagat
2023-12-05 21:36 ` [[PATCH][GCC13] 1/2] bfd: linker: merge .sframe sections Indu Bhagat
2023-12-05 21:36 ` [[PATCH][GCC13] 2/2] toplevel: Makefile.def: add install-strip dependency on libsframe Indu Bhagat
2023-12-05 21:45 ` [[PATCH][GCC13] 0/2] Fix combined tree build of GCC 13 with Binutils 2.41 Jakub Jelinek
2023-12-05 23:39   ` Indu Bhagat

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).