about summary refs log tree commit diff
path: root/Rules
diff options
context:
space:
mode:
Diffstat (limited to 'Rules')
-rw-r--r--Rules6
1 files changed, 6 insertions, 0 deletions
diff --git a/Rules b/Rules
index c36e2c30d6..029f81b96e 100644
--- a/Rules
+++ b/Rules
@@ -171,6 +171,12 @@ ifdef static-only-routines
 $(static-only-routines:%=$(objpfx)%.os): %.os: $(common-objpfx)empty.os
 	rm -f $@
 	ln $< $@
+
+# Must build the routines as PIC, though, because they can end up in (users')
+# shared objects.  We don't want to use CFLAGS-os because users may, for
+# example, make that processor-specific.
+$(static-only-routines:%=$(objpfx)%.o): $(objpfx)%.o: %.c $(before-compile)
+	$(compile.c) $(pic-ccflag) $(OUTPUT_OPTION)
 endif
 
 ifdef shared-only-routines