use CC as CXX to make sure LTO is compatible

pull/103/head
Daniel Micay 2019-08-18 01:27:02 -04:00
parent 1bc201c4c1
commit 8d2df1deb8
1 changed files with 4 additions and 1 deletions

View File

@ -40,7 +40,10 @@ SOURCES := chacha.c h_malloc.c memory.c pages.c random.c util.c
OBJECTS := $(SOURCES:.c=.o) OBJECTS := $(SOURCES:.c=.o)
ifeq ($(CONFIG_CXX_ALLOCATOR),true) 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 SOURCES += new.cc
OBJECTS += new.o OBJECTS += new.o
endif endif