From patchwork Sat Dec 14 08:15:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Edlinger X-Patchwork-Id: 36871 Received: (qmail 84934 invoked by alias); 14 Dec 2019 08:15:44 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 84923 invoked by uid 89); 14 Dec 2019 08:15:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.4 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=H*c:HHH X-HELO: EUR01-VE1-obe.outbound.protection.outlook.com Received: from mail-oln040092066092.outbound.protection.outlook.com (HELO EUR01-VE1-obe.outbound.protection.outlook.com) (40.92.66.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Dec 2019 08:15:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fehx2wOI6GZAYBt82piWu9yH9YsPb8ubUZEFsSn/UMMphY6c13tnJInSeJWIx2ySeRbO6qIeqVP1SiO3h397vuV57wzBUasc7k/niVRnzP0MJGBR4lHMtEomy3ZaQU1tSyB8LAUeKL28qlD8qavaaXQ3I3sJUtNBhVSl9U408bS2a6yhDiCt6578CWk5sSLXQ9rOH7gA4nPY5SphdBPjxhslhLoIMPaH5Atd7NKV4IqaJkoZydEpQ76TruPlV7b5PAUrdDZ0io5pbQuQU6KEH1sY5IXQ/DzBHnzWz+koTTbZKgsonKCuH6jyEBmsrVN4CbpPlOocogo5leBTtD9yJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LGp3n0sZdhWJ6RbpbMg8aXIPlQNr8IdYQUEYs2pJGyk=; b=VaFV48zzVzmxgx6CeICZE7N6K/pXaj1rzmJ+nyJeesft+8zAPV9EnTZXu0Xwq8AUizwlQz+o5DFnG9NodJ9RT7LU3UBjPFHqqw+i4BUgLBwwkyu7pQ5R68Wn7yTy5IhetflrXJzHoY+iE+H27bzhCJk0dYCKsseZE3aJigakVJCjyJ/CSEoEvTjNKIxb9VKLip2C8MZKbeJtA8dKsRZ2YDKzBObIZLqqhXskzH8NsYFVo/VH2b6fCqJeM8fXpJRPAiypDDuk+UqVOg43/grrlr82afUQANqXU8/Qq1kiHBxnIzSmvAvfk4RK493P0Lh9+xGNaVRvM2TJRwmCT7qF+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VE1EUR01FT031.eop-EUR01.prod.protection.outlook.com (10.152.2.51) by VE1EUR01HT160.eop-EUR01.prod.protection.outlook.com (10.152.3.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14; Sat, 14 Dec 2019 08:15:39 +0000 Received: from AM0PR08MB3714.eurprd08.prod.outlook.com (10.152.2.57) by VE1EUR01FT031.mail.protection.outlook.com (10.152.2.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.14 via Frontend Transport; Sat, 14 Dec 2019 08:15:39 +0000 Received: from AM0PR08MB3714.eurprd08.prod.outlook.com ([fe80::8dd1:fb18:6271:f769]) by AM0PR08MB3714.eurprd08.prod.outlook.com ([fe80::8dd1:fb18:6271:f769%7]) with mapi id 15.20.2538.019; Sat, 14 Dec 2019 08:15:39 +0000 From: Bernd Edlinger To: "gdb-patches@sourceware.org" Subject: [PATCH] Fix build with GNU Make 3.81 Date: Sat, 14 Dec 2019 08:15:38 +0000 Message-ID: x-microsoft-original-message-id: <98bbee3a-670f-c260-6f63-4f7b0e6ea46a@hotmail.de> x-ms-exchange-transport-forked: True MIME-Version: 1.0 Hi, I have a minor problem with building the gdbserver, alloc-ipa.o on ubuntu 14.04 which still uses GNU Make 3.81. Since several quirks for this GNU Make version exist, I suppose this version is still intended to be supported. This patch fixes the build with this make version, and works also for newer versions. Thanks Bernd. gdb/gdbserver: 2019-12-14 Bernd Edlinger * Makefile.in: Fix build with GNU Make 3.81 From 324a036bd552186baa9ea16d7ac0072d74220f35 Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Fri, 13 Dec 2019 17:21:21 +0100 Subject: [PATCH] Fix build with GNU Make 3.81 GNU Make 3.81 is apparently confused when the same source file is processed by a pattern rule and an explicit rule at the same time with different output file. The pattern %.o: ../%.c and alloc-ipa.o: ../alloc.c both have the source ../alloc.c but two independent object files alloc.o and alloc-ipa.o, so while building gdbserver I see the following message: make[4]: Circular alloc-ipa.o <- ../alloc.c dependency dropped. CXX alloc-ipa.o g++: warning: '-x c++' after last input file has no effect g++: fatal error: no input files compilation terminated. In the make debug output I see the pattern is first correct: alloc-ipa.o: ../alloc.c | config.h build-gnulib-gdbserver/import/string.h $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) But after the "Circular" dependency is dropped, the pattern is changed to: alloc-ipa.o: | config.h build-gnulib-gdbserver/import/string.h $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) So indeed now $< is empty, and the build step fails. This happens only when alloc.o needs to be built, when alloc.o was already built, the build succeeds, but it takes often several attempts until the build succeeds. By rewriting the alloc-ipa.c: ../alloc.c rule into a pattern rule, the problem goes away. While already at it, this patch removes also the $(WARN_CFLAGS_NO_FORMAT) from the build rule, which is just a copy/paste thing that is not necessary for alloc.c at all. --- gdb/gdbserver/Makefile.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in index 10e0040..9e8c213 100644 --- a/gdb/gdbserver/Makefile.in +++ b/gdb/gdbserver/Makefile.in @@ -580,10 +580,6 @@ ax.o: ax.c $(COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< $(POSTCOMPILE) -alloc-ipa.o: ../alloc.c - $(IPAGENT_COMPILE) $(WARN_CFLAGS_NO_FORMAT) $< - $(POSTCOMPILE) - # Rules for objects that go in the in-process agent. arch/%-ipa.o: ../arch/%.c @@ -602,6 +598,10 @@ gdbsupport/%-ipa.o: ../gdbsupport/%.c $(IPAGENT_COMPILE) $< $(POSTCOMPILE) +%-ipa.o: ../%.c + $(IPAGENT_COMPILE) $< + $(POSTCOMPILE) + # Note: Between two matching pattern rules, GNU Make 3.81 chooses the first one. # Therefore, this one needs to be before "%.o: %.c" for it to be considered for # files such as linux-amd64-ipa.o generated from linux-amd64-ipa.c. -- 1.9.1