On 17 Mar 2014, at 07:33, James R. Van Artsdalen <james-freebsd-po...@jrv.org> wrote: > FreeBSD STABLE10.housenet.jrv 10.0-STABLE FreeBSD 10.0-STABLE #0 > r263107M: Sun Mar 16 17:52:42 UTC 2014 > r...@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. ... > 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#
Try removing WITH_DEBUG=1 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
signature.asc
Description: Message signed with OpenPGP using GPGMail