mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-19 22:10:19 +02:00
Do not include bits/functexcept.h when building with libc++
This header exists only in GCC's libstdc++. If we are building on a system using exclusively LLVM's libc++, compilation will fail.
This commit is contained in:
parent
0d6d63cbe7
commit
aa63cf1d19
4 changed files with 10 additions and 1 deletions
7
Makefile
7
Makefile
|
@ -44,7 +44,11 @@ OBJECTS := $(SOURCES:.c=.o)
|
|||
ifeq ($(CONFIG_CXX_ALLOCATOR),true)
|
||||
# make sure LTO is compatible in case CC and CXX don't match (such as clang and g++)
|
||||
CXX := $(CC)
|
||||
LDLIBS += -lstdc++
|
||||
ifeq ($(CONFIG_USE_LIBCXX),true)
|
||||
LDLIBS += -lc++
|
||||
else
|
||||
LDLIBS += -lstdc++
|
||||
endif
|
||||
|
||||
SOURCES += new.cc
|
||||
OBJECTS += new.o
|
||||
|
@ -85,6 +89,7 @@ ifeq (,$(filter $(CONFIG_STATS),true false))
|
|||
endif
|
||||
|
||||
CPPFLAGS += \
|
||||
-DCONFIG_USE_LIBCXX=$(CONFIG_USE_LIBCXX) \
|
||||
-DCONFIG_SEAL_METADATA=$(CONFIG_SEAL_METADATA) \
|
||||
-DZERO_ON_FREE=$(CONFIG_ZERO_ON_FREE) \
|
||||
-DWRITE_AFTER_FREE_CHECK=$(CONFIG_WRITE_AFTER_FREE_CHECK) \
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
CONFIG_WERROR := true
|
||||
CONFIG_NATIVE := true
|
||||
CONFIG_CXX_ALLOCATOR := true
|
||||
CONFIG_USE_LIBCXX := false
|
||||
CONFIG_UBSAN := false
|
||||
CONFIG_SEAL_METADATA := false
|
||||
CONFIG_ZERO_ON_FREE := true
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
CONFIG_WERROR := true
|
||||
CONFIG_NATIVE := true
|
||||
CONFIG_CXX_ALLOCATOR := true
|
||||
CONFIG_USE_LIBCXX := false
|
||||
CONFIG_UBSAN := false
|
||||
CONFIG_SEAL_METADATA := false
|
||||
CONFIG_ZERO_ON_FREE := true
|
||||
|
|
2
new.cc
2
new.cc
|
@ -1,4 +1,6 @@
|
|||
#if !defined(__clang__) || !CONFIG_USE_LIBCXX
|
||||
#include <bits/functexcept.h>
|
||||
#endif
|
||||
#include <new>
|
||||
|
||||
#include "h_malloc.h"
|
||||
|
|
Loading…
Add table
Reference in a new issue