aboutsummaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-10 10:19:55 +0200
committerGitHub <noreply@github.com>2020-06-10 10:19:55 +0200
commitdc719b9745f1955ad1183e8e2462b016d135a0cf (patch)
treeff9e353a5b9221efc8e8c83db69389be6b9487b0 /mk
parentb2c8061b44b01a39d953d75db30e39bd8f300021 (diff)
parent7eca8a16eaf74bc15a816e24005a65e5480d2a79 (diff)
Merge pull request #3677 from matthewbauer/static-nix-one-translation-unit
Prelink static libraries into an object file
Diffstat (limited to 'mk')
-rw-r--r--mk/libraries.mk3
1 files changed, 2 insertions, 1 deletions
diff --git a/mk/libraries.mk b/mk/libraries.mk
index 307e29b9d..e6ef2e3ec 100644
--- a/mk/libraries.mk
+++ b/mk/libraries.mk
@@ -125,7 +125,8 @@ define build-library
$(1)_PATH := $$(_d)/$$($(1)_NAME).a
$$($(1)_PATH): $$($(1)_OBJS) | $$(_d)/
- $(trace-ar) $(AR) crs $$@ $$?
+ $(trace-ld) $(LD) -Ur -o $$(_d)/$$($(1)_NAME).o $$?
+ $(trace-ar) $(AR) crs $$@ $$(_d)/$$($(1)_NAME).o
$(1)_LDFLAGS_USE += $$($(1)_PATH) $$($(1)_LDFLAGS)