Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2014 08:54:26 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "James R. Van Artsdalen" <james-freebsd-ports@jrv.org>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: net/samba36 does not build on stable10?
Message-ID:  <F206DCEE-C0B0-4426-A9CD-624D24CEA74D@FreeBSD.org>
In-Reply-To: <5326972A.5080400@jrv.org>
References:  <5326972A.5080400@jrv.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 =
<james-freebsd-ports@jrv.org> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F206DCEE-C0B0-4426-A9CD-624D24CEA74D>