From owner-freebsd-ports@FreeBSD.ORG Mon Mar 17 06:33:03 2014 Return-Path: Delivered-To: freebsd-ports@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 ESMTPS id 18DC8953 for ; Mon, 17 Mar 2014 06:33:03 +0000 (UTC) Received: from mail.jrv.org (adsl-70-243-84-11.dsl.austtx.swbell.net [70.243.84.11]) by mx1.freebsd.org (Postfix) with ESMTP id BBEBD874 for ; Mon, 17 Mar 2014 06:33:02 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.jrv.org (Postfix) with ESMTP id EDAEE124017 for ; Mon, 17 Mar 2014 01:33:00 -0500 (CDT) X-Virus-Scanned: amavisd-new at zimbra.housenet.jrv Received: from mail.jrv.org ([127.0.0.1]) by localhost (zimbra.housenet.jrv [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TEEVT8Cl771s for ; Mon, 17 Mar 2014 01:33:00 -0500 (CDT) Received: from [192.168.23.128] (BMX.housenet.jrv [192.168.3.140]) by mail.jrv.org (Postfix) with ESMTPSA id 85C42124014 for ; Mon, 17 Mar 2014 01:33:00 -0500 (CDT) Message-ID: <5326972A.5080400@jrv.org> Date: Mon, 17 Mar 2014 00:33:14 -0600 From: "James R. Van Artsdalen" User-Agent: Mozilla/5.0 (Windows NT 5.0; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: freebsd-ports@freebsd.org Subject: net/samba36 does not build on stable10? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Mar 2014 06:33:03 -0000 FreeBSD STABLE10.housenet.jrv 10.0-STABLE FreeBSD 10.0-STABLE #0 r263107M: Sun Mar 16 17:52:42 UTC 2014 root@STABLE10.housenet.jrv:/usr/obj/usr/src/sys/GENERIC amd64 Samba 3.6 doesn't compile for me on stable10, yet internet searches don't reveal any other cases similar to this? The symptom is that compilations fail due to a linkage error: undefined reference to `__unsafe_string_function_usage_here__'. These seem to be the result of this code in work/samba-3.6.23/source3/include/safe_string.h #ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS ... #define safe_strcpy_fn2(fn_name, fn_line, d, s, max_len) \ (CHECK_STRING_SIZE(d, max_len+1) \ ? __unsafe_string_function_usage_here__() \ : safe_strcpy_fn(fn_name, fn_line, (d), (s), (max_len))) ... HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS is a configuration-time item set in work/samba-3.6.23/source3/wscript: # Check if the compiler will optimize out functions conf.CHECK_CODE(''' if (0) { this_function_does_not_exist(); } else { return 1; }''', 'HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS', msg="Checking if the compiler will optimize out functions") A manual #undef of HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS fixes the problem. It appears that samba assumes such dead code removal always happens, whereas perhaps there are cases clang does not remove. Or perhaps the CHECK_STRING_SIZE test is finding a real bug. Either way it appears to be a samba issue that is exposed by stable10's usage of clang. Compilation output: ... Linking bin/smbstatus locking/locking.o: In function `rename_share_filename': /usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:1100: undefined reference to `__unsafe_string_function_usage_here__' /usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:1101: undefined reference to `__unsafe_string_function_usage_here__' /usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:1102: undefined reference to `__unsafe_string_function_usage_here__' locking/locking.o: In function `unparse_share_modes': /usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:851: undefined reference to `__unsafe_string_function_usage_here__' /usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:854: undefined reference to `__unsafe_string_function_usage_here__' locking/locking.o:/usr/ports/net/samba36/work/samba-3.6.23/source3/locking/locking.c:857: more undefined references to `__unsafe_string_function_usage_here__' follow lib/util_str.o: In function `string_append': /usr/ports/net/samba36/work/samba-3.6.23/source3/lib/util_str.c:2101: undefined reference to `__unsafe_string_function_usage_here__' cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[2]: *** [bin/testparm] Error 1 gmake[2]: *** Waiting for unfinished jobs.... cc: error: linker command failed with exit code 1 (use -v to see invocation) gmake[2]: *** [bin/smbstatus] Error 1 gmake[2]: Leaving directory `/usr/ports/net/samba36/work/samba-3.6.23/source3' ===> Compilation failed unexpectedly. Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to the maintainer. *** Error code 1 Stop. make[1]: stopped in /usr/ports/net/samba36 *** Error code 1 Stop. make: stopped in /usr/ports/net/samba36 STABLE10:/usr/ports/net/samba36# svnlite info ... Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 348319 Node Kind: directory Schedule: normal Last Changed Author: delphij Last Changed Rev: 347949 Last Changed Date: 2014-03-12 01:07:30 +0000 (Wed, 12 Mar 2014) STABLE10:/usr/ports/net/samba36# cc -v FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610 Target: x86_64-unknown-freebsd10.0 Thread model: posix STABLE10:/usr/ports/net/samba36# cat /etc/make.conf WITH_DEBUG=1 WITHOUT_X11=1 OPTIONS_UNSET=X11 WITHOUT_PKGNG=1 NO_WARNING_PKG_INSTALL_EOL=yes STABLE10:/usr/ports/net/samba36#