| 1 |
From: Emmanuel Arias <[email protected]> |
| 2 |
Date: Thu, 23 Jun 2022 10:26:16 -0300 |
| 3 |
Subject: Add CXXFLAGS, CPPFLAGS and LDFLAGS in the build |
| 4 |
|
| 5 |
Add the CXXFLAGS, CPPFLAGS and LDFLAGS flags in build to solve |
| 6 |
hardening issues. |
| 7 |
|
| 8 |
Rename the upstream CXXFLAGS to SCALENECXXFLAGS to used th |
| 9 |
Debian CXXFLAGS and the upstream flags. |
| 10 |
--- |
| 11 |
GNUmakefile | 2 +- |
| 12 |
1 file changed, 1 insertion(+), 1 deletion(-) |
| 13 |
|
| 14 |
--- a/GNUmakefile |
| 15 |
+++ b/GNUmakefile |
| 16 |
@@ -7,7 +7,7 @@ |
| 17 |
.PHONY: black clang-format prettier format upload vendor-deps |
| 18 |
|
| 19 |
# CXXFLAGS = -std=c++14 -g -O0 # FIXME |
| 20 |
-CXXFLAGS = -std=c++14 -Wall -g -O3 -DNDEBUG -D_REENTRANT=1 -DHL_USE_XXREALLOC=1 -pipe -fno-builtin-malloc -fvisibility=hidden -Wno-unused-result |
| 21 |
+SCALENECXXFLAGS = -std=c++14 -Wall -g -O3 -DNDEBUG -D_REENTRANT=1 -DHL_USE_XXREALLOC=1 -pipe -fno-builtin-malloc -fvisibility=hidden -Wno-unused-result |
| 22 |
# CXX = g++ |
| 23 |
|
| 24 |
INCLUDES = -Isrc -Isrc/include |
| 25 |
@@ -24,14 +24,14 @@ |
| 26 |
else |
| 27 |
ARCH := -arch x86_64 |
| 28 |
endif |
| 29 |
- CXXFLAGS := -std=c++14 -Wall -g -O3 -DNDEBUG -D_REENTRANT=1 -DHL_USE_XXREALLOC=1 -pipe -fno-builtin-malloc -fvisibility=hidden -flto -ftls-model=initial-exec -ftemplate-depth=1024 $(ARCH) -compatibility_version 1 -current_version 1 -dynamiclib |
| 30 |
+ SCALENECXXFLAGS := -std=c++14 -Wall -g -O3 -DNDEBUG -D_REENTRANT=1 -DHL_USE_XXREALLOC=1 -pipe -fno-builtin-malloc -fvisibility=hidden -flto -ftls-model=initial-exec -ftemplate-depth=1024 $(ARCH) -compatibility_version 1 -current_version 1 -dynamiclib |
| 31 |
SED_INPLACE = -i '' |
| 32 |
|
| 33 |
else # non-Darwin |
| 34 |
LIBFILE := lib$(LIBNAME).so |
| 35 |
WRAPPER := vendor/Heap-Layers/wrappers/gnuwrapper.cpp |
| 36 |
INCLUDES := $(INCLUDES) -I/usr/include/nptl |
| 37 |
- CXXFLAGS := $(CXXFLAGS) -fPIC -shared -Bsymbolic |
| 38 |
+ SCALENECXXFLAGS := $(SCALENECXXFLAGS) -fPIC -shared -Bsymbolic |
| 39 |
RPATH_FLAGS := |
| 40 |
SED_INPLACE = -i |
| 41 |
|
| 42 |
@@ -44,7 +44,7 @@ |
| 43 |
all: $(OUTDIR)/$(LIBFILE) |
| 44 |
|
| 45 |
$(OUTDIR)/$(LIBFILE): vendor-deps $(SRC) $(C_SOURCES) GNUmakefile |
| 46 |
- $(CXX) $(CXXFLAGS) $(INCLUDES) $(SRC) -o $(OUTDIR)/$(LIBFILE) -ldl -lpthread |
| 47 |
+ $(CXX) $(SCALENECXXFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) $(INCLUDES) $(SRC) -o $(OUTDIR)/$(LIBFILE) -ldl -lpthread |
| 48 |
|
| 49 |
clean: |
| 50 |
rm -f $(OUTDIR)/$(LIBFILE) scalene/*.so scalene/*.dylib |