Saturday, April 14, 2018

Re: NEW: devel/csmith

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/csmith/Makefile,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile
--- Makefile 26 Jul 2017 22:45:17 -0000 1.7
+++ Makefile 5 Apr 2018 02:20:21 -0000
@@ -2,8 +2,7 @@

COMMENT= fuzzer for C compilers

-DISTNAME= csmith-2.2.0
-REVISION = 2
+DISTNAME= csmith-2.3.0

CATEGORIES= devel

@@ -16,8 +15,8 @@ SHARED_LIBS += csmith

WANTLIB+= c m ${COMPILER_LIBCXX}

-HOMEPAGE= http://embed.cs.utah.edu/csmith/
-MASTER_SITES=
http://embed.cs.utah.edu/csmith/
+HOMEPAGE= https://embed.cs.utah.edu/csmith/
+MASTER_SITES= https://embed.cs.utah.edu/csmith/

CONFIGURE_STYLE=gnu

Index: distinfo
===================================================================
RCS file: /cvs/ports/devel/csmith/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- distinfo 1 May 2015 00:38:29 -0000 1.1.1.1
+++ distinfo 5 Apr 2018 02:20:21 -0000
@@ -1,2 +1,2 @@
-SHA256 (csmith-2.2.0.tar.gz) = Yv2W06UigkHU8xWVEa0/9bjEztuemoKtyTWDC0Icjjc=
-SIZE (csmith-2.2.0.tar.gz) = 622362
+SHA256 (csmith-2.3.0.tar.gz) = 8kfMCu3l+KB0YnG0ClCStbWi0DTl6PeoNsh53eP7ZdU=
+SIZE (csmith-2.3.0.tar.gz) = 637381
Index: patches/patch-runtime_Makefile_am
===================================================================
RCS file: /cvs/ports/devel/csmith/patches/patch-runtime_Makefile_am,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-runtime_Makefile_am
--- patches/patch-runtime_Makefile_am 1 May 2015 00:38:29 -0000 1.1.1.1
+++ patches/patch-runtime_Makefile_am 5 Apr 2018 02:20:21 -0000
@@ -1,7 +1,8 @@
$OpenBSD: patch-runtime_Makefile_am,v 1.1.1.1 2015/05/01 00:38:29 daniel Exp $
---- runtime/Makefile.am.orig Thu Jan 22 00:36:24 2015
-+++ runtime/Makefile.am Thu Jan 22 00:36:54 2015
-@@ -35,7 +35,7 @@ libcsmith_a_SOURCES = \
+Index: runtime/Makefile.am
+--- runtime/Makefile.am.orig
++++ runtime/Makefile.am
+@@ -37,7 +37,7 @@ libcsmith_a_SOURCES = \

# XXX --- This does not work; the library is still installed to $(libdir).
# libcsmith_a_libdir = \
@@ -10,7 +11,7 @@ $OpenBSD: patch-runtime_Makefile_am,v 1.

# Build a shared library, too, in case someone wants this.
lib_LTLIBRARIES = libcsmith.la
-@@ -57,7 +57,7 @@ libcsmith_la_CPPFLAGS = \
+@@ -49,7 +49,7 @@ libcsmith_la_CPPFLAGS = \
$(libcsmith_a_CPPFLAGS)

libcsmith_a_includedir = \
Index: patches/patch-runtime_Makefile_in
===================================================================
RCS file: /cvs/ports/devel/csmith/patches/patch-runtime_Makefile_in,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 patch-runtime_Makefile_in
--- patches/patch-runtime_Makefile_in 1 May 2015 00:38:29 -0000 1.1.1.1
+++ patches/patch-runtime_Makefile_in 5 Apr 2018 02:20:21 -0000
@@ -1,7 +1,8 @@
$OpenBSD: patch-runtime_Makefile_in,v 1.1.1.1 2015/05/01 00:38:29 daniel Exp $
---- runtime/Makefile.in.orig Thu Jan 22 00:39:04 2015
-+++ runtime/Makefile.in Thu Jan 22 00:39:21 2015
-@@ -339,7 +339,7 @@ libcsmith_a_SOURCES = \
+Index: runtime/Makefile.in
+--- runtime/Makefile.in.orig
++++ runtime/Makefile.in
+@@ -349,7 +349,7 @@ libcsmith_a_SOURCES = \

