--- samba-4.14.0rc4/wscript.OLD	ons mars  3 00:09:49 2021
+++ samba-4.14.0rc4/wscript	ons mars  3 00:09:55 2021
@@ -340,7 +340,7 @@
     # allows us to find problems on our development hosts faster.
     # It also results in faster load time.
 
-    conf.add_as_needed()
+    conf.ADD_LDFLAGS('-Wl,--as-needed', testflags=True)
 
     if not conf.CHECK_NEED_LC("-lc not needed"):
         conf.ADD_LDFLAGS('-lc', testflags=False)
