ecpg、gms_*、pg_archivecleanup添加安全编译选项
This commit is contained in:
@ -176,7 +176,7 @@ else()
|
||||
endif()
|
||||
|
||||
# libraries need secure options during compling
|
||||
set(LIB_SECURE_OPTIONS -fPIC -fno-common -fstack-protector)
|
||||
set(LIB_SECURE_OPTIONS -fPIC -fno-common -fstack-protector-strong)
|
||||
# libraries need link options during linking
|
||||
set(LIB_LINK_OPTIONS -pthread -std=c++14 -Wl,-z,noexecstack -Wl,-z,relro,-z,now)
|
||||
if(NOT "${ENABLE_UT}" STREQUAL "ON")
|
||||
|
||||
@ -6,7 +6,7 @@ EXTENSION = gms_output
|
||||
DATA = gms_output--1.0.sql
|
||||
|
||||
exclude_option = -fPIE
|
||||
override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
override CPPFLAGS := -fstack-protector-strong $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
|
||||
REGRESS = gms_output
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ EXTENSION = gms_profiler
|
||||
DATA = gms_profiler--1.0.sql
|
||||
|
||||
exclude_option = -fPIE
|
||||
override CPPFLAGS := $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
override CPPFLAGS := -fstack-protector-strong $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
|
||||
REGRESS = gms_profiler
|
||||
|
||||
|
||||
@ -5,6 +5,9 @@ OBJS = gms_stats.o
|
||||
EXTENSION = gms_stats
|
||||
DATA = gms_stats--1.0.sql
|
||||
|
||||
exclude_option = -fPIE
|
||||
override CPPFLAGS := -fstack-protector-strong $(filter-out $(exclude_option),$(CPPFLAGS))
|
||||
|
||||
REGRESS = gms_stats
|
||||
|
||||
ifdef USE_PGXS
|
||||
|
||||
@ -14,5 +14,6 @@ else
|
||||
subdir = contrib/pg_archivecleanup
|
||||
top_builddir = ../..
|
||||
include $(top_builddir)/src/Makefile.global
|
||||
override LDFLAGS += -Wl,-z,relro,-z,now
|
||||
include $(top_srcdir)/contrib/contrib-global.mk
|
||||
endif
|
||||
|
||||
@ -22,8 +22,8 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
|
||||
-I$(libpq_srcdir) -I$(top_srcdir)/src/include/utils $(CPPFLAGS)
|
||||
override CFLAGS += $(PTHREAD_CFLAGS)
|
||||
|
||||
override CPPFLAGS := $(filter-out -fPIE, $(CPPFLAGS)) -fPIC
|
||||
override CFLAGS := $(filter-out -fPIE, $(CFLAGS)) -fPIC
|
||||
override CPPFLAGS := $(filter-out -fPIE, $(CPPFLAGS)) -fPIC -fstack-protector-strong
|
||||
override CFLAGS := $(filter-out -fPIE, $(CFLAGS)) -fPIC -fstack-protector-strong
|
||||
|
||||
SHLIB_LINK = -L../ecpglib -lecpg -L../pgtypeslib -lpgtypes $(libpq) \
|
||||
$(filter -lintl -lm, $(LIBS)) $(PTHREAD_LIBS)
|
||||
|
||||
@ -43,6 +43,7 @@ TOOLSDIR = $(top_srcdir)/src/tools
|
||||
GEN_KEYWORDLIST = $(PERL) -I $(TOOLSDIR) $(TOOLSDIR)/gen_keywordlist.pl
|
||||
GEN_KEYWORDLIST_DEPS = $(TOOLSDIR)/gen_keywordlist.pl $(TOOLSDIR)/PerfectHash.pm
|
||||
|
||||
override LDFLAGS += -Wl,-z,relro,-z,now
|
||||
|
||||
ifeq ($(GCC),yes)
|
||||
preproc.o: CXXFLAGS += -Wno-error
|
||||
|
||||
Reference in New Issue
Block a user