linux-fscrypt.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Luca Boccassi <bluca@debian.org>
Cc: linux-fscrypt@vger.kernel.org,
	Luca Boccassi <luca.boccassi@microsoft.com>
Subject: Re: [PATCH v5] Allow to build and run sign/digest on Windows
Date: Mon, 21 Dec 2020 15:03:35 -0800	[thread overview]
Message-ID: <X+Epx7K/IIp08b7L@sol.localdomain> (raw)
In-Reply-To: <20201221221953.256059-1-bluca@debian.org>

On Mon, Dec 21, 2020 at 10:19:53PM +0000, Luca Boccassi wrote:
> From: Luca Boccassi <luca.boccassi@microsoft.com>
> 
> stub out the enable/measure sources.

That's not the case anymore, right?  Now those files are just omitted.

> diff --git a/Makefile b/Makefile
> index bfe83c4..d850ae3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -35,6 +35,11 @@
>  cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null > /dev/null 2>&1; \
>  	      then echo $(1); fi)
>  
> +# Support building with MinGW for minimal Windows fsverity.exe
> +ifneq ($(findstring -mingw,$(shell $(CC) -dumpmachine 2>/dev/null)),)
> +MINGW = 1
> +endif

It would be helpful if this comment mentioned that libfsverity isn't built as a
proper Windows library.  At the moment it is not very clear.

Also, a note in the README about the Windows support would be helpful.

> -override CPPFLAGS := -Iinclude -D_FILE_OFFSET_BITS=64 $(CPPFLAGS)
> +override CPPFLAGS := -Iinclude -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE $(CPPFLAGS)

The _GNU_SOURCE change should go in a separate patch.

>  # Rebuild if a user-specified setting that affects the build changed.
>  .build-config: FORCE
> @@ -87,9 +97,9 @@ CFLAGS          += $(shell "$(PKGCONF)" libcrypto --cflags 2>/dev/null || echo)
>  # If we are dynamically linking, when running tests we need to override
>  # LD_LIBRARY_PATH as no RPATH is set
>  ifdef USE_SHARED_LIB
> -RUN_FSVERITY    = LD_LIBRARY_PATH=./ ./fsverity
> +RUN_FSVERITY    = LD_LIBRARY_PATH=./ $(TEST_WRAPPER_PROG) ./fsverity$(EXEEXT)
>  else
> -RUN_FSVERITY    = ./fsverity
> +RUN_FSVERITY    = $(TEST_WRAPPER_PROG) ./fsverity$(EXEEXT)
>  endif

Adding $(TEST_WRAPPER_PROG) here should go in a separate patch too.  It also
affects valgrind testing on Linux.

>  # Link the fsverity program
>  ifdef USE_SHARED_LIB
> -fsverity: $(FSVERITY_PROG_OBJ) libfsverity.so
> +fsverity$(EXEEXT): $(FSVERITY_PROG_OBJ) libfsverity.so

It would be easier to read if there was a variable $(FSVERITY) that had the
value of fsverity$(EXEEXT).

>  # Link the test programs
>  $(TEST_PROGRAMS): %: programs/%.o $(PROG_COMMON_OBJ) libfsverity.a
> @@ -184,25 +200,25 @@ test_programs:$(TEST_PROGRAMS)

This still doesn't actually add the .exe extension to the test programs.
Try 'make CC=x86_64-w64-mingw32-gcc help'; the targets to build the test
programs don't have the .exe extension.

- Eric

  reply	other threads:[~2020-12-21 23:04 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:47 [fsverity-utils PATCH v2 1/2] Remove unneeded includes luca.boccassi
2020-12-17 14:47 ` [fsverity-utils PATCH v2 2/2] Allow to build and run sign/digest on Windows luca.boccassi
2020-12-17 18:32   ` Eric Biggers
2020-12-17 18:44     ` Luca Boccassi
2020-12-17 19:05       ` Eric Biggers
2020-12-17 19:12         ` Luca Boccassi
2020-12-17 19:20           ` Eric Biggers
2020-12-17 19:26             ` Luca Boccassi
2020-12-17 19:16 ` [fsverity-utils PATCH v3 1/2] Remove unneeded includes luca.boccassi
2020-12-17 19:16   ` [fsverity-utils PATCH v3 2/2] Allow to build and run sign/digest on Windows luca.boccassi
2020-12-17 19:25 ` [fsverity-utils PATCH v4 1/2] Remove unneeded includes luca.boccassi
2020-12-17 19:25   ` [fsverity-utils PATCH v4 2/2] Allow to build and run sign/digest on Windows luca.boccassi
2020-12-21 21:40     ` Eric Biggers
2020-12-21 22:23       ` Luca Boccassi
2020-12-21 22:19     ` [PATCH v5] " Luca Boccassi
2020-12-21 23:03       ` Eric Biggers [this message]
2020-12-21 23:26         ` Luca Boccassi
2020-12-21 23:24       ` [PATCH v6 1/3] Move -D_GNU_SOURCE to CPPFLAGS Luca Boccassi
2020-12-21 23:24         ` [PATCH v6 2/3] Wrap ./fsverity in TEST_WRAPPER_PROG too Luca Boccassi
2020-12-21 23:24         ` [PATCH v6 3/3] Allow to build and run sign/digest on Windows Luca Boccassi
2020-12-21 23:53           ` Eric Biggers
2020-12-21 23:57             ` Luca Boccassi
2020-12-22  0:03               ` Eric Biggers
2020-12-22  0:11                 ` Luca Boccassi
2020-12-22  0:00         ` [PATCH v6 1/3] Move -D_GNU_SOURCE to CPPFLAGS Eric Biggers
2020-12-22  0:12           ` Luca Boccassi
2020-12-22  0:10         ` [PATCH v7 " Luca Boccassi
2020-12-22  0:10           ` [PATCH v7 2/3] Wrap ./fsverity in TEST_WRAPPER_PROG too Luca Boccassi
2020-12-22 18:41             ` Eric Biggers
2020-12-22  0:10           ` [PATCH v7 3/3] Allow to build and run sign/digest on Windows Luca Boccassi
2020-12-22 18:40             ` Eric Biggers
2020-12-22  8:21           ` [PATCH v7 1/3] Move -D_GNU_SOURCE to CPPFLAGS Eric Biggers
2020-12-22 18:40           ` Eric Biggers
2020-12-21 21:32   ` [fsverity-utils PATCH v4 1/2] Remove unneeded includes Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X+Epx7K/IIp08b7L@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=bluca@debian.org \
    --cc=linux-fscrypt@vger.kernel.org \
    --cc=luca.boccassi@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).