From 344f54f55937df66897995bcea417534ece69ca3 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Mon, 2 Nov 2020 16:46:49 +0100 Subject: [PATCH 1/4] Downgrade to dune.2.6 and explicit dependencies of C files into the freestanding/dune file --- digestif.opam | 2 +- dune-project | 2 +- freestanding/Makefile | 2 +- freestanding/dune | 7 +++---- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/digestif.opam b/digestif.opam index a943ba8..d7e4c95 100644 --- a/digestif.opam +++ b/digestif.opam @@ -39,7 +39,7 @@ install: [ depends: [ "ocaml" {>= "4.03.0"} - "dune" {>= "2.7.0"} + "dune" {>= "2.6.0"} "conf-pkg-config" {build} "eqaf" "base-bytes" diff --git a/dune-project b/dune-project index c14808c..93d5986 100644 --- a/dune-project +++ b/dune-project @@ -1,2 +1,2 @@ -(lang dune 2.7) +(lang dune 2.6) (name digestif) diff --git a/freestanding/Makefile b/freestanding/Makefile index ceb6f84..32239d5 100644 --- a/freestanding/Makefile +++ b/freestanding/Makefile @@ -11,7 +11,7 @@ libdigestif_freestanding_stubs.a: else CC ?= cc FREESTANDING_CFLAGS := $(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --cflags ocaml-freestanding) -CFLAGS := -O3 $(FREESTANDING_CFLAGS) +CFLAGS := -I../src-c/native -O3 $(FREESTANDING_CFLAGS) OBJS= blake2b.o blake2s.o md5.o ripemd160.o sha1.o sha256.o sha512.o sha3.o whirlpool.o misc.o stubs.o diff --git a/freestanding/dune b/freestanding/dune index 490b177..9e47449 100644 --- a/freestanding/dune +++ b/freestanding/dune @@ -1,9 +1,8 @@ -(copy_files# - (alias install) - (files ../src-c/native/*)) +(copy_files# ../src-c/native/*) (rule - (deps Makefile) + (deps blake2b.c blake2s.c md5.c ripemd160.c sha1.c sha256.c sha512.c sha3.c + whirlpool.c misc.c Makefile) (targets libdigestif_freestanding_stubs.a) (action (no-infer From 9bb54c8021e346f3fb1ba45c274a256ad8a68e4b Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Mon, 2 Nov 2020 16:47:15 +0100 Subject: [PATCH 2/4] Use copy_files instead multiple copies of specific files --- src-c/dune | 3 +-- src-ocaml/dune | 12 +----------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src-c/dune b/src-c/dune index e729eb3..01630b0 100644 --- a/src-c/dune +++ b/src-c/dune @@ -16,5 +16,4 @@ (include_subdirs unqualified) -(copy_files# - (files ../src/*.ml)) +(copy_files# ../src/*.ml) diff --git a/src-ocaml/dune b/src-ocaml/dune index b1733c1..40073b6 100644 --- a/src-ocaml/dune +++ b/src-ocaml/dune @@ -10,14 +10,4 @@ (flags (:standard -no-keep-locs))) -(rule - (copy# ../src/digestif_bi.ml digestif_bi.ml)) - -(rule - (copy# ../src/digestif_by.ml digestif_by.ml)) - -(rule - (copy# ../src/digestif_eq.ml digestif_eq.ml)) - -(rule - (copy# ../src/digestif_conv.ml digestif_conv.ml)) +(copy_files# ../src/*.ml) From ce373e10c93f2bc8bf9af9ccafa6a1eb3fbd5d65 Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Mon, 2 Nov 2020 17:26:08 +0100 Subject: [PATCH 3/4] Copy only C files (where header files are notified with -I) --- freestanding/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freestanding/dune b/freestanding/dune index 9e47449..9fba639 100644 --- a/freestanding/dune +++ b/freestanding/dune @@ -1,4 +1,4 @@ -(copy_files# ../src-c/native/*) +(copy_files# ../src-c/native/*.c) (rule (deps blake2b.c blake2s.c md5.c ripemd160.c sha1.c sha256.c sha512.c sha3.c From 8216aa598e7b720e0ce319d4201deb2a8724f5db Mon Sep 17 00:00:00 2001 From: Calascibetta Romain Date: Mon, 2 Nov 2020 22:06:14 +0100 Subject: [PATCH 4/4] Fix release mode and add stubs.c as a dependency to compile C artifacts --- freestanding/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freestanding/dune b/freestanding/dune index 9fba639..10853e2 100644 --- a/freestanding/dune +++ b/freestanding/dune @@ -2,7 +2,7 @@ (rule (deps blake2b.c blake2s.c md5.c ripemd160.c sha1.c sha256.c sha512.c sha3.c - whirlpool.c misc.c Makefile) + whirlpool.c misc.c stubs.c Makefile) (targets libdigestif_freestanding_stubs.a) (action (no-infer