From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Nov 11 21:30:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D56D38DB for ; Mon, 11 Nov 2013 21:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B4CCF28FC for ; Mon, 11 Nov 2013 21:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id rABLU0s6083882 for ; Mon, 11 Nov 2013 21:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id rABLU0P3083881; Mon, 11 Nov 2013 21:30:00 GMT (envelope-from gnats) Resent-Date: Mon, 11 Nov 2013 21:30:00 GMT Resent-Message-Id: <201311112130.rABLU0P3083881@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Bradley T. Hughes" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 1A3106AF for ; Mon, 11 Nov 2013 21:27:06 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 06E5228D2 for ; Mon, 11 Nov 2013 21:27:06 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rABLR5IB013243 for ; Mon, 11 Nov 2013 21:27:05 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rABLR5Zi013238; Mon, 11 Nov 2013 21:27:05 GMT (envelope-from nobody) Message-Id: <201311112127.rABLR5Zi013238@oldred.freebsd.org> Date: Mon, 11 Nov 2013 21:27:05 GMT From: "Bradley T. Hughes" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/183872: net/samba4 does not need to pull in lang/gcc X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 21:30:01 -0000 >Number: 183872 >Category: ports >Synopsis: net/samba4 does not need to pull in lang/gcc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Nov 11 21:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Bradley T. Hughes >Release: 10.0-BETA3 >Organization: >Environment: FreeBSD freebsd10.local 10.0-BETA3 FreeBSD 10.0-BETA3 #0 r257580: Sun Nov 3 19:43:01 UTC 2013 root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: net/samba4 has USE_GCC in its Makefile, but it doesn't really need to. The source3/wscript incorrectly assumes that if a compiler (like clang in the base system) can optimize out 'if (0) { some_undefined_function() }', then it can optimize out the more complex methods in lib/util/string_wrappers.h. This is not the case. The attached patch updates source3/wscript to test that the compiler can optimize out the same kind of construct used in lib/util/string_wrapper.h, which correctly detects that clang cannot, and the build succeeds with the base system compiler. >How-To-Repeat: >Fix: See attached. Patch attached with submission follows: diff -ur /usr/ports/net/samba4/Makefile samba4-without-gcc/Makefile --- /usr/ports/net/samba4/Makefile 2013-09-21 00:10:23.000000000 +0200 +++ samba4-without-gcc/Makefile 2013-11-11 20:53:24.725461436 +0100 @@ -68,7 +68,6 @@ USE_PYTHON_BUILD= -2.7 USE_PERL5= build -USE_GCC= 4.2+ USE_PYTHON= yes USES= pkgconfig gettext iconv perl5 USE_LDCONFIG= ${SAMBA4_LIBDIR} diff -ur /usr/ports/net/samba4/files/patch-source3__wscript samba4-without-gcc/files/patch-source3__wscript --- /usr/ports/net/samba4/files/patch-source3__wscript 2013-02-18 15:24:56.000000000 +0100 +++ samba4-without-gcc/files/patch-source3__wscript 2013-11-11 20:47:09.117296396 +0100 @@ -1,6 +1,17 @@ ---- ./source3/wscript.orig 2013-02-05 12:25:26.000000000 +0000 -+++ ./source3/wscript 2013-02-15 17:54:40.099886239 +0000 -@@ -475,7 +475,7 @@ +--- source3/wscript.orig 2013-05-21 08:48:46.000000000 +0200 ++++ source3/wscript 2013-11-11 20:46:22.508193334 +0100 +@@ -312,7 +312,9 @@ + + # Check if the compiler will optimize out functions + conf.CHECK_CODE(''' +-if (0) { ++char s = "string"; ++int len = 6; ++if (sizeof(s) != len && sizeof(s) != sizeof(char *)) { + this_function_does_not_exist(); + } else { + return 1; +@@ -502,7 +504,7 @@ conf.CHECK_CODE('struct aiocb a; return aio_return(&a);', 'HAVE_AIO_RETURN', msg='Checking for aio_return', headers='aio.h', lib='aio rt') conf.CHECK_CODE('struct aiocb a; return aio_error(&a);', 'HAVE_AIO_ERROR', msg='Checking for aio_error', headers='aio.h', lib='aio rt') conf.CHECK_CODE('struct aiocb a; return aio_cancel(1, &a);', 'HAVE_AIO_CANCEL', msg='Checking for aio_cancel', headers='aio.h', lib='aio rt') @@ -9,7 +20,7 @@ if not conf.CONFIG_SET('HAVE_AIO'): conf.DEFINE('HAVE_NO_AIO', '1') else: -@@ -1644,26 +1644,8 @@ +@@ -1671,26 +1673,8 @@ if PTHREAD_LDFLAGS == 'error': if conf.CHECK_FUNCS_IN('pthread_attr_init', 'pthread'): @@ -37,7 +48,7 @@ if PTHREAD_CFLAGS != 'error' and PTHREAD_LDFLAGS != 'error': conf.ADD_CFLAGS(PTHREAD_CFLAGS) -@@ -1693,8 +1675,8 @@ +@@ -1720,8 +1704,8 @@ auth_script vfs_readahead vfs_xattr_tdb vfs_posix_eadb vfs_streams_xattr vfs_streams_depot vfs_acl_xattr vfs_acl_tdb vfs_smb_traffic_analyzer vfs_preopen vfs_catia vfs_scannedonly @@ -48,7 +59,7 @@ vfs_crossrename vfs_linux_xfs_sgid vfs_time_audit idmap_autorid idmap_tdb2 idmap_rid idmap_hash''')) -@@ -1707,7 +1689,7 @@ +@@ -1734,7 +1718,7 @@ if Options.options.enable_selftest or Options.options.developer: default_shared_modules.extend(TO_LIST('vfs_fake_acls')) @@ -57,12 +68,12 @@ if conf.CONFIG_SET('AD_DC_BUILD_IS_ENABLED'): default_static_modules.extend(TO_LIST('pdb_samba_dsdb auth_samba4 vfs_dfs_samba4')) -@@ -1740,7 +1722,7 @@ +@@ -1767,7 +1751,7 @@ default_static_modules.extend(TO_LIST('charset_macosxfs')) if conf.CONFIG_SET('HAVE_GPFS'): - default_shared_modules.extend(TO_LIST('vfs_gpfs')) + default_shared_modules.extend(TO_LIST('vfs_gpfs')) - explicit_shared_modules = TO_LIST(Options.options.shared_modules, delimiter=',') - explicit_static_modules = TO_LIST(Options.options.static_modules, delimiter=',') + if conf.CONFIG_SET('SAMBA_FAM_LIBS'): + default_shared_modules.extend(TO_LIST('vfs_notify_fam')) >Release-Note: >Audit-Trail: >Unformatted: