Problem building Samba with clang

Hi all!

There's an issue building Samba with clang I've seen both on FreeBSD
10 and OS X.

On OS X the error is:

[3544/3818] Linking default/source3/nmbd/nmbd
clang: warning: argument unused during compilation: '-pie'
Undefined symbols for architecture x86_64:
  "___unsafe_string_function_usage_here_size_t__", referenced from:
      _send_announcement in nmbd_sendannounce_120.o
      _send_lm_announcement in nmbd_sendannounce_120.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

FreeBSD 10:

[3559/3706] Linking default/source3/nmbd/nmbd
default/source3/nmbd/nmbd_sendannounce_150.o: In function
`send_announcement':
/usr/home/ralph/samba/test/bin/../source3/nmbd/nmbd_sendannounce.c:123:
undefined reference to `__unsafe_string_function_usage_here_size_t__'
default/source3/nmbd/nmbd_sendannounce_150.o: In function
`send_lm_announcement':
/usr/home/ralph/samba/test/bin/../source3/nmbd/nmbd_sendannounce.c:152:
undefined reference to `__unsafe_string_function_usage_here_size_t__'
invocation)
Waf: Leaving directory `/usr/home/ralph/samba/test/bin'

I can't find any references for this error, I'm not even sure it's
really clang related. What's that
__unsafe_string_function_usage_here_size_t__ thingy? :slight_smile:

Thanks for any pointers!

Cheerio!
-slow

d'oh!

I could swear I did a `git grep
__unsafe_string_function_usage_here_size_t__` and it didn't return
anything. Well, looks like I was just being stupid. It's an
optimisation used in some Samba utility code and our waf configure
check didn't correctly report whether clang supports this
optimisation.

Fix:
<https://lists.samba.org/archive/samba-technical/2014-October/103018.html&gt;

Sorry for the noise! :slight_smile:

-Ralph