From owner-svn-ports-all@freebsd.org Mon May 30 12:00:31 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7644B54DF7; Mon, 30 May 2016 12:00:31 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2E571ED3; Mon, 30 May 2016 12:00:31 +0000 (UTC) (envelope-from jbeich@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u4UC0UJJ059423; Mon, 30 May 2016 12:00:30 GMT (envelope-from jbeich@FreeBSD.org) Received: (from jbeich@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u4UC0UcH059421; Mon, 30 May 2016 12:00:30 GMT (envelope-from jbeich@FreeBSD.org) Message-Id: <201605301200.u4UC0UcH059421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jbeich set sender to jbeich@FreeBSD.org using -f From: Jan Beich Date: Mon, 30 May 2016 12:00:30 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r416147 - in head/games/burrtools: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2016 12:00:31 -0000 Author: jbeich Date: Mon May 30 12:00:30 2016 New Revision: 416147 URL: https://svnweb.freebsd.org/changeset/ports/416147 Log: games/burrtools: switch back to clang on 10+ Fix undefined behavior on startup when parsing (embedded) config file written in Lua. MFH: 2016Q2 Added: head/games/burrtools/files/patch-undefined (contents, props changed) Modified: head/games/burrtools/Makefile (contents, props changed) Modified: head/games/burrtools/Makefile ============================================================================== --- head/games/burrtools/Makefile Mon May 30 11:58:42 2016 (r416146) +++ head/games/burrtools/Makefile Mon May 30 12:00:30 2016 (r416147) @@ -3,7 +3,7 @@ PORTNAME= burrtools PORTVERSION= 0.6.3 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= games MASTER_SITES= SF @@ -21,7 +21,6 @@ LIB_DEPENDS= libboost_system.so:devel/bo USES= gmake USE_XORG= x11 xt xext xmu xi USE_GL= glu -USE_GCC= yes # clang generates incorrect binaries: cause SIGILL GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-silent-rules @@ -37,12 +36,6 @@ DESKTOP_ENTRIES="BurrGui" "" "${PREFIX}/ OPTIONS_DEFINE= DOCS EXAMPLES -.include - -.if ${OPSYS} == FreeBSD && ${OSVERSION} >= 1000024 -LDFLAGS+= -lc++ -.endif - post-patch: @${REINPLACE_CMD} -e \ 's|g++ |$$(CXX) | ; \ Added: head/games/burrtools/files/patch-undefined ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/games/burrtools/files/patch-undefined Mon May 30 12:00:30 2016 (r416147) @@ -0,0 +1,54 @@ +Found by -fsanitize=undefined as + + $ burrGui + lua/luaclass.cpp:60:17: runtime error: execution reached the end of a value-returning function without returning a value + +which with Clang leads to + + * thread #1: tid = 100272, 0x00000000005d0d2d burrGui`luaClass_c::doString(this=0x00007fffffffd6e0, code="windowposh = 600") + 125 at luaclass.cpp:61, stop reason = signal SIGILL: privileged instruction + frame #0: 0x00000000005d0d2d burrGui`luaClass_c::doString(this=0x00007fffffffd6e0, code="windowposh = 600") + 125 at luaclass.cpp:61 + 58 luaL_loadfile(L, fname) || lua_pcall(L, 0, 0, 0); + 59 } + 60 int luaClass_c::doString(const char *code) { + -> 61 luaL_loadbuffer(L, code, strlen(code), "line") || lua_pcall(L, 0, 0, 0); + 62 } + 63 + 64 /* functions that allow calling lua functions + (lldb) bt + * thread #1: tid = 100272, 0x00000000005d0d2d burrGui`luaClass_c::doString(this=0x00007fffffffd6e0, code="windowposh = 600") + 125 at luaclass.cpp:61, stop reason = signal SIGILL: privileged instruction + * frame #0: 0x00000000005d0d2d burrGui`luaClass_c::doString(this=0x00007fffffffd6e0, code="windowposh = 600") + 125 at luaclass.cpp:61 + frame #1: 0x0000000000416735 burrGui`configuration_c::parse(this=0x00000000008e5a18) + 165 at configuration.cpp:65 + frame #2: 0x0000000000416fbb burrGui`configuration_c::configuration_c(this=0x00000000008e5a18) + 939 at configuration.cpp:144 + frame #3: 0x0000000000417877 burrGui`::__cxx_global_var_init() + 23 at configuration.cpp:266 + frame #4: 0x00000000004178b9 burrGui`_GLOBAL__sub_I_configuration.cpp + 9 at configuration.cpp:0 + frame #5: 0x00000000006221e2 burrGui`__do_global_ctors_aux + 34 + frame #6: 0x000000000040e986 burrGui + +--- src/lua/luaclass.cpp.orig 2013-05-08 19:02:06 UTC ++++ src/lua/luaclass.cpp +@@ -54,10 +54,10 @@ bool luaClass_c::getBool(const char *nam + } + + /* functions to evaluate lua code */ +-int luaClass_c::doFile(const char *fname) { ++void luaClass_c::doFile(const char *fname) { + luaL_loadfile(L, fname) || lua_pcall(L, 0, 0, 0); + } +-int luaClass_c::doString(const char *code) { ++void luaClass_c::doString(const char *code) { + luaL_loadbuffer(L, code, strlen(code), "line") || lua_pcall(L, 0, 0, 0); + } + +--- src/lua/luaclass.h.orig 2013-05-08 19:02:06 UTC ++++ src/lua/luaclass.h +@@ -45,8 +45,8 @@ class luaClass_c { + bool getBool(const char *name); + + /* functions to evaluate lua code */ +- int doFile(const char *fname); +- int doString(const char *code); ++ void doFile(const char *fname); ++ void doString(const char *code); + + /* functions that allow calling lua functions + *