From 5d642ca0991a12b83e95c13f552fdb8bb5fe983d Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Fri, 4 Jun 2021 14:11:28 +0900 Subject: [PATCH] Apply PIE to nghttpx Change-Id: Ida76ec04578453a0b8204c4f78a16202c3c702f5 Signed-off-by: Cheoleun Moon --- src/Makefile.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 0382164..f32d46e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,7 +31,7 @@ bin_PROGRAMS = check_PROGRAMS = TESTS = -AM_CFLAGS = $(WARNCFLAGS) +AM_CFLAGS = $(WARNCFLAGS) -fPIE AM_CXXFLAGS = $(WARNCXXFLAGS) $(CXX1XCXXFLAGS) AM_CPPFLAGS = \ -DPKGDATADIR='"$(pkgdatadir)"' \ @@ -47,7 +47,8 @@ AM_CPPFLAGS = \ @LIBCARES_CFLAGS@ \ @JANSSON_CFLAGS@ \ @ZLIB_CFLAGS@ \ - @DEFS@ + @DEFS@ \ + -fPIE LDADD = $(top_builddir)/lib/libnghttp2.la \ $(top_builddir)/third-party/liburl-parser.la \ @@ -160,6 +161,7 @@ libnghttpx_a_CPPFLAGS = ${AM_CPPFLAGS} nghttpx_SOURCES = shrpx.cc shrpx.h nghttpx_CPPFLAGS = ${libnghttpx_a_CPPFLAGS} nghttpx_LDADD = libnghttpx.a ${LDADD} +nghttpx_LDFLAGS = -pie if HAVE_MRUBY libnghttpx_a_CPPFLAGS += \ @@ -261,8 +263,8 @@ libnghttp2_asio_la_SOURCES = \ asio_client_stream.cc asio_client_stream.h \ asio_client_tls_context.cc asio_client_tls_context.h -libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS} -libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0 +libnghttp2_asio_la_CPPFLAGS = ${AM_CPPFLAGS} ${BOOST_CPPFLAGS} -fPIE +libnghttp2_asio_la_LDFLAGS = -no-undefined -version-info 1:0:0 -pie libnghttp2_asio_la_LIBADD = \ $(top_builddir)/lib/libnghttp2.la \ $(top_builddir)/third-party/liburl-parser.la \ -- 2.7.4