Skip to content

Commit b0f201f

Browse files
Fix USE_TLS=1 when building with Oracle DeveloperStudio
* We need to use the DeveloperStudio specific `-mt` flag * Fix a makefile race when building our tests Signed-off-by: michael-grunder <michael.grunder@gmail.com>
1 parent a87338f commit b0f201f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c | $(OBJ_DIR)
267267
$(OBJ_DIR)/%.o: $(TEST_DIR)/%.c | $(OBJ_DIR)
268268
$(CC) -std=c99 -pedantic $(REAL_CFLAGS) -I$(INCLUDE_DIR) -I$(SDS_INCLUDE_DIR) -I$(DICT_INCLUDE_DIR) -I$(SRC_DIR) -MMD -MP -c $< -o $@
269269

270-
$(TEST_DIR)/%: $(OBJ_DIR)/%.o $(STLIBNAME)
270+
$(TEST_DIR)/%: $(OBJ_DIR)/%.o $(STLIBNAME) $(TLS_STLIB)
271271
$(CC) -o $@ $< $(RDMA_STLIB) $(STLIBNAME) $(TLS_STLIB) $(REAL_LDFLAGS) $(TEST_LDFLAGS)
272272

273273
$(OBJ_DIR):
@@ -287,7 +287,9 @@ pkgconfig: $(PKGCONFNAME) $(TLS_PKGCONF) $(RDMA_PKGCONF)
287287
TEST_LDFLAGS = $(TLS_LDFLAGS) $(RDMA_LDFLAGS)
288288
ifeq ($(USE_TLS),1)
289289
# Tests need pthreads if TLS is enabled, but only add it once
290-
ifeq (,$(findstring -pthread,$(REAL_LDFLAGS) $(TEST_LDFLAGS)))
290+
ifeq ($(HAVE_SUN_CC),1)
291+
TEST_LDFLAGS += -mt
292+
else ifeq (,$(findstring -pthread,$(REAL_LDFLAGS) $(TEST_LDFLAGS)))
291293
TEST_LDFLAGS += -pthread
292294
endif
293295
endif

0 commit comments

Comments
 (0)