[Slackbuilds-users] kyotocabinet CFLAGS

Thomas Morper thomas at beingboiled.info
Tue Mar 11 01:11:30 UTC 2014


Hello there,

I've noticed that kyotocabinet's "configure" adds "-march=native" to the 
CFLAGS in the Makefile. According to the gcc man page, when built on very 
modern CPU (e.g. i7 Haswell), the resulting package might not work on a 
less capable CPU (e.g. Pentium-D).

I've unknowingly been running a "native" kyotocabinet for some time 
without encountering any problems, yet I've decided to rebuild the package 
with a minor modification to get a "generic" library (see attached patch).

-- 
-------------- next part --------------
--- kyotocabinet.SlackBuild.orig	2013-11-26 10:57:41.000000000 +0100
+++ kyotocabinet.SlackBuild	2014-03-11 01:38:51.308089868 +0100
@@ -80,6 +80,11 @@
   --docdir=/usr/doc/$PRGNAM-$VERSION \
   --build=$ARCH-slackware-linux
 
+# Don't use 'native' or the resulting package might
+# not work on low-spec CPUs of the same architecture.
+sed -i -r 's/^CFLAGS = -march=native/CFLAGS =/' Makefile
+sed -i -r 's/^CXXFLAGS = -march=native/CXXFLAGS =/' Makefile
+
 make
 make install DESTDIR=$PKG
 


More information about the SlackBuilds-users mailing list