All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/android-tools: fix static build failure due to missing -latomic
@ 2019-04-04 15:39 Giulio Benetti
  2019-04-04 20:45 ` Thomas Petazzoni
  0 siblings, 1 reply; 9+ messages in thread
From: Giulio Benetti @ 2019-04-04 15:39 UTC (permalink / raw)
  To: buildroot

During static linking build fails because -lcrypto doesn't inherit its
dependency like -latomic. So need to fix Makefile before building.

Add check in package recipe for TOOLCHAIN_HAS_LIBATOMIC. If toolchain
has libatomic use sed to append -latomic at the end of libs list in
adbd.mk makefile.

Fixes:
http://autobuild.buildroot.net/results/d75/d75a6cf99f58fb5f42abaf9d54cde28224bc44fb/

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 package/android-tools/android-tools.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/package/android-tools/android-tools.mk b/package/android-tools/android-tools.mk
index 6f6ca7729b..cd06afa2c2 100644
--- a/package/android-tools/android-tools.mk
+++ b/package/android-tools/android-tools.mk
@@ -12,6 +12,16 @@ HOST_ANDROID_TOOLS_EXTRA_DOWNLOADS = $(ANDROID_TOOLS_EXTRA_DOWNLOADS)
 ANDROID_TOOLS_LICENSE = Apache-2.0
 ANDROID_TOOLS_LICENSE_FILES = debian/copyright
 
+# Uses __atomic_fetch_add_4. In adbd.mk Makefile there is no hunk to the end of
+# linking command. So need to add -latomic to LIBS using sed to provide
+# -latomic at the correct place in the linking command.
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+define ANDROID_TOOLS_FIX_MAKEFILE
+	$(SED) 's/-lz -lcrypt/-lz -lcrypt -latomic/' $(@D)/debian/makefiles/adbd.mk
+endef
+ANDROID_TOOLS_POST_PATCH_HOOKS = ANDROID_TOOLS_FIX_MAKEFILE
+endif
+
 # Extract the Debian tarball inside the sources
 define ANDROID_TOOLS_DEBIAN_EXTRACT
 	$(call suitable-extractor,$(notdir $(ANDROID_TOOLS_EXTRA_DOWNLOADS))) \
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-14 21:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-04 15:39 [Buildroot] [PATCH] package/android-tools: fix static build failure due to missing -latomic Giulio Benetti
2019-04-04 20:45 ` Thomas Petazzoni
     [not found]   ` <699842f1-d9e3-dd02-4770-e8a10499194b@micronovasrl.com>
2019-04-07 21:55     ` Giulio Benetti
2019-04-08  7:18       ` Thomas Petazzoni
2019-04-08  7:43         ` Giulio Benetti
2019-04-08  9:04           ` Thomas Petazzoni
2019-04-08 15:43             ` [Buildroot] [PATCH] package/android-tools: fix static linking failure due to lack of deps Giulio Benetti
2019-04-08 20:34               ` Thomas Petazzoni
2019-04-14 21:19               ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.