AOSP: Do not add '-Wl,--gc-sections' to the linker arguments
authorRoman Stratiienko <r.stratiienko@gmail.com>
Wed, 16 Jun 2021 15:00:06 +0000 (18:00 +0300)
committerMarge Bot <eric+marge@anholt.net>
Wed, 7 Jul 2021 18:32:28 +0000 (18:32 +0000)
With '-Wl,--gc-sections' meson.build cc.has_function() will never fail,
providing wrong input to the build system.

Fixes: 8621bd8d5e67 ("android: Add scripts to build using meson")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11637>

android/mesa3d_cross.mk

index ac06efc..da63cc9 100644 (file)
@@ -170,8 +170,9 @@ define m-lld-flags-cleaned
   $(subst out/,$(AOSP_ABSOLUTE_PATH)/out/,             \
   $(subst -Wl$(comma)--fatal-warnings,,                \
   $(subst -Wl$(comma)--no-undefined-version,,          \
-  $(patsubst %dummy.o,,                               \
-    $(m-lld-flags))))))
+  $(subst -Wl$(comma)--gc-sections,,                   \
+  $(patsubst %dummy.o,,                                \
+    $(m-lld-flags)))))))
 endef
 
 define m-cpp-flags