public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Stafford Horne <shorne@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-2910] or1k: Use cmodel=large when building crtstuff
Date: Sat, 14 Aug 2021 22:23:27 +0000 (GMT)	[thread overview]
Message-ID: <20210814222327.9DDA23888812@sourceware.org> (raw)

https://gcc.gnu.org/g:da8a9d695b3c4b9397b5d9a27660bfa48af8d707

commit r12-2910-gda8a9d695b3c4b9397b5d9a27660bfa48af8d707
Author: Stafford Horne <shorne@gmail.com>
Date:   Wed Apr 21 05:33:15 2021 +0900

    or1k: Use cmodel=large when building crtstuff
    
    When linking gcc runtime objects into large binaries the link may fail
    with the below errors.  This will happen even if we are building with
    -mcmodel=large.
    
        /home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `deregister_tm_clones':
        crtstuff.c:(.text+0x3c): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_deregisterTMCloneTable'
        /home/shorne/work/openrisc/output/host/lib/gcc/or1k-buildroot-linux-uclibc/10.3.0/crtbeginS.o: in function `register_tm_clones':
        crtstuff.c:(.text+0xc0): relocation truncated to fit: R_OR1K_GOT16 against undefined symbol `_ITM_registerTMCloneTable'
    
    This patch builds the gcc crtstuff binaries always with the
    -mcmodel=large option to ensure they can be linked into large binaries.
    
    libgcc/ChangeLog:
    
            PR target/99783
            * config.host (or1k-*, tmake_file): Add or1k/t-crtstuff.
            * config/or1k/t-crtstuff: New file.

Diff:
---
 libgcc/config.host            | 4 ++--
 libgcc/config/or1k/t-crtstuff | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libgcc/config.host b/libgcc/config.host
index 50f00062232..8ca7a00082a 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -1119,12 +1119,12 @@ nios2-*-*)
 	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 or1k-*-linux*)
-	tmake_file="$tmake_file or1k/t-or1k"
+	tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp"
 	md_unwind_header=or1k/linux-unwind.h
 	;;
 or1k-*-*)
-	tmake_file="$tmake_file or1k/t-or1k"
+	tmake_file="$tmake_file or1k/t-or1k or1k/t-crtstuff"
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp"
 	;;
 pdp11-*-*)
diff --git a/libgcc/config/or1k/t-crtstuff b/libgcc/config/or1k/t-crtstuff
new file mode 100644
index 00000000000..dcae7f3498e
--- /dev/null
+++ b/libgcc/config/or1k/t-crtstuff
@@ -0,0 +1,2 @@
+# Compile crtbeginS.o and crtendS.o with -mcmodel=large
+CRTSTUFF_T_CFLAGS_S += -mcmodel=large


                 reply	other threads:[~2021-08-14 22:23 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210814222327.9DDA23888812@sourceware.org \
    --to=shorne@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /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).