Changing the location of the pie compile option 49/302449/1 accepted/tizen_base_riscv accepted/tizen/base/20231212.123123 accepted/tizen/base/asan/20240422.015121 accepted/tizen/base/riscv/20231215.051825 accepted/tizen/base/toolchain/20240124.003922
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 7 Dec 2023 01:51:44 +0000 (10:51 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 7 Dec 2023 01:51:44 +0000 (10:51 +0900)
Change-Id: I2152e936c9ae68f8c17569706672714f71eb6ab4

packaging/Add-pie-compile-option.patch
packaging/ncurses.spec

index da24f6b..73697eb 100644 (file)
@@ -1,35 +1,27 @@
-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@
 
index 2ae7b87..a64542d 100644 (file)
@@ -33,6 +33,7 @@ Source4:        ncurses-rpmlintrc
 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
@@ -192,6 +193,7 @@ rm -vf include/ncurses_dll.h
 rm -vf mkdirs.sh
 rm -vf tar-copy.sh
 rm -vf mk-dlls.sh
+%{__patch} -p1 < %{SOURCE9}
 
 %build
     cflags ()
@@ -230,7 +232,7 @@ rm -vf mk-dlls.sh
     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