Skip to content

Commit 570d6ba

Browse files
committed
utest: test fork safety on OpenMP >= 5
In addition to testing fork safety on non-OpenMP builds, test it on OpenMP >= 5.0, where we get the ability to release the locks at fork() time.
1 parent 43e81c3 commit 570d6ba

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Diff for: Makefile.prebuild

+4
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ ifeq ($(TARGET), C910V)
5555
TARGET_FLAGS = -march=rv64gcv0p7_zfh_xtheadc -mabi=lp64d
5656
endif
5757

58+
ifeq ($(USE_OPENMP), 1)
59+
EXFLAGS += -fopenmp
60+
endif
61+
5862
all: getarch_2nd
5963
./getarch_2nd 0 >> $(TARGET_MAKE)
6064
./getarch_2nd 1 >> $(TARGET_CONF)

Diff for: getarch.c

+4
Original file line numberDiff line numberDiff line change
@@ -1941,6 +1941,10 @@ printf("ELF_VERSION=2\n");
19411941
printf("MAKEFLAGS += -j %d\n", get_num_cores());
19421942
#endif
19431943

1944+
#if defined(_OPENMP)
1945+
printf("OPENMP_VERSION = %d\n", _OPENMP);
1946+
#endif
1947+
19441948
break;
19451949

19461950
case '1' : /* For config.h */

Diff for: utest/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ endif
2626
#this does not work with OpenMP nor with native Windows or Android threads
2727
# FIXME TBD if this works on OSX, SunOS, POWER and zarch
2828
ifeq ($(OSNAME), $(filter $(OSNAME),Linux CYGWIN_NT))
29-
ifneq ($(USE_OPENMP), 1)
29+
ifeq ($(shell test x"$(USE_OPENMP)" -ne x1 -o $(OPENMP_VERSION) -ge 201811 && echo 1), 1)
3030
OBJS += test_fork.o
3131
endif
3232
OBJS += test_post_fork.o

0 commit comments

Comments
 (0)