ffbuild: Avoid using the --preprocessor argument to windres

Instead use --preprocessor-arg; in binutils 2.36, the --preprocessor
flag was changed so that it no longer accepts a string containing
multiple arguments, but the whole --preprocessor argument is
treated as the path to the preprocessor executable (where the path
can contain spaces).

It's currently unclear whether this behaviour will stay or if it
is going to be reverted in the future, see discussion at [1]. Just
to be safe, avoid using the --preprocessor argument. Don't redeclare
the full preprocessing command, but just add the $(CC_DEPFLAGS) options.

Based on a patch by Kyle Schwartz.

[1] https://sourceware.org/bugzilla/show_bug.cgi?id=27594

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2021-05-15 00:42:38 +03:00 committed by Leo Izen
parent 970ca1e0f2
commit 4767a711c1
No known key found for this signature in database
GPG key ID: 764E48EA48221833
2 changed files with 1 additions and 2 deletions

1
configure vendored
View file

@ -6917,7 +6917,6 @@ LD_LIB=$LD_LIB
LD_PATH=$LD_PATH LD_PATH=$LD_PATH
DLLTOOL=$dlltool DLLTOOL=$dlltool
WINDRES=$windres WINDRES=$windres
DEPWINDRES=$dep_cc
DOXYGEN=$doxygen DOXYGEN=$doxygen
LDFLAGS=$LDFLAGS LDFLAGS=$LDFLAGS
LDEXEFLAGS=$LDEXEFLAGS LDEXEFLAGS=$LDEXEFLAGS

View file

@ -83,7 +83,7 @@ COMPILE_NVCC = $(call COMPILE,NVCC)
-$(if $(ASMSTRIPFLAGS), $(STRIP) $(ASMSTRIPFLAGS) $@) -$(if $(ASMSTRIPFLAGS), $(STRIP) $(ASMSTRIPFLAGS) $@)
%.o: %.rc %.o: %.rc
$(WINDRES) $(IFLAGS) --preprocessor "$(DEPWINDRES) -E -xc-header -DRC_INVOKED $(CC_DEPFLAGS)" -o $@ $< $(WINDRES) $(IFLAGS) $(foreach ARG,$(CC_DEPFLAGS),--preprocessor-arg "$(ARG)") -o $@ $<
%.i: %.c %.i: %.c
$(CC) $(CCFLAGS) $(CC_E) $< $(CC) $(CCFLAGS) $(CC_E) $<