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