-From dc26b7012b4d613102cd104c8e7db17af3d15848 Mon Sep 17 00:00:00 2001
-From: DongHun Kwak <dh0128.kwak@samsung.com>
-Date: Tue, 10 Dec 2019 11:22:38 +0900
-Subject: [PATCH] Add pie compile option
-
-Change-Id: If2e0856decebed8f78714b906d59aea2dd864d67
----
- progs/Makefile.in | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
diff --git a/progs/Makefile.in b/progs/Makefile.in
-index b55057d..7503b4a 100644
+index 79cbc99..50233f9 100644
--- a/progs/Makefile.in
+++ b/progs/Makefile.in
-@@ -89,7 +89,7 @@ ETAGS = @ETAGS@
-
- CC = @CC@
- CPP = @CPP@
--CFLAGS = @CFLAGS@
-+CFLAGS = @CFLAGS@ -fPIC
-
+@@ -95,7 +95,7 @@ CFLAGS = @CFLAGS@
INCDIR = $(top_srcdir)/include
CPPFLAGS = -DHAVE_CONFIG_H -I../progs @CPPFLAGS@
-@@ -110,7 +110,7 @@ LOCAL_LIBDIR = @top_builddir@/lib
-
- LD = @LD@
- LINK = @LINK_PROGS@ $(LIBTOOL_LINK)
--LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@
-+LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@ -pie
- RPATH_LIST = @RPATH_LIST@
-
- LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL)
---
-2.7.4
+
+-CCFLAGS = $(CPPFLAGS) $(CFLAGS)
++CCFLAGS = $(CPPFLAGS) $(CFLAGS) -fPIC
+
+ CFLAGS_LIBTOOL = $(CCFLAGS)
+ CFLAGS_NORMAL = $(CCFLAGS)
+@@ -123,10 +123,10 @@ LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@
+ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@)
+
+ LIBS_TIC = @TINFO_LDFLAGS@ @LDFLAGS_STATIC@ @TICS_LIBS@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
+-LDFLAGS_TIC = @TICS_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TIC)
++LDFLAGS_TIC = @TICS_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TIC) -pie
+
+ LIBS_TINFO = @LDFLAGS_STATIC@ @TINFO_LIBS@ @LDFLAGS_SHARED@ @LD_MODEL@ @LIBS@
+-LDFLAGS_TINFO = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO)
++LDFLAGS_TINFO = @TINFO_LDFLAGS@ $(LDFLAGS_@DFT_UPR_MODEL@) $(LIBS_TINFO) -pie
+
+ LINT = @LINT@
+ LINT_OPTS = @LINT_OPTS@
Source6: edit.sed
Source7: baselibs.conf
Source8: terminfo_mini.src
+Source9: Add-pie-compile-option.patch
Source1001: ncurses.manifest
%global _sysconfdir /etc
%global _miscdir %{_datadir}/misc
rm -vf mkdirs.sh
rm -vf tar-copy.sh
rm -vf mk-dlls.sh
+%{__patch} -p1 < %{SOURCE9}
%build
cflags ()
if [[ "$BUILD_BASENAME" = debug-* ]] ; then
CFLAGS="${CFLAGS} -g -DTRACE"
fi
- LDFLAGS="${LDFLAGS} -pie "
+ LDFLAGS="${LDFLAGS} "
cflags -Wl,-O2 LDFLAGS
cflags -Wl,-Bsymbolic-functions LDFLAGS
cflags -Wl,--hash-size=8599 LDFLAGS