summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorDenys Vlasenko2017-07-19 17:56:56 +0200
committerDenys Vlasenko2017-07-19 17:56:56 +0200
commit1ef3ce91c70cb6a536438132d3202ccb3eddadbc (patch)
treebebcd096d8d3dc7ecd29559a19d3d5e23d2146df /arch
parent61f9d76ec597bc93fa54950632a9cdb54997f0cc (diff)
downloadbusybox-1ef3ce91c70cb6a536438132d3202ccb3eddadbc.zip
busybox-1ef3ce91c70cb6a536438132d3202ccb3eddadbc.tar.gz
sparc: needs -fPIC
Pinted out by Thomas Petazzoni. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/sparc/Makefile11
-rw-r--r--arch/sparc64/Makefile11
2 files changed, 22 insertions, 0 deletions
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile
new file mode 100644
index 0000000..0b1c56c
--- /dev/null
+++ b/arch/sparc/Makefile
@@ -0,0 +1,11 @@
+# When building a library, even intra-library references,
+# such as from find_applet_by_name() to applet_names[],
+# don't work with -fpic on sparc, needs -fPIC.
+# Don't know why it fails in this case but works when
+# a binary is being built.
+#
+# (if is superfluous, ARCH_FPIC is only used by library build, but it
+# demonstrates the point: non-pic binary does not need it)
+ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ARCH_FPIC = -fPIC
+endif
diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
new file mode 100644
index 0000000..0b1c56c
--- /dev/null
+++ b/arch/sparc64/Makefile
@@ -0,0 +1,11 @@
+# When building a library, even intra-library references,
+# such as from find_applet_by_name() to applet_names[],
+# don't work with -fpic on sparc, needs -fPIC.
+# Don't know why it fails in this case but works when
+# a binary is being built.
+#
+# (if is superfluous, ARCH_FPIC is only used by library build, but it
+# demonstrates the point: non-pic binary does not need it)
+ifeq ($(CONFIG_BUILD_LIBBUSYBOX),y)
+ARCH_FPIC = -fPIC
+endif