From owner-freebsd-ports@FreeBSD.ORG Mon Mar 17 07:54:44 2014 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82D45DC7 for ; Mon, 17 Mar 2014 07:54:44 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E02A8E9E for ; Mon, 17 Mar 2014 07:54:43 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::1ca0:9741:8b32:ce41] (unknown [IPv6:2001:7b8:3a7:0:1ca0:9741:8b32:ce41]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 195205C45; Mon, 17 Mar 2014 08:54:32 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_E164B7EB-FD0F-4F9B-9A39-32F510863021"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: net/samba36 does not build on stable10? From: Dimitry Andric In-Reply-To: <5326972A.5080400@jrv.org> Date: Mon, 17 Mar 2014 08:54:26 +0100 Message-Id: References: <5326972A.5080400@jrv.org> To: "James R. Van Artsdalen" X-Mailer: Apple Mail (2.1874) Cc: freebsd-ports@freebsd.org 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 07:54:44 -0000 --Apple-Mail=_E164B7EB-FD0F-4F9B-9A39-32F510863021 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 17 Mar 2014, at 07:33, James R. Van Artsdalen = wrote: > FreeBSD STABLE10.housenet.jrv 10.0-STABLE FreeBSD 10.0-STABLE #0 > r263107M: Sun Mar 16 17:52:42 UTC 2014 =20 > root@STABLE10.housenet.jrv:/usr/obj/usr/src/sys/GENERIC amd64 >=20 > Samba 3.6 doesn't compile for me on stable10, yet internet searches > don't reveal any other cases similar to this? >=20 > The symptom is that compilations fail due to a linkage error: = undefined > reference to `__unsafe_string_function_usage_here__'. >=20 > These seem to be the result of this code in > work/samba-3.6.23/source3/include/safe_string.h >=20 > #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))) > ... >=20 > HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS is a configuration-time item set = in > work/samba-3.6.23/source3/wscript: >=20 > # 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=3D"Checking if the compiler will optimize out functions") >=20 > 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. ... > STABLE10:/usr/ports/net/samba36# cat /etc/make.conf > WITH_DEBUG=3D1 > WITHOUT_X11=3D1 > OPTIONS_UNSET=3DX11 > WITHOUT_PKGNG=3D1 > NO_WARNING_PKG_INSTALL_EOL=3Dyes > STABLE10:/usr/ports/net/samba36# Try removing WITH_DEBUG=3D1 from your make.conf. This causes the samba port to be compiled without any optimization (e.g. -O0). Only use the WITH_DEBUG option for specific ports, not as a general setting. In any case, I think the samba port does something incorrectly, when its configure script tries to detect whether COMPILER_WILL_OPTIMIZE_OUT_FNS is supposed to be set. -Dimitry --Apple-Mail=_E164B7EB-FD0F-4F9B-9A39-32F510863021 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iEYEARECAAYFAlMmqjYACgkQsF6jCi4glqNuSACg7NkC7svRhqCI6u+Auiusy+O7 kZMAoOXSWqAYoiZhuuPkhOU7FWwGQ/jy =xeMY -----END PGP SIGNATURE----- --Apple-Mail=_E164B7EB-FD0F-4F9B-9A39-32F510863021--