diff mbox

[1/2] nvme: fix libuuid test when cross compiling

Message ID f2563e1cd77f4d5ca181a015d57d36ea3f561bc7.1502261950.git.baruch@tkos.co.il
State Accepted
Headers show

Commit Message

Baruch Siach Aug. 9, 2017, 6:59 a.m. UTC
Use $(LD) to test whether libuuid is installed, so that we check the target,
not the host.

Fixes:
http://autobuild.buildroot.net/results/e26/e263ffbf8947374c2aac73ab42edcbf4d9a3600a/
http://autobuild.buildroot.net/results/53b/53b2d1e0c3cdeafb980389bcfd8a10b6ca48fbc2/

Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
 ...allow-linker-override-for-cross-uuid-test.patch | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/nvme/0001-Makefile-allow-linker-override-for-cross-uuid-test.patch

Comments

Arnout Vandecappelle Aug. 9, 2017, 9:21 p.m. UTC | #1
On 09-08-17 08:59, Baruch Siach wrote:
> Use $(LD) to test whether libuuid is installed, so that we check the target,
> not the host.
> 
> Fixes:
> http://autobuild.buildroot.net/results/e26/e263ffbf8947374c2aac73ab42edcbf4d9a3600a/
> http://autobuild.buildroot.net/results/53b/53b2d1e0c3cdeafb980389bcfd8a10b6ca48fbc2/
> 
> Cc: Mamatha Inamdar <mamatha4@linux.vnet.ibm.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

 Both applied to master, thanks.

[snip]
> +-LIBUUID = $(shell ld -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
> ++LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)

 Even better would be to use pkg-config --exists uuid, but OK.

 Regards,
 Arnout
diff mbox

Patch

diff --git a/package/nvme/0001-Makefile-allow-linker-override-for-cross-uuid-test.patch b/package/nvme/0001-Makefile-allow-linker-override-for-cross-uuid-test.patch
new file mode 100644
index 000000000000..dc1c01a88824
--- /dev/null
+++ b/package/nvme/0001-Makefile-allow-linker-override-for-cross-uuid-test.patch
@@ -0,0 +1,34 @@ 
+From f926559acd1beb74dc5dc9b0e414b087110a251f Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Wed, 9 Aug 2017 09:43:12 +0300
+Subject: [PATCH] Makefile: allow linker override for cross uuid test
+
+The test to determine whether libuuid is installed uses the host 'ld' utility.
+This breaks when cross compiling, since target libraries are often different
+than host libraries.
+
+Use $(LD) instead. This allows to easily use the cross compiler linker.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+Upstream status: https://github.com/linux-nvme/nvme-cli/pull/216
+
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 3f1d9aaa890d..cc74bdd6c3e6 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ CFLAGS ?= -O2 -g -Wall -Werror
+ CFLAGS += -std=gnu99
+ CPPFLAGS += -D_GNU_SOURCE -D__CHECK_ENDIAN__
+-LIBUUID = $(shell ld -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
++LIBUUID = $(shell $(LD) -o /dev/null -luuid >/dev/null 2>&1; echo $$?)
+ NVME = nvme
+ INSTALL ?= install
+ DESTDIR =
+-- 
+2.13.2
+