Make it possible to compile with clang

This commit is contained in:
Robert Swiecki 2016-02-29 19:09:39 +01:00
parent 466f49e16d
commit 114ce7e976
2 changed files with 3 additions and 4 deletions

View File

@ -17,13 +17,12 @@
# limitations under the License.
#
CC = gcc
CC ?= gcc
CFLAGS += -O2 -g -ggdb -c -std=c11 \
-D_GNU_SOURCE \
-fstack-protector-all -Wformat -Wformat=2 -Wformat-security -fPIE -Wa,--noexecstack \
-Wall -Wextra -Werror
LD = gcc
LDFLAGS += -Wl,-z,now -Wl,-z,relro -pie
SRCS = nsjail.c cmdline.c contain.c log.c net.c subproc.c sandbox.c util.c seccomp/bpf-helper.c
@ -36,7 +35,7 @@ BIN = nsjail
all: $(BIN)
$(BIN): $(OBJS)
$(LD) -o $(BIN) $(OBJS) $(LDFLAGS)
$(CC) -o $(BIN) $(OBJS) $(LDFLAGS)
clean:
$(RM) core Makefile.bak $(OBJS) $(BIN)

View File

@ -156,7 +156,7 @@ bool containDropPrivs(struct nsjconf_t * nsjconf)
.version = _LINUX_CAPABILITY_VERSION_3,
.pid = 0,
};
const struct __user_cap_data_struct const cap_data[_LINUX_CAPABILITY_U32S_3] = {
const struct __user_cap_data_struct cap_data[_LINUX_CAPABILITY_U32S_3] = {
[0 ... (_LINUX_CAPABILITY_U32S_3 - 1)].inheritable = 0U,
[0 ... (_LINUX_CAPABILITY_U32S_3 - 1)].effective = 0U,
[0 ... (_LINUX_CAPABILITY_U32S_3 - 1)].permitted = 0U,