Linux-FSCrypt Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] Makefile: improve the cc-option compatibility
@ 2020-07-30  9:35 Po-Hsu Lin
  2020-07-30 13:21 ` Po-Hsu Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Po-Hsu Lin @ 2020-07-30  9:35 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 7d7247c..a4ce55a 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,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.25.1


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

* Re: [PATCH] Makefile: improve the cc-option compatibility
  2020-07-30  9:35 [PATCH] Makefile: improve the cc-option compatibility Po-Hsu Lin
@ 2020-07-30 13:21 ` Po-Hsu Lin
  2020-08-01 18:12   ` Eric Biggers
  0 siblings, 1 reply; 4+ messages in thread
From: Po-Hsu Lin @ 2020-07-30 13:21 UTC (permalink / raw)
  To: linux-fscrypt

BTW this is for fsverity-utils.

I should put a [fsverity-utils] in the title, sorry about this.
I can resubmit one if you need.

Thank you
PHLin

On Thu, Jul 30, 2020 at 5:35 PM Po-Hsu Lin <po-hsu.lin@canonical.com> 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 7d7247c..a4ce55a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -27,7 +27,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.25.1
>

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

* Re: [PATCH] Makefile: improve the cc-option compatibility
  2020-07-30 13:21 ` Po-Hsu Lin
@ 2020-08-01 18:12   ` Eric Biggers
  2020-08-03  3:09     ` Po-Hsu Lin
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Biggers @ 2020-08-01 18:12 UTC (permalink / raw)
  To: Po-Hsu Lin; +Cc: linux-fscrypt

On Thu, Jul 30, 2020 at 09:21:38PM +0800, Po-Hsu Lin wrote:
> BTW this is for fsverity-utils.
> 
> I should put a [fsverity-utils] in the title, sorry about this.
> I can resubmit one if you need.
> 
> Thank you
> PHLin
> 
> On Thu, Jul 30, 2020 at 5:35 PM Po-Hsu Lin <po-hsu.lin@canonical.com> 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 7d7247c..a4ce55a 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -27,7 +27,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                                    \
> > --

Looks good, thanks!  I'll also want to add a test for building with dash to
scripts/run-tests.sh, but I can do that.

Note that we've just changed the license of fsverity-utils to the MIT license.
Can you rebase onto the latest master branch (commit ab794fd56511) and resend to
indicate that you agree?  And yes, I suggest "[fsverity-utils PATCH]", as this
mailing list is mostly used for kernel patches.  Thanks!

- Eric

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

* Re: [PATCH] Makefile: improve the cc-option compatibility
  2020-08-01 18:12   ` Eric Biggers
@ 2020-08-03  3:09     ` Po-Hsu Lin
  0 siblings, 0 replies; 4+ messages in thread
From: Po-Hsu Lin @ 2020-08-03  3:09 UTC (permalink / raw)
  To: Eric Biggers; +Cc: linux-fscrypt

OK no problem,
I will send another one to add this subject format suggestion to the
Contributing section in README.md.

Thank you.
PHLin

On Sun, Aug 2, 2020 at 2:12 AM Eric Biggers <ebiggers@kernel.org> wrote:
>
> On Thu, Jul 30, 2020 at 09:21:38PM +0800, Po-Hsu Lin wrote:
> > BTW this is for fsverity-utils.
> >
> > I should put a [fsverity-utils] in the title, sorry about this.
> > I can resubmit one if you need.
> >
> > Thank you
> > PHLin
> >
> > On Thu, Jul 30, 2020 at 5:35 PM Po-Hsu Lin <po-hsu.lin@canonical.com> 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 7d7247c..a4ce55a 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -27,7 +27,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                                    \
> > > --
>
> Looks good, thanks!  I'll also want to add a test for building with dash to
> scripts/run-tests.sh, but I can do that.
>
> Note that we've just changed the license of fsverity-utils to the MIT license.
> Can you rebase onto the latest master branch (commit ab794fd56511) and resend to
> indicate that you agree?  And yes, I suggest "[fsverity-utils PATCH]", as this
> mailing list is mostly used for kernel patches.  Thanks!
>
> - Eric

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

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-30  9:35 [PATCH] Makefile: improve the cc-option compatibility Po-Hsu Lin
2020-07-30 13:21 ` Po-Hsu Lin
2020-08-01 18:12   ` Eric Biggers
2020-08-03  3:09     ` Po-Hsu Lin

Linux-FSCrypt Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-fscrypt/0 linux-fscrypt/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-fscrypt linux-fscrypt/ https://lore.kernel.org/linux-fscrypt \
		linux-fscrypt@vger.kernel.org
	public-inbox-index linux-fscrypt

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-fscrypt


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git