blob: 6ec44a8079ad8bb5ddf792d9305c717088a0aa57 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
diff --git a/Makefile b/Makefile
index 54ee978..a50ee9a 100644
--- a/Makefile
+++ b/Makefile
@@ -46,8 +46,8 @@ ifeq ($(USE_SYSTEM_GTEST),no)
GTEST_CXXFLAGS := -std=gnu++14
GTEST_LIBS := gtest.a
else
-GTEST_CXXFLAGS := $(shell gtest-config --cxxflags)
-GTEST_LIBS := $(shell gtest-config --libs)
+GTEST_CXXFLAGS ?= $(shell gtest-config --cxxflags)
+GTEST_LIBS ?= $(shell gtest-config --libs)
endif
CORE_OBJECT_FILES := libminijail.o syscall_filter.o signal_handler.o \
@@ -73,6 +73,7 @@ clean: CLEAN(minijail0)
CC_LIBRARY(libminijail.so): LDLIBS += -lcap
+CC_LIBRARY(libminijail.so): LDFLAGS += -Wl,-soname,libminijail.so
CC_LIBRARY(libminijail.so): $(CORE_OBJECT_FILES)
clean: CLEAN(libminijail.so)
@@ -91,6 +92,7 @@ TEST(CXX_BINARY(libminijail_unittest)): CC_LIBRARY(libminijailpreload.so)
CC_LIBRARY(libminijailpreload.so): LDLIBS += -lcap -ldl
+CC_LIBRARY(libminijailpreload.so): LDFLAGS += -Wl,-soname,libminijail.so
CC_LIBRARY(libminijailpreload.so): libminijailpreload.o $(CORE_OBJECT_FILES)
clean: CLEAN(libminijailpreload.so)
diff --git a/common.mk b/common.mk
index 77879d8..1cd815b 100644
--- a/common.mk
+++ b/common.mk
@@ -323,7 +323,7 @@ COMMON_CFLAGS := -Wall -Wunused -Wno-unused-parameter -Werror -Wformat=2 \
-fno-strict-aliasing $(SSP_CFLAGS) -O1
CXXFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CXXDRIVER)) -std=gnu++14
CFLAGS += $(COMMON_CFLAGS) $(COMMON_CFLAGS-$(CDRIVER)) -std=gnu11
-CPPFLAGS += -D_FORTIFY_SOURCE=2
+CPPFLAGS +=
# Enable large file support.
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
|