public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
Cc: Jeff Johnston <jjohnstn@redhat.com>,
	Jeff Law <jeffreyalaw@gmail.com>,
	newlib@sourceware.org
Subject: Re: Various libgloss problems after recent changes
Date: Mon, 4 Dec 2023 01:49:44 -0500	[thread overview]
Message-ID: <ZW12iF-s_Wys3DXh@vapier> (raw)
In-Reply-To: <b808342f-4cc9-8eae-f1ad-423fdfd130f9@foss.arm.com>

[-- Attachment #1: Type: text/plain, Size: 2144 bytes --]

On 10 Feb 2023 11:21, Richard Earnshaw wrote:
> On 09/02/2023 22:54, Jeff Johnston wrote:
> > On Sun, Feb 5, 2023 at 7:48 PM Jeff Law <jeffreyalaw@gmail.com> wrote:
> >> The fr30-elf and xstormy16-elf ports have been failing to build for
> >> about a month with this error:
> >>
> >>    > fr30-elf-as  -I. -I../../../../..//newlib-cygwin/libgloss/fr30/..
> >> -I./.. -idirafter
> >> ../../../../..//newlib-cygwin/libgloss/fr30/../../include  -o crt0.o
> >> ../../../../..//newlib-cygwin/libgloss/fr30/crt0.s
> >>> fr30-elf-as: unrecognized option '-idirafter'
> 
> I'm slightly confused.  Why would some ports have -idirafter and some 
> not, unless they're not using GCC (or a very old one).
> 
> So wouldn't a autoconf test for -idirafter be a better approach rather 
> than hard-coding it.
> 
> Note that if it's due to the option not being supported in old versions 
> of gcc, then that's a bigger problem because the reason the option was 
> added in the first place (IIRC) was to support moving arm-acle-compat.h 
> out of the newlib subdir so it could be used with libgloss.  And 
> arm-acle-compat.h is there to support older versions of GCC.

the problem isn't gcc age, it's that $CPPFLAGS is being used with $AS,
and that's never correct.  filtering the flags for some ports hides the
issue by default ... if people set CPPFLAGS to include something else,
it will continue to fail.

really all $AS usage should switch to $CCAS which will compile .s files
with the compiler driver (i.e. `gcc`) which respects $CPPFLAGS.

a short term fix is prob to stop using $(INCLUDES) in the .s.o rule.  i
can't see how this was ever useful tbh.  we don't use `.include` in any
of the .s files, and `#include` doesn't work.
-mike

--- 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2023-12-04  6:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-06  0:48 Jeff Law
2023-02-09 22:54 ` Jeff Johnston
2023-02-10 11:21   ` Richard Earnshaw
2023-02-10 16:54     ` Jeff Law
2023-02-21 21:39       ` Jeff Johnston
2023-02-22  7:16         ` Jeff Law
2023-02-22 16:20           ` Jeff Johnston
2023-02-22 16:40             ` Jeff Law
2023-02-22 17:54             ` Jeff Law
2023-02-22 18:06               ` Jeff Johnston
2023-02-10 17:16     ` Jeff Johnston
2023-12-04  6:49     ` Mike Frysinger [this message]
2023-02-10 16:52   ` Jeff Law
2023-12-04  7:03 ` [PATCH 1/2] Revert "Fix libgloss/newlib build to conditionally use top include dir" Mike Frysinger
2023-12-04  7:03   ` [PATCH 2/2] libgloss: drop $(INCLUDES) when using $(AS) Mike Frysinger

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=ZW12iF-s_Wys3DXh@vapier \
    --to=vapier@gentoo.org \
    --cc=Richard.Earnshaw@foss.arm.com \
    --cc=jeffreyalaw@gmail.com \
    --cc=jjohnstn@redhat.com \
    --cc=newlib@sourceware.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).