Skip to content

Commit

Permalink
utest: test fork safety on OpenMP >= 5
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aitap committed Jun 10, 2023
1 parent 43e81c3 commit 570d6ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Makefile.prebuild
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ ifeq ($(TARGET), C910V)
TARGET_FLAGS = -march=rv64gcv0p7_zfh_xtheadc -mabi=lp64d
endif

ifeq ($(USE_OPENMP), 1)
EXFLAGS += -fopenmp
endif

all: getarch_2nd
./getarch_2nd 0 >> $(TARGET_MAKE)
./getarch_2nd 1 >> $(TARGET_CONF)
Expand Down
4 changes: 4 additions & 0 deletions getarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,10 @@ printf("ELF_VERSION=2\n");
printf("MAKEFLAGS += -j %d\n", get_num_cores());
#endif

#if defined(_OPENMP)
printf("OPENMP_VERSION = %d\n", _OPENMP);
#endif

break;

case '1' : /* For config.h */
Expand Down
2 changes: 1 addition & 1 deletion utest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ endif
#this does not work with OpenMP nor with native Windows or Android threads
# FIXME TBD if this works on OSX, SunOS, POWER and zarch
ifeq ($(OSNAME), $(filter $(OSNAME),Linux CYGWIN_NT))
ifneq ($(USE_OPENMP), 1)
ifeq ($(shell test x"$(USE_OPENMP)" -ne x1 -o $(OPENMP_VERSION) -ge 201811 && echo 1), 1)
OBJS += test_fork.o
endif
OBJS += test_post_fork.o
Expand Down

0 comments on commit 570d6ba

Please sign in to comment.