From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1033) id 89E0E3857419; Tue, 6 Jul 2021 19:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 89E0E3857419 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: David Edelsohn To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8692] aix: collect2 text files in archive X-Act-Checkin: gcc X-Git-Author: David Edelsohn X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: cd9fa61d5c89faa8c41ef002b859146df496b1c5 X-Git-Newrev: aa9834c93e25f7d9da2d705bfe6abb271437c74f Message-Id: <20210706191257.89E0E3857419@sourceware.org> Date: Tue, 6 Jul 2021 19:12:57 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2021 19:12:57 -0000 https://gcc.gnu.org/g:aa9834c93e25f7d9da2d705bfe6abb271437c74f commit r11-8692-gaa9834c93e25f7d9da2d705bfe6abb271437c74f Author: David Edelsohn Date: Thu May 20 14:07:18 2021 -0400 aix: collect2 text files in archive Rust places text files in archives. AIX ld ignores such files with a warning. The collect2 wrapper for ld had been exiting with a fatal error if it scanned an archive that contained a non-COFF file. This patch updates collect2.c to issue a warning and ignore the file member, matching the behavior of AIX ld. GCC can encounter archives created by Rust and should not issue a fatal error. This changes fatal_error to warning, with an implicit location and no associated optimization flag. gcc/ChangeLog: 2021-05-20 Clement Chigot David Edelsohn * collect2.c (scan_prog_file): Issue non-fatal warning for non-COFF files. (cherry picked from commit 5a3bf28119c7a8d2d43d26b5eee588ee0e4472e5) Diff: --- gcc/collect2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/collect2.c b/gcc/collect2.c index bd371430ab7..0c8af29879d 100644 --- a/gcc/collect2.c +++ b/gcc/collect2.c @@ -2783,7 +2783,10 @@ scan_prog_file (const char *prog_name, scanpass which_pass, if ((ldptr = ldopen (CONST_CAST (char *, prog_name), ldptr)) != NULL) { if (! MY_ISCOFF (HEADER (ldptr).f_magic)) - fatal_error (input_location, "%s: not a COFF file", prog_name); + { + warning (0, "%s: not a COFF file", prog_name); + continue; + } if (GCC_CHECK_HDR (ldptr)) {