From patchwork Mon Dec 4 07:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 81252 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E76EB3857B9D for ; Mon, 4 Dec 2023 07:03:20 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 4CC573858C78 for ; Mon, 4 Dec 2023 07:03:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4CC573858C78 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4CC573858C78 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:ea4a:1:5054:ff:fec7:86e4 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701673391; cv=none; b=j7auTSfAV+icJZxafBWWL5GUP6C5wazgxFtrN0A2/8mimQ/0ihXOZym06pBXvwBSqqqha2bk0nfWC0CRfP7U+DXstwg2+T9jPVc3W5GG7gC/WsYhmZMNaJOCVyW2vrYAPMem8+Hg18Xv6KUPZNq2ZuNU9esU3RLD7hr1B7THAkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701673391; c=relaxed/simple; bh=3i1qSubFJvuiImhQ5Iy3MSKhyP2kiM5MX6BzNltjlXU=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=KJpzl+f2RRV4KlLUQ0W0PmGg/wMAFz1yczPYw4mRt06eMzhxrNj6WbRjJsNULbjM2Ge2cS/Wzxq2MbtQLA4GoPO7A3HPmvMmqCzfkDvrzavAmHGxBKMCDFDf9rQp2zXbfeygNzkp8genzeSntlQJkhPCdFbapXrGDidl9dDP3jo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id BB529335D6D; Mon, 4 Dec 2023 07:03:09 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH 1/2] Revert "Fix libgloss/newlib build to conditionally use top include dir" Date: Mon, 4 Dec 2023 02:03:06 -0500 Message-ID: <20231204070307.21360-1-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces+patchwork=sourceware.org@sourceware.org This reverts commit 17ac400c11bab30ac2c0bef12cbf7788f0b6f954. The build failures were due to incorrectly using $(INCLUDES) when running $(AS). Let's roll this back and drop $(INCLUDES) from the $(AS) invocations. --- libgloss/Makefile.am | 4 ---- libgloss/Makefile.in | 3 +-- libgloss/config/arm.mh | 34 ---------------------------------- libgloss/config/default.mh | 2 +- libgloss/configure | 16 ---------------- libgloss/configure.ac | 4 ---- newlib/Makefile.am | 4 ---- newlib/Makefile.in | 4 +--- 8 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 libgloss/config/arm.mh diff --git a/libgloss/Makefile.am b/libgloss/Makefile.am index f440ad23a1a6..0d4460b5801e 100644 --- a/libgloss/Makefile.am +++ b/libgloss/Makefile.am @@ -24,11 +24,7 @@ includetool_DATA = includesystooldir = $(tooldir)/include/sys includesystool_DATA = -if NEED_TOP_INCLUDE_DIR AM_CPPFLAGS = -idirafter $(srcroot)/include -else -AM_CPPFLAGS = -endif # A fake library so automake will generate rules for plain objects that we want # to install (e.g. our crt0.o objects). diff --git a/libgloss/config/arm.mh b/libgloss/config/arm.mh deleted file mode 100644 index 81f0920f97a8..000000000000 --- a/libgloss/config/arm.mh +++ /dev/null @@ -1,34 +0,0 @@ -NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi` -NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi` - -INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/.. -idirafter $(srcroot)/include -# Note that when building the library, ${MULTILIB} is not the way multilib -# options are passed; they're passed in $(CFLAGS). -CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS} -LDFLAGS_FOR_TARGET = ${MULTILIB} ${NEWLIB_LDFLAGS} -AR_FLAGS = rc - -.c.o: - $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< - -.C.o: - $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< -.s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< - -# -# GCC knows to run the preprocessor on .S files before it assembles them. -# -.S.o: - $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) $(CFLAGS) -c $< - -# -# this is a bogus target that'll produce an assembler from the -# C source with the right compiler options. this is so we can -# track down code generation or debug symbol bugs. -# -.c.s: - $(CC) $(CFLAGS_FOR_TARGET) -S $(INCLUDES) $(CFLAGS) $< - -# We don't build docs in subdirs, so stub out the rules. -.PHONY: doc docs dvi html install-html info install-info clean-info pdf install-pdf diff --git a/libgloss/config/default.mh b/libgloss/config/default.mh index 4e7f106f9366..81f0920f97a8 100644 --- a/libgloss/config/default.mh +++ b/libgloss/config/default.mh @@ -1,7 +1,7 @@ NEWLIB_CFLAGS = `if [ -d ${objroot}/newlib ]; then echo -I${objroot}/newlib/targ-include -I${srcroot}/newlib/libc/include; fi` NEWLIB_LDFLAGS = `if [ -d ${objroot}/newlib ]; then echo -B${objroot}/newlib/ -L${objroot}/newlib/; fi` -INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/.. +INCLUDES = -I. -I$(srcdir)/.. -I$(objdir)/.. -idirafter $(srcroot)/include # Note that when building the library, ${MULTILIB} is not the way multilib # options are passed; they're passed in $(CFLAGS). CFLAGS_FOR_TARGET = -O2 -g ${MULTILIB} ${INCLUDES} ${NEWLIB_CFLAGS} diff --git a/libgloss/configure.ac b/libgloss/configure.ac index 47854eab3170..19bdf9b3a6b9 100644 --- a/libgloss/configure.ac +++ b/libgloss/configure.ac @@ -217,7 +217,6 @@ case "${target}" in ;; arm*-*-elf | arm*-*-coff | arm*-*-*) config_arm=true - host_makefile_frag=${srcdir}/config/arm.mh ;; spu-*-elf) AC_CONFIG_FILES([spu/Makefile]) @@ -256,9 +255,6 @@ m4_foreach_w([SUBDIR], [ AM_CONDITIONAL([CONFIG_]m4_toupper(SUBDIR), [test x$config_]SUBDIR = xtrue) ]) -dnl arm platforms have a special header file found in the main include directory -AM_CONDITIONAL([NEED_TOP_INCLUDE_DIR], [[test x$config_arm] = xtrue]) - dnl For now, don't bother configuring testsuite dnl dnl if test "${config_testsuite}" = "true"; diff --git a/newlib/Makefile.am b/newlib/Makefile.am index 47f0be288093..4ab36b8d841c 100644 --- a/newlib/Makefile.am +++ b/newlib/Makefile.am @@ -70,11 +70,7 @@ toollibdir = $(tooldir)/lib$(MULTISUBDIR) # These are useful for standalone object files like crt0.o. AM_CFLAGS = $(AM_CFLAGS_$(subst /,_,$(@D))) $(AM_CFLAGS_$(subst /,_,$(@D)_$( X-Patchwork-Id: 81253 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3C1DE3857B88 for ; Mon, 4 Dec 2023 07:03:23 +0000 (GMT) X-Original-To: newlib@sourceware.org Delivered-To: newlib@sourceware.org Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) by sourceware.org (Postfix) with ESMTP id C35A93858C35 for ; Mon, 4 Dec 2023 07:03:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C35A93858C35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gentoo.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C35A93858C35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701673394; cv=none; b=hmE1zojOChYVdKcF07WGj1z9ZdnhJ70i2tWvjRhMSVV5/MMfR2HOyd5GXHlpVNdwSicrp6mdAqZ3CRbFfIqoakB1AYD8B8XPTwQ3Qv/o/QMNFAxv3onNd/3zVAgKFciLOMVVg///AbcIEnQQX3OBDqB4H/MHtqPKaxB3N5cPKe4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701673394; c=relaxed/simple; bh=dcHZKqSJVRPySRH5D4efBqbITbOzO40DYT430Wb6vwg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=KAJRkdwSOP6YPYadl5u7mEfzNugdK+vG5NDvikK/bI6TdMegprafvlWWK4Ndghm16YWRXTH86Mkbsl/vVP8UWC+8bv3tQCxMIA8btRj5dBKcpiMZuDoDj/WlDcIUOsQNSK5jbuahMdLzagsv9M7sDv1I6+llaBAzOX/exbsVF3M= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by smtp.gentoo.org (Postfix, from userid 559) id 14F84335D6D; Mon, 4 Dec 2023 07:03:12 +0000 (UTC) From: Mike Frysinger To: newlib@sourceware.org Subject: [PATCH 2/2] libgloss: drop $(INCLUDES) when using $(AS) Date: Mon, 4 Dec 2023 02:03:07 -0500 Message-ID: <20231204070307.21360-2-vapier@gentoo.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231204070307.21360-1-vapier@gentoo.org> References: <20231204070307.21360-1-vapier@gentoo.org> MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: newlib-bounces+patchwork=sourceware.org@sourceware.org Since $(AS) is the assembler, passing it a list of preprocessor include flags doesn't make much sense. The files aren't preprocessed which means `#include` lines aren't respected, and while it would affect `.include` usage, we never use that, and it's extremely unlikely to change. Plus, it's extremely unlikely we'd have .s files in common places to include vs contained entirely within a specific arch dir, and at that point, it can be included directly (with no flags), or the arch can add the unique set of include paths that it needs for itself. --- libgloss/config/default.mh | 2 +- libgloss/config/ppc.mh | 2 +- libgloss/epiphany/Makefile.in | 2 +- libgloss/hp74x/Makefile.in | 2 +- libgloss/pru/Makefile.in | 2 +- libgloss/spu/Makefile.in | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libgloss/config/default.mh b/libgloss/config/default.mh index 81f0920f97a8..64dc02f05c64 100644 --- a/libgloss/config/default.mh +++ b/libgloss/config/default.mh @@ -14,7 +14,7 @@ AR_FLAGS = rc .C.o: $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< .s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< + $(AS) $(ASFLAGS_FOR_TARGET) $(ASFLAGS) -o $*.o $< # # GCC knows to run the preprocessor on .S files before it assembles them. diff --git a/libgloss/config/ppc.mh b/libgloss/config/ppc.mh index a3d157bb8fd7..d1bfd7588e55 100644 --- a/libgloss/config/ppc.mh +++ b/libgloss/config/ppc.mh @@ -18,7 +18,7 @@ AR_FLAGS = qc .C.o: $(CC) $(CFLAGS_FOR_TARGET) $(CFLAGS_MRELOCATABLE) -O2 $(INCLUDES) -c $(CFLAGS) $< .s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< + $(AS) $(ASFLAGS_FOR_TARGET) $(ASFLAGS) -o $*.o $< # # GCC knows to run the preprocessor on .S files before it assembles them. diff --git a/libgloss/epiphany/Makefile.in b/libgloss/epiphany/Makefile.in index 6cf55e25e69e..6670b79a08f1 100644 --- a/libgloss/epiphany/Makefile.in +++ b/libgloss/epiphany/Makefile.in @@ -105,7 +105,7 @@ AR_FLAGS = qc .S.o: $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $(CFLAGS) $< .s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< + $(AS) $(ASFLAGS_FOR_TARGET) $(ASFLAGS) -o $*.o $< # # GCC knows to run the preprocessor on .S files before it assembles them. diff --git a/libgloss/hp74x/Makefile.in b/libgloss/hp74x/Makefile.in index 12c51bf3bee7..0167e1c62ee3 100644 --- a/libgloss/hp74x/Makefile.in +++ b/libgloss/hp74x/Makefile.in @@ -117,7 +117,7 @@ install: .s.o: $(CC) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< -# $(AS) $(CFLAGS_FOR_TARGET) $(INCLUDES) -c $< +# $(AS) $(CFLAGS_FOR_TARGET) -c $< .SUFFIXES: .S .c .o .s .lif # diff --git a/libgloss/pru/Makefile.in b/libgloss/pru/Makefile.in index 7a2f290a827c..fc5905a5eaf4 100644 --- a/libgloss/pru/Makefile.in +++ b/libgloss/pru/Makefile.in @@ -89,7 +89,7 @@ LDFLAGS_FOR_TARGET = ${MULTILIB} .C.o: $(CC) $(CFLAGS_FOR_TARGET) -Os $(INCLUDES) -c $(CFLAGS) $< .s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< + $(AS) $(ASFLAGS_FOR_TARGET) $(ASFLAGS) -o $*.o $< # # GCC knows to run the preprocessor on .S files before it assembles them. diff --git a/libgloss/spu/Makefile.in b/libgloss/spu/Makefile.in index bc8768baf183..4be0783b9873 100644 --- a/libgloss/spu/Makefile.in +++ b/libgloss/spu/Makefile.in @@ -95,7 +95,7 @@ AR_FLAGS = qc .C.o: $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $< .s.o: - $(AS) $(ASFLAGS_FOR_TARGET) $(INCLUDES) $(ASFLAGS) -o $*.o $< + $(AS) $(ASFLAGS_FOR_TARGET) $(ASFLAGS) -o $*.o $< # # GCC knows to run the preprocessor on .S files before it assembles them.