mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-04-20 06:20:20 +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
5
Makefile
5
Makefile
|
@ -44,7 +44,11 @@ OBJECTS := $(SOURCES:.c=.o)
|
||||||
ifeq ($(CONFIG_CXX_ALLOCATOR),true)
|
ifeq ($(CONFIG_CXX_ALLOCATOR),true)
|
||||||
# make sure LTO is compatible in case CC and CXX don't match (such as clang and g++)
|
# make sure LTO is compatible in case CC and CXX don't match (such as clang and g++)
|
||||||
CXX := $(CC)
|
CXX := $(CC)
|
||||||
|
ifeq ($(CONFIG_USE_LIBCXX),true)
|
||||||
|
LDLIBS += -lc++
|
||||||
|
else
|
||||||
LDLIBS += -lstdc++
|
LDLIBS += -lstdc++
|
||||||
|
endif
|
||||||
|
|
||||||
SOURCES += new.cc
|
SOURCES += new.cc
|
||||||
OBJECTS += new.o
|
OBJECTS += new.o
|
||||||
|
@ -85,6 +89,7 @@ ifeq (,$(filter $(CONFIG_STATS),true false))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS += \
|
CPPFLAGS += \
|
||||||
|
-DCONFIG_USE_LIBCXX=$(CONFIG_USE_LIBCXX) \
|
||||||
-DCONFIG_SEAL_METADATA=$(CONFIG_SEAL_METADATA) \
|
-DCONFIG_SEAL_METADATA=$(CONFIG_SEAL_METADATA) \
|
||||||
-DZERO_ON_FREE=$(CONFIG_ZERO_ON_FREE) \
|
-DZERO_ON_FREE=$(CONFIG_ZERO_ON_FREE) \
|
||||||
-DWRITE_AFTER_FREE_CHECK=$(CONFIG_WRITE_AFTER_FREE_CHECK) \
|
-DWRITE_AFTER_FREE_CHECK=$(CONFIG_WRITE_AFTER_FREE_CHECK) \
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
CONFIG_WERROR := true
|
CONFIG_WERROR := true
|
||||||
CONFIG_NATIVE := true
|
CONFIG_NATIVE := true
|
||||||
CONFIG_CXX_ALLOCATOR := true
|
CONFIG_CXX_ALLOCATOR := true
|
||||||
|
CONFIG_USE_LIBCXX := false
|
||||||
CONFIG_UBSAN := false
|
CONFIG_UBSAN := false
|
||||||
CONFIG_SEAL_METADATA := false
|
CONFIG_SEAL_METADATA := false
|
||||||
CONFIG_ZERO_ON_FREE := true
|
CONFIG_ZERO_ON_FREE := true
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
CONFIG_WERROR := true
|
CONFIG_WERROR := true
|
||||||
CONFIG_NATIVE := true
|
CONFIG_NATIVE := true
|
||||||
CONFIG_CXX_ALLOCATOR := true
|
CONFIG_CXX_ALLOCATOR := true
|
||||||
|
CONFIG_USE_LIBCXX := false
|
||||||
CONFIG_UBSAN := false
|
CONFIG_UBSAN := false
|
||||||
CONFIG_SEAL_METADATA := false
|
CONFIG_SEAL_METADATA := false
|
||||||
CONFIG_ZERO_ON_FREE := true
|
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>
|
#include <bits/functexcept.h>
|
||||||
|
#endif
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
#include "h_malloc.h"
|
#include "h_malloc.h"
|
||||||
|
|
Loading…
Add table
Reference in a new issue