From 8d2df1deb8ddf2965dba5859ff9c8cf8dc1ef42d Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Sun, 18 Aug 2019 01:27:02 -0400 Subject: [PATCH] use CC as CXX to make sure LTO is compatible --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d8e2600..e2530c0 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,10 @@ SOURCES := chacha.c h_malloc.c memory.c pages.c random.c util.c OBJECTS := $(SOURCES:.c=.o) ifeq ($(CONFIG_CXX_ALLOCATOR),true) - LDLIBS += -lstdc++ + # make sure LTO is compatible in case CC and CXX don't match (such as clang and g++) + CXX := $(CC) + LDLIBS += -lstdc++ -shared-libgcc + SOURCES += new.cc OBJECTS += new.o endif