Skip to contentSkip to conversation

samples: fanotify: add CC_CAN_LINK dependency

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 29, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 samples: fanotify: add CC_CAN_LINK dependency

From: Arnd Bergmann <[email protected]>

When using a cross tools that only works for kernels, the newn sample can end up with a link failure such as:

/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [/git/arm-soc/scripts/Makefile.userprogs:28: samples/fanotify/fs-monitor] Error 1

Add a Kconfig dependency, similar to the one we use for other samples.

Fixes 5451093081db ("samples: Add fs error monitoring example")
---
 samples/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/Kconfig +1 -1
index 147a16dafaf8..83f12c1e9ca6 100644
@@ -122,7 +122,7 @@ config SAMPLE_CONNECTOR
 
 config SAMPLE_FANOTIFY_ERROR
 	bool "Build fanotify error monitoring sample"
-	depends on FANOTIFY
+	depends on CC_CAN_LINK && FANOTIFY
 	help
 	  When enabled, this builds an example code that uses the
 	  FAN_FS_ERROR fanotify mechanism to monitor filesystem
Signature · 1 line
2.29.2
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When using a cross tools that only works for kernels, the newn sample can end up with a link failure such as:

/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [/git/arm-soc/scripts/Makefile.userprogs:28: samples/fanotify/fs-monitor] Error 1

Quoted 5 lines

Add a Kconfig dependency, similar to the one we use for other samples.

Fixes 5451093081db ("samples: Add fs error monitoring example")

Hi Arnd,

This was reported by Guenter Roeck yesterday, I sent a patch for it here:

https://lore.kernel.org/linux-fsdevel/[email protected]/

Quoted 17 lines
---
 samples/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
samples/Kconfig +1 -1
index 147a16dafaf8..83f12c1e9ca6 100644
@@ -122,7 +122,7 @@ config SAMPLE_CONNECTOR
 
 config SAMPLE_FANOTIFY_ERROR
 	bool "Build fanotify error monitoring sample"
-	depends on FANOTIFY
+	depends on CC_CAN_LINK && FANOTIFY
 	help
 	  When enabled, this builds an example code that uses the
 	  FAN_FS_ERROR fanotify mechanism to monitor filesystem
Signature · 1 line
Gabriel Krisman Bertazi