Linux FSCRYPT development
 help / color / mirror / Atom feed
* [fsverity-utils PATCHv2] Makefile: improve the cc-option compatibility
@ 2020-08-03  3:07 Po-Hsu Lin
  2020-08-03 16:34 ` Eric Biggers
  0 siblings, 1 reply; 2+ messages in thread
From: Po-Hsu Lin @ 2020-08-03  3:07 UTC (permalink / raw)
  To: linux-fscrypt; +Cc: po-hsu.lin

The build on Ubuntu Xenial with GCC 5.4.0 will fail with:
    cc: error: unrecognized command line option ‘-Wimplicit-fallthrough’

This unsupported flag is not skipped as expected.

It is because of the /bin/sh shell on Ubuntu, DASH, which does not
support this &> redirection. Use 2>&1 to solve this problem.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index e0a3938..ec23ed6 100644
--- a/Makefile
+++ b/Makefile
@@ -32,7 +32,7 @@
 #
 ##############################################################################
 
-cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
+cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null > /dev/null 2>&1; \
 	      then echo $(1); fi)
 
 CFLAGS ?= -O2 -Wall -Wundef					\
-- 
2.17.1


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

* Re: [fsverity-utils PATCHv2] Makefile: improve the cc-option compatibility
  2020-08-03  3:07 [fsverity-utils PATCHv2] Makefile: improve the cc-option compatibility Po-Hsu Lin
@ 2020-08-03 16:34 ` Eric Biggers
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Biggers @ 2020-08-03 16:34 UTC (permalink / raw)
  To: Po-Hsu Lin; +Cc: linux-fscrypt

On Mon, Aug 03, 2020 at 11:07:36AM +0800, Po-Hsu Lin wrote:
> The build on Ubuntu Xenial with GCC 5.4.0 will fail with:
>     cc: error: unrecognized command line option ‘-Wimplicit-fallthrough’
> 
> This unsupported flag is not skipped as expected.
> 
> It is because of the /bin/sh shell on Ubuntu, DASH, which does not
> support this &> redirection. Use 2>&1 to solve this problem.
> 
> Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index e0a3938..ec23ed6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -32,7 +32,7 @@
>  #
>  ##############################################################################
>  
> -cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null &>/dev/null; \
> +cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null > /dev/null 2>&1; \
>  	      then echo $(1); fi)
>  
>  CFLAGS ?= -O2 -Wall -Wundef					\
> -- 
> 2.17.1
> 

Thanks, applied.

- Eric

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

end of thread, other threads:[~2020-08-03 16:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03  3:07 [fsverity-utils PATCHv2] Makefile: improve the cc-option compatibility Po-Hsu Lin
2020-08-03 16:34 ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox