--- /dev/null
+diff --git a/Examples/Makefile.in b/Examples/Makefile.in
+index 87386f7..8c6355d 100644
+--- a/Examples/Makefile.in
++++ b/Examples/Makefile.in
+@@ -236,7 +236,10 @@ PERL5_DLNK = @PERL5DYNAMICLINKING@
+ PERL5_CCFLAGS = @PERL5CCFLAGS@
+ PERL5_CCDLFLAGS = @PERL5CCDLFLAGS@
+ PERL5_CCCDLFLAGS = @PERL5CCCDLFLAGS@
+-PERL5_LDFLAGS = @PERL5LDFLAGS@
++# Add -shared option because of -pie option
++# Please, read site - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77464
++# To get perl5 ldflags configration info, please read site - https://metacpan.org/pod/Perl::Configure
++PERL5_LDFLAGS =
+ PERL = @PERL@
+ PERL5_LIB = -L$(PERL5_INCLUDE) -l@PERL5LIB@ @LIBS@ $(SYSLIBS)
+ PERL5_SCRIPT = $(SRCDIR)$(RUNME).pl
+diff --git a/Source/Makefile.am b/Source/Makefile.am
+index 5cfb888..a5f65f5 100644
+--- a/Source/Makefile.am
++++ b/Source/Makefile.am
+@@ -101,7 +101,7 @@ bin_PROGRAMS = eswig
+ eswig_LDADD = @SWIGLIBS@
+
+ # Override the link stage to avoid using Libtool
+-CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -pie -o $@
+
+ # The executable is copied to the root directory for installation and running the test-suite.
+ # This occurs on each invocation of make and is a step towards providing support for multiple
Source: http://sourceforge.net/projects/swig/files/swig/%{name}-%{version}/%{name}-%{version}.tar.gz
Source1: %{name}.rpmlintrc
Source1001: swig.manifest
+Source1002: Fix_make_check_error.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: boost-devel
%prep
%setup -q
cp %{SOURCE1001} .
+%{__patch} -p1 < %{SOURCE1002}
%build
sh autogen.sh
-%configure --disable-ccache CFLAGS="-fPIE" CPPFLAGS="-fPIE" LDFLAGS="-pie"
-export CFLAGS+=" -fPIC"
+%configure --disable-ccache CFLAGS="-fPIC" CPPFLAGS="-fPIC"
make %{?_smp_mflags}
+%check
+%if 0%{?run_unit_test:1}
+# Segfaults
+rm -f Examples/test-suite/python/li_std_containers_int_runme.py
+rm -f Examples/test-suite/python/li_boost_shared_ptr_runme.py
+make check
+%endif
+
%install
%make_install