Revert "rts: Drop redundant flags for libffi"
authorBen Gamari <ben@smart-cactus.org>
Tue, 10 Dec 2019 21:07:37 +0000 (16:07 -0500)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Thu, 12 Dec 2019 07:27:34 +0000 (02:27 -0500)
This seems to have regressed builds using `--with-system-libffi`
(#17520).

This reverts commit 3ce18700f80a12c48a029b49c6201ad2410071bb.

rts/ghc.mk

index dfff8df..451b191 100644 (file)
@@ -489,10 +489,15 @@ endif
 endif
 
 # add CFLAGS for libffi
+ifeq "$(UseSystemLibFFI)" "YES"
+LIBFFI_CFLAGS = $(addprefix -I,$(FFIIncludeDir))
+else
+LIBFFI_CFLAGS =
+endif
 # ffi.h triggers prototype warnings, so disable them here:
-rts/Interpreter_CC_OPTS += -Wno-strict-prototypes
-rts/Adjustor_CC_OPTS    += -Wno-strict-prototypes
-rts/sm/Storage_CC_OPTS  += -Wno-strict-prototypes
+rts/Interpreter_CC_OPTS += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
+rts/Adjustor_CC_OPTS    += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
+rts/sm/Storage_CC_OPTS  += -Wno-strict-prototypes $(LIBFFI_CFLAGS)
 # ffi.h triggers undefined macro warnings on PowerPC, disable those:
 # this matches substrings of powerpc64le, including "powerpc" and "powerpc64"
 ifneq "$(findstring $(TargetArch_CPP), powerpc64le)" ""