From 641876a20aae4ff1b3903791927f7d17654d7d2d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 31 Jul 2019 16:30:45 +0930 Subject: [PATCH] ccan: update to latest. configurator failed under clang: checking for #pragma omp and -fopenmp support... ccan/tools/configurator/configurator: Test for HAVE_OPENMP failed with 32512: ./configurator.out: error while loading shared libraries: libomp.so: cannot open shared object file: No such file or directory Signed-off-by: Rusty Russell --- ccan/README | 2 +- ccan/ccan/bitmap/bitmap.c | 14 +++++++------- ccan/ccan/bitmap/bitmap.h | 3 +++ ccan/tools/configurator/configurator.c | 2 +- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ccan/README b/ccan/README index 8b70b90f2..399d33655 100644 --- a/ccan/README +++ b/ccan/README @@ -1,3 +1,3 @@ CCAN imported from http://ccodearchive.net. -CCAN version: init-2481-gce4660aa +CCAN version: init-2483-g920ca95d diff --git a/ccan/ccan/bitmap/bitmap.c b/ccan/ccan/bitmap/bitmap.c index d812af6a2..d254b20e5 100644 --- a/ccan/ccan/bitmap/bitmap.c +++ b/ccan/ccan/bitmap/bitmap.c @@ -13,8 +13,8 @@ void bitmap_zero_range(bitmap *bitmap, unsigned long n, unsigned long m) { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); @@ -38,8 +38,8 @@ void bitmap_fill_range(bitmap *bitmap, unsigned long n, unsigned long m) { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); @@ -65,7 +65,7 @@ static int bitmap_clz(bitmap_word w) return __builtin_clzl(w); #else int lz = 0; - bitmap_word mask = 1UL << (BITMAP_WORD_BITS - 1); + bitmap_word mask = (bitmap_word)1 << (BITMAP_WORD_BITS - 1); while (!(w & mask)) { lz++; @@ -81,8 +81,8 @@ unsigned long bitmap_ffs(const bitmap *bitmap, { unsigned long an = BIT_ALIGN_UP(n); unsigned long am = BIT_ALIGN_DOWN(m); - bitmap_word headmask = -1ULL >> (n % BITMAP_WORD_BITS); - bitmap_word tailmask = ~(-1ULL >> (m % BITMAP_WORD_BITS)); + bitmap_word headmask = BITMAP_WORD_1 >> (n % BITMAP_WORD_BITS); + bitmap_word tailmask = ~(BITMAP_WORD_1 >> (m % BITMAP_WORD_BITS)); assert(m >= n); diff --git a/ccan/ccan/bitmap/bitmap.h b/ccan/ccan/bitmap/bitmap.h index 9e6c2bbc5..beeb1e953 100644 --- a/ccan/ccan/bitmap/bitmap.h +++ b/ccan/ccan/bitmap/bitmap.h @@ -15,6 +15,9 @@ typedef unsigned long bitmap_word; #define BITMAP_NWORDS(_n) \ (((_n) + BITMAP_WORD_BITS - 1) / BITMAP_WORD_BITS) +#define BITMAP_WORD_0 (0) +#define BITMAP_WORD_1 ((bitmap_word)-1UL) + /* * We wrap each word in a structure for type checking. */ diff --git a/ccan/tools/configurator/configurator.c b/ccan/tools/configurator/configurator.c index d676b8823..d99d4a003 100644 --- a/ccan/tools/configurator/configurator.c +++ b/ccan/tools/configurator/configurator.c @@ -431,7 +431,7 @@ static const struct test base_tests[] = { " return i + 1;\n" "}" }, { "HAVE_OPENMP", "#pragma omp and -fopenmp support", - "INSIDE_MAIN", NULL, NULL, + "INSIDE_MAIN|EXECUTE|MAY_NOT_COMPILE", NULL, NULL, "int i;\n" "#pragma omp parallel for\n" "for(i = 0; i < 0; i++) {};\n"