Building security/cryptopp with the default compile options yields to to a build with 'g++ -O -pipe -march=pentium -fPIC -msse2 -pipe'. Option -O optimizes for speed and size. This produces incorrect code with some encryption algoritmns and yield to crashes. Fix: add the following patch (which supresses optimization) to the port and all tests succeed .include <bsd.port.pre.mk>--0qPFhKTIr2jI8Dr9cT7Nqsm915TZXL5SUmKAUjiTyjiqVSqj Content-Type: text/plain; name="file.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="file.diff" --- Makefile.orig Sun Jan 30 14:05:17 2005 +++ Makefile Mon Jan 31 00:24:57 2005 @@ -25,7 +25,7 @@ EXTRACT_BEFORE_ARGS= -aq USE_GMAKE= yes MAKEFILE= GNUmakefile -CXXFLAGS+= -fPIC +CXXFLAGS+= -fPIC -O0 How-To-Repeat: - build port - run cryptest v cryptes crashes with core dump after executing 'BlumBlumShub validation suite running...' test
Someone please commit this patch, thanks! å¨ 2005-01-30æ¥ç 23:27 +0000ï¼Thomas Melzeråéï¼ > add the following patch (which supresses optimization) to the port and all tests succeed > > --- Makefile.orig Sun Jan 30 14:05:17 2005 > +++ Makefile Mon Jan 31 00:24:57 2005 > @@ -25,7 +25,7 @@ > EXTRACT_BEFORE_ARGS= -aq > USE_GMAKE= yes > MAKEFILE= GNUmakefile > -CXXFLAGS+= -fPIC > +CXXFLAGS+= -fPIC -O0 > > .include <bsd.port.pre.mk> Cheers, -- Xin LI <delphij delphij net> http://www.delphij.net/
Works fine for me. Your output seems to contain -march=pentium which mine system don't emit -- can you check without it? I think it's not there by default. -- Pav Lucistnik <pav@oook.cz> <pav@FreeBSD.org> Bento's Law: If It Can Break, It Will Break Bento's Corollary: If It Can Break, Kris Can Send Mail About It
I've tested the build by supressing the -march=pentium switch. The port build emits the same behaviour. Build with -O crash, build with -O0 cryptest runs fine. Further investigation have shown where the compileswitches -O and -march=pentium come from. In my /etc/make.conf i have the following 2 lines CPUTYPE=i586 CFLAGS= -O -pipe I use CPUTYPE=i586 because my build machine is a Pentium4 2.8 GHz machine and Several of my older servers have only pentium cpus. This line lead to -march=pentium option. CFLAGS is the supported maximum for buildworld and kernel. If i comment out these settings cryptopp port is compiled with -fPIC -msse2 -pipe Cryptest runs as expected. But if you use the CFLAGS setting above You have to apply my patch as cryptest breaks. So I think the save way will be to disable optimization explicit so that optimazation settings in make.conf can not break the port. Regards -- Thomas
State Changed From-To: open->closed Committed, Thanks!