summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-10-29 22:55:04 +0100
committerSam James <sam@gentoo.org>2021-10-29 23:22:33 +0100
commit43d9863e8abd71e2b8fa242795f95c42c688cb43 (patch)
tree1c077a245e5d9eff70e66905b2f744d4973728cb /sys-devel/mold/files
parentdev-libs/mimalloc: initial import (diff)
downloadgentoo-43d9863e8abd71e2b8fa242795f95c42c688cb43.tar.gz
gentoo-43d9863e8abd71e2b8fa242795f95c42c688cb43.tar.bz2
gentoo-43d9863e8abd71e2b8fa242795f95c42c688cb43.zip
sys-devel/mold: initial import
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/mold/files')
-rw-r--r--sys-devel/mold/files/mold-0.9.6-respect-flags.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/sys-devel/mold/files/mold-0.9.6-respect-flags.patch b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
new file mode 100644
index 000000000000..270a28988f9d
--- /dev/null
+++ b/sys-devel/mold/files/mold-0.9.6-respect-flags.patch
@@ -0,0 +1,49 @@
+From: Sam James <sam@gentoo.org>
+Date: Fri, 29 Oct 2021 22:50:40 +0100
+Subject: [PATCH] Respect *FLAGS
+
+--- a/Makefile
++++ b/Makefile
+@@ -10,10 +10,11 @@ GIT_HASH ?= $(shell [ -d .git ] && git rev-parse HEAD)
+
+ OS ?= $(shell uname -s)
+
+-CPPFLAGS = -g -pthread -std=c++20 -fPIE \
+- -DMOLD_VERSION=\"0.9.6\" \
+- -DGIT_HASH=\"$(GIT_HASH)\" \
+- $(EXTRA_CPPFLAGS)
++CFLAGS = -pthread -fPIE $(EXTRA_CFLAGS)
++CXXFLAGS = -pthread -std=c++20 -fPIE $(EXTRA_CXXFLAGS)
++CPPFLAGS = -DMOLD_VERSION=\"0.9.6\" \
++ -DGIT_HASH=\"$(GIT_HASH)\" \
++ $(EXTRA_CPPFLAGS)
+ LDFLAGS += $(EXTRA_LDFLAGS)
+ LIBS = -pthread -lz -lxxhash -ldl -lm
+
+@@ -28,12 +29,6 @@ LTO ?= 0
+ ASAN ?= 0
+ TSAN ?= 0
+
+-ifeq ($(DEBUG), 1)
+- CPPFLAGS += -O0
+-else
+- CPPFLAGS += -O2
+-endif
+-
+ ifeq ($(LTO), 1)
+ CPPFLAGS += -flto -O3
+ LDFLAGS += -flto
+@@ -73,11 +68,11 @@ endif
+ all: mold mold-wrapper.so
+
+ mold: $(OBJS) $(MIMALLOC_LIB) $(TBB_LIB)
+- $(CXX) $(CXXFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LIBS)
++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
+ ln -sf mold ld
+
+ mold-wrapper.so: elf/mold-wrapper.c Makefile
+- $(CC) -fPIC -shared -o $@ $< -ldl
++ $(CC) $(CPPFLAGS) $(CFLAGS) -fPIC -shared -o $@ $(LDFLAGS) $< -ldl
+
+ $(OBJS): $(HEADERS) Makefile
+