waf: only use -fstack-protector when both compiler and linker support it
authorChristian Ambach <ambi@samba.org>
Tue, 7 May 2013 07:06:50 +0000 (09:06 +0200)
committerChristian Ambach <ambi@samba.org>
Fri, 17 May 2013 09:16:33 +0000 (11:16 +0200)
otherwise build with xlc on AIX fails because the compiler silently ignores the parameter
but the linker does not like it

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/replace/wscript

index 9483e230891705b9ca5bf0ff8fae49b1e5940ea5..bc45ee9043ff15ab5bd4b252da189f26150dc1be 100644 (file)
@@ -53,7 +53,7 @@ struct foo bar = { .y = 'X', .x = 1 };
                 conf.ADD_CFLAGS(f)
             break
 
-    if conf.CHECK_CFLAGS(['-fstack-protector']):
+    if conf.CHECK_CFLAGS(['-fstack-protector']) and conf.CHECK_LDFLAGS(['-fstack-protector']):
         conf.ADD_CFLAGS('-fstack-protector')
         conf.ADD_LDFLAGS('-fstack-protector')