From 9ddfd7d8784e6f546628f48990b69ee2850be52d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 May 2013 17:23:30 +1000 Subject: lib/replace: Set BROKEN_STRNLEN and BROKEN_STRNDUP on all AIX The background is in https://bugzilla.samba.org/show_bug.cgi?id=1097 and wider reports are at http://stackoverflow.com/questions/2091460/strndup-call-is-currupting-stack-frames Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Thu May 23 03:52:10 CEST 2013 on sn-devel-104 --- lib/replace/wscript | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/replace/wscript') diff --git a/lib/replace/wscript b/lib/replace/wscript index bc45ee9043..2117f56e22 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -228,6 +228,19 @@ struct foo bar = { .y = 'X', .x = 1 }; # these may be builtins, so we need the link=False strategy conf.CHECK_FUNCS('strdup memmem printf memset memcpy memmove strcpy strncpy bzero', link=False) + # See https://bugzilla.samba.org/show_bug.cgi?id=1097 + # + # Ported in from autoconf where it was added with this commit: + # commit 804cfb20a067b4b687089dc72a8271b3abf20f31 + # Author: Simo Sorce + # Date: Wed Aug 25 14:24:16 2004 +0000 + # r2070: Let's try to overload srnlen and strndup for AIX where they are natly broken. + + host_os = sys.platform + if host_os.rfind('aix') > -1: + conf.DEFINE('BROKEN_STRNLEN', 1) + conf.DEFINE('BROKEN_STRNDUP', 1) + conf.CHECK_FUNCS('shl_load shl_unload shl_findsym') conf.CHECK_FUNCS('pipe strftime srandom random srand rand usleep setbuffer') conf.CHECK_FUNCS('lstat getpgrp utime utimes setuid seteuid setreuid setresuid setgid setegid') -- cgit