From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 223A8383800A for ; Sat, 1 May 2021 21:11:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 223A8383800A Received: by mail-pl1-x630.google.com with SMTP id y1so766244plg.11 for ; Sat, 01 May 2021 14:11:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kESRpwz0v8Ly1W3o9o2+v7LsdD4s3RqngKn+qoO4bCA=; b=O9vvvug7UAQ/oCMF5Jot5E/F8o0JPK0vhfLwt01nZE4YbHtqbbu3ONC4vw0YxiFV5O 1ky5W1tvRoDUv4R7dss5HmOElamzbcotoPn9I2e0815pXyfxQtSlrcG2BXFWpYQstZA/ zJuk50HBpdxqs2WuUuqCKWp4dsphjXXGrh6jmZaDQ5mOHXO0BdqiCEprglgEssk5tpWb ZWK64Wxo7jTVg10zaynydCvWLQRIC3ucItlMXNkSF7nfChEiZvY624msGZ6UXcpxj2yr hM3yzCPZ5OltW89QSCrxquAy6+Sx4n/DyZ06wpg2sBEOkQeszkHiV0MPbwGILwJ4EuE7 tGnA== X-Gm-Message-State: AOAM530x5Mt9iQBk4SmAevnTk8hHs17gECojFQ3pPU2khE3s/zIcDoRY H1BJbMVF7AYtgbCaOXcUYaIvHieHaDE= X-Google-Smtp-Source: ABdhPJzSIJW4KkMf72/5yyOPikdY5/fw4wnaEw+RIB5PcaKanxKolB5rXfopvhj2EvSNFZyZSX+4ew== X-Received: by 2002:a17:902:c943:b029:ee:8f40:6225 with SMTP id i3-20020a170902c943b02900ee8f406225mr12003295pla.52.1619903515922; Sat, 01 May 2021 14:11:55 -0700 (PDT) Received: from localhost (g17.222-224-135.ppp.wakwak.ne.jp. [222.224.135.17]) by smtp.gmail.com with ESMTPSA id l6sm5950241pgc.68.2021.05.01.14.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 14:11:55 -0700 (PDT) From: Stafford Horne To: GCC patches Cc: Richard Henderson , Openrisc , giulio.benetti@benettiengineering.com, Stafford Horne Subject: [PATCH v2 2/2] or1k: Use cmodel=large when building crtstuff Date: Sun, 2 May 2021 06:11:45 +0900 Message-Id: <20210501211145.2980164-3-shorne@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210501211145.2980164-1-shorne@gmail.com> References: <20210501211145.2980164-1-shorne@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 May 2021 21:11:58 -0000 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 99783 * config.host (or1k-*, tmake_file): Add or1k/t-crtstuff. * config/or1k/t-crtstuff: New file. --- libgcc/config.host | 4 ++-- libgcc/config/or1k/t-crtstuff | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 libgcc/config/or1k/t-crtstuff diff --git a/libgcc/config.host b/libgcc/config.host index f808b61be70..9e40d4560a3 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 -- 2.26.2