diff --git a/mk/libraries.mk b/mk/libraries.mk
index 307e29b9d05b84403f63db569cde8a0eb2510715..e6ef2e3ec7dd7644d2dd94f64e3180d66ee608d0 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)