소스 검색

[makefile] Fix -fno-stack-protector test on older versions of gcc

Some older versions of gcc don't complain about unknown compiler flags
unless you ask them to actually compile; asking them to merely
preprocess won't trigger the error.

Fix the -fno-stack-protector test by making it attempt to compile an
empty file, rather than preprocess an empty file.
tags/v0.9.6
Michael Brown 15 년 전
부모
커밋
91802c6e85
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    1
      src/Makefile.housekeeping

+ 2
- 1
src/Makefile.housekeeping 파일 보기

@@ -112,7 +112,8 @@ oldgas :
112 112
 # default, even when -ffreestanding is specified.  We therefore need
113 113
 # to disable -fstack-protector if the compiler supports it.
114 114
 #
115
-SP_TEST = $(CC) -fno-stack-protector -x c -E - < /dev/null >/dev/null 2>&1
115
+SP_TEST = $(CC) -fno-stack-protector -x c -c /dev/null \
116
+		-o /dev/null >/dev/null 2>&1
116 117
 SP_FLAGS := $(shell $(SP_TEST) && $(ECHO) '-fno-stack-protector')
117 118
 CFLAGS	+= $(SP_FLAGS)
118 119
 

Loading…
취소
저장