diff --git a/capture/build/unix/debug.mk b/capture/build/unix/debug.mk index 04d925a6..a4ec6b6a 100644 --- a/capture/build/unix/debug.mk +++ b/capture/build/unix/debug.mk @@ -1,11 +1,6 @@ -ARCH := $(shell uname -m) - CFLAGS := -g3 -Wall DEFINES := -DDEBUG BUILD := debug -ifeq ($(ARCH),x86_64) -CFLAGS += -msse4.1 -endif - +include ../../../common/unix-debug.mk include build.mk diff --git a/common/unix-debug.mk b/common/unix-debug.mk new file mode 100644 index 00000000..e01aa905 --- /dev/null +++ b/common/unix-debug.mk @@ -0,0 +1,9 @@ +ARCH := $(shell uname -m) + +ifeq (1,$(shell ld.lld --version > /dev/null && echo 1 || echo 0)) +LDFLAGS += -fuse-ld=lld +endif + +ifeq ($(ARCH),x86_64) +CFLAGS += -msse4.1 +endif diff --git a/common/unix-release.mk b/common/unix-release.mk index 07ac7d62..b5a46c02 100644 --- a/common/unix-release.mk +++ b/common/unix-release.mk @@ -6,6 +6,10 @@ else LDFLAGS := -s endif +ifeq (1,$(shell ld.lld --version > /dev/null && echo 1 || echo 0)) +LDFLAGS += -fuse-ld=lld +endif + ifneq (,$(filter $(ARCH),aarch64 arm64)) CFLAGS += -mcpu=native else diff --git a/csvexport/build/unix/debug.mk b/csvexport/build/unix/debug.mk index 04d925a6..a4ec6b6a 100644 --- a/csvexport/build/unix/debug.mk +++ b/csvexport/build/unix/debug.mk @@ -1,11 +1,6 @@ -ARCH := $(shell uname -m) - CFLAGS := -g3 -Wall DEFINES := -DDEBUG BUILD := debug -ifeq ($(ARCH),x86_64) -CFLAGS += -msse4.1 -endif - +include ../../../common/unix-debug.mk include build.mk diff --git a/import-chrome/build/unix/debug.mk b/import-chrome/build/unix/debug.mk index 04d925a6..a4ec6b6a 100644 --- a/import-chrome/build/unix/debug.mk +++ b/import-chrome/build/unix/debug.mk @@ -1,11 +1,6 @@ -ARCH := $(shell uname -m) - CFLAGS := -g3 -Wall DEFINES := -DDEBUG BUILD := debug -ifeq ($(ARCH),x86_64) -CFLAGS += -msse4.1 -endif - +include ../../../common/unix-debug.mk include build.mk diff --git a/profiler/build/unix/debug.mk b/profiler/build/unix/debug.mk index 04d925a6..a4ec6b6a 100644 --- a/profiler/build/unix/debug.mk +++ b/profiler/build/unix/debug.mk @@ -1,11 +1,6 @@ -ARCH := $(shell uname -m) - CFLAGS := -g3 -Wall DEFINES := -DDEBUG BUILD := debug -ifeq ($(ARCH),x86_64) -CFLAGS += -msse4.1 -endif - +include ../../../common/unix-debug.mk include build.mk diff --git a/update/build/unix/debug.mk b/update/build/unix/debug.mk index 04d925a6..a4ec6b6a 100644 --- a/update/build/unix/debug.mk +++ b/update/build/unix/debug.mk @@ -1,11 +1,6 @@ -ARCH := $(shell uname -m) - CFLAGS := -g3 -Wall DEFINES := -DDEBUG BUILD := debug -ifeq ($(ARCH),x86_64) -CFLAGS += -msse4.1 -endif - +include ../../../common/unix-debug.mk include build.mk