# XXX --- This does not work; the library is still installed to $(libdir).
# libcsmith_a_libdir = \
@@ -10,7 +11,7 @@ $OpenBSD: patch-runtime_Makefile_in,v 1.

# Build a shared library, too, in case someone wants this.
lib_LTLIBRARIES = libcsmith.la
-@@ -356,7 +356,7 @@ libcsmith_la_CPPFLAGS = \
+@@ -361,7 +361,7 @@ libcsmith_la_CPPFLAGS = \
$(libcsmith_a_CPPFLAGS)

libcsmith_a_includedir = \
Index: patches/patch-src_platform_cpp
===================================================================
RCS file: patches/patch-src_platform_cpp
diff -N patches/patch-src_platform_cpp
--- patches/patch-src_platform_cpp 5 Aug 2015 22:49:59 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,62 +0,0 @@
-$OpenBSD: patch-src_platform_cpp,v 1.2 2015/08/05 22:49:59 tobiasu Exp $
-
-- No sys/timeb.h on OpenBSD
-- Generate a seed more portably.
-
---- src/platform.cpp.orig Wed Dec 31 16:46:24 2014
-+++ src/platform.cpp Fri Jul 31 22:24:40 2015
-@@ -40,50 +40,15 @@
- // Platform-Specific code to get a unique seed value (usually from the tick counter, etc)
- //
- #include <sys/types.h>
--#include <sys/timeb.h>
-+#include <stdlib.h>
-
- #include "platform.h"
-
--#if (TARGET_CPU_powerpc == 1 || TARGET_CPU_powerpc64 == 1)
--/*For PPC, got from:
--http://lists.ozlabs.org/pipermail/linuxppc-dev/1999-October/003889.html
--*/
--static unsigned long long read_time(void) {
-- unsigned long long retval;
-- unsigned long junk;
-- __asm__ __volatile__ ("\n\
--1: mftbu %1\n\
-- mftb %L0\n\
-- mftbu %0\n\
-- cmpw %0,%1\n\
-- bne 1b"
-- : "=r" (retval), "=r" (junk));
-- return retval;
--}
--#else
--#ifdef WIN32
--static unsigned __int64 read_time(void) {
-- unsigned l, h;
-- _asm {rdtsc
-- mov l, eax
-- mov h, edx
-- }
-- return (h << 32) + l ;
--}
--#else
--static long long read_time(void) {
-- long long l;
-- asm volatile( "rdtsc\n\t"
-- : "=A" (l)
-- );
-- return l;
--}
--#endif
--#endif
--
- unsigned long platform_gen_seed()
- {
-- return (long) read_time();
-+ unsigned long seed;
-+ arc4random_buf(&seed, sizeof(unsigned long));
-+ return seed;
- }
-
- //////////// platform specific mkdir /////////////////
On 04/11/18 07:21, Jeremie Courreges-Anglas wrote:
> On Wed, Apr 11 2018, "Anthony J. Bentley" <anthony@anjbe.name> wrote:
>> Hi,
>>
>> Csmith is a tool that can generate random C programs that statically and
>> dynamically conform to the C99 standard. It is useful for stress-testing
>> compilers, static analyzers, and other tools that process C code. Csmith
>> has found bugs in every tool that it has tested, and has been used to find
>> and report more than 400 previously unknown compiler bugs.
>>
>>
>> ok?
> Nope. We already have ports/devel/csmith; maybe you should coordinate
> with Daniel (cc'ed) instead. eg we are now at csmith-2.2.0, and our
> port could use https instead of http.
>

I needed this in the process of porting creduce (upcoming!) so here's a
diff to update to 2.3.0

OK?

~Brian

No comments:

Post a Comment