From 9bf6398978e7a986c4005f4c1dedf3b5e1ea39da Mon Sep 17 00:00:00 2001 From: wang--ge Date: Tue, 6 Jun 2023 15:17:51 +0800 Subject: [PATCH] add pie compile option (cherry picked from commit 0a48e052d9bcb01d33de1c35f65ffed4d47d44b5) --- 0001-add-pie-compile-option.patch | 29 +++++++++++++++++++++++++++++ ttmkfdir.spec | 6 +++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 0001-add-pie-compile-option.patch diff --git a/0001-add-pie-compile-option.patch b/0001-add-pie-compile-option.patch new file mode 100644 index 0000000..b8ddb29 --- /dev/null +++ b/0001-add-pie-compile-option.patch @@ -0,0 +1,29 @@ +From 5f57fa5c6d4bf4b16bfa1313d2918d27192980e6 Mon Sep 17 00:00:00 2001 +From: wang--ge +Date: Tue, 6 Jun 2023 15:00:54 +0800 +Subject: [PATCH] add pie compile option + +--- + Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makefile b/Makefile +index e65b64c..6373ee4 100644 +--- a/Makefile ++++ b/Makefile +@@ -39,10 +39,10 @@ BINDIR=$(PREFIX)/bin + all: ttmkfdir + + .cpp.o: +- libtool --mode=compile $(CXX) $(CXXFLAGS) -o $@ -c $^ ++ libtool --mode=compile $(CXX) $(CXXFLAGS) -fPIE -o $@ -c $^ + + ttmkfdir: ttmkfdir.o directory.o commandline.o ttf.o encoding.o parser.o builtin.o +- libtool --mode=link $(CXX) -o $@ $^ $(LDFLAGS) ++ libtool --mode=link $(CXX) -pie -o $@ $^ $(LDFLAGS) + + parser.cpp: encoding.l + flex -i -8 -o$@ $< +-- +2.33.0 + diff --git a/ttmkfdir.spec b/ttmkfdir.spec index 1813444..238e429 100644 --- a/ttmkfdir.spec +++ b/ttmkfdir.spec @@ -1,7 +1,7 @@ Summary: Utility to create fonts.scale files for truetype fonts Name: ttmkfdir Version: 3.0.9 -Release: 56 +Release: 57 License: LGPLv2+ Source0: %{name}-%{version}.tar.bz2 Source1: ttmkfdir.1 @@ -16,6 +16,7 @@ Patch7: ttmkfdir-3.0.9-encoding-dir.patch Patch8: ttmkfdir-3.0.9-font-scale.patch Patch9: ttmkfdir-3.0.9-bug434301.patch Patch10: ttmkfdir-3.0.9-freetype-header-fix2.patch +Patch11: 0001-add-pie-compile-option.patch BuildRequires: freetype-devel >= 2.0 flex libtool BuildRequires: bzip2-devel zlib-devel gcc-c++ @@ -46,5 +47,8 @@ cp -p %{SOURCE1} $RPM_BUILD_ROOT/%{_mandir}/man1/ %{_mandir}/man1/ %changelog +* Tue Jun 06 2023 Ge Wang - 3.0.9-57 +- Add pie compile option + * Tue Dec 3 2019 mengxian - 3.0.9-56 - Package init