build: in SAMBA_BINARY use TO_LIST(cflags)
authorStefan Metzmacher <metze@samba.org>
Fri, 22 Nov 2019 15:11:41 +0000 (16:11 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 15 Jun 2021 22:41:34 +0000 (22:41 +0000)
This avoids unfortunate issues when the cflags is
already a list, as then -fPIC becomes ['-f', 'P', 'I', 'C'].

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/wafsamba.py

index 2dfd5e6e44b2cbfc792c6a1686743dfe4d0208f5..4fe9daf160e4ddcd84964fa212cfc9f523138525 100644 (file)
@@ -408,10 +408,10 @@ def SAMBA_BINARY(bld, binname, source,
         subsystem_group = group
 
     # only specify PIE flags for binaries
-    pie_cflags = cflags
+    pie_cflags = TO_LIST(cflags)
     pie_ldflags = TO_LIST(ldflags)
     if bld.env['ENABLE_PIE'] is True:
-        pie_cflags += ' -fPIE'
+        pie_cflags.extend(TO_LIST('-fPIE'))
         pie_ldflags.extend(TO_LIST('-pie'))
     if bld.env['ENABLE_RELRO'] is True:
         pie_ldflags.extend(TO_LIST('-Wl,-z,relro,-z,now'))