[sparse/el6] Remove -fpic from CFLAGS

Jeff Layton jlayton at fedoraproject.org
Tue Aug 19 17:58:01 UTC 2014


commit 45c79e3f0e4484281967cb35b1cfa0fcf52c682e
Author: Jeff Layton <jlayton at primarydata.com>
Date:   Tue Aug 19 13:56:05 2014 -0400

    Remove -fpic from CFLAGS
    
    The combination of -O2 and -fpic seems to be causing a very oddball bug
    in sparse's handling of err.h. expr->ctype->ctype.modifiers is ending
    up corrupt.
    
    I suspect this is sparse relying on some undefined behavior that is
    tricking the optimizer into not setting this field properly, but I've
    not yet been able to track down the root cause.
    
    For now, just remove -fpic as it shouldn't matter much for sparse
    anyway. Longer term, we can track the bug here to try and nail down
    what's going wrong.
    
        https://bugzilla.redhat.com/show_bug.cgi?id=1109560
    
    Signed-off-by: Jeff Layton <jlayton at primarydata.com>

 sparse.spec |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/sparse.spec b/sparse.spec
index 2e63553..c8dd0f4 100644
--- a/sparse.spec
+++ b/sparse.spec
@@ -1,6 +1,6 @@
 Name: sparse
 Version: 0.4.4
-Release: 6%{?dist}
+Release: 7%{?dist}
 Summary:    A semantic parser of source files
 Group:      Development/Tools
 License:    OSL 1.1
@@ -48,11 +48,7 @@ make DESTDIR="%{buildroot}" PREFIX="%{_prefix}" \\\
 %{nil}
 
 %build
-%ifarch sparcv9 sparc64
-%make_destdir %{?_smp_mflags} CFLAGS="%{optflags} -Wwrite-strings -fPIC -DGCC_BASE=\\\"`gcc --print-file-name=`\\\""
-%else
-%make_destdir %{?_smp_mflags} CFLAGS="%{optflags} -Wwrite-strings -fpic -DGCC_BASE=\\\"`gcc --print-file-name=`\\\""
-%endif
+%make_destdir %{?_smp_mflags} CFLAGS="%{optflags} -Wwrite-strings -DGCC_BASE=\\\"`gcc --print-file-name=`\\\""
 
 %install
 rm -rf %{buildroot}
@@ -84,6 +80,10 @@ make clean
 %{_libdir}/libsparse.a
 %{_libdir}/pkgconfig/%{name}.pc
 
+%changelog
+* Tue Aug 19 2014 Jeff Layton <jlayton at primarydata.com> - 0.4.4-7
+- Remove -fpic and -fPIC from CFLAGS. Seems to be causing weird effects with
+  -O2. (bz# 1109560)
 
 %changelog
 * Thu Jun 27 2013 Jeff Layton <jlayton at redhat.com> - 0.4.4-6


More information about the scm-commits mailing list