summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/slbt_exec_compile.c16
-rw-r--r--src/logic/slbt_exec_link.c4
2 files changed, 13 insertions, 7 deletions
diff --git a/src/logic/slbt_exec_compile.c b/src/logic/slbt_exec_compile.c
index 9e4e7a1..f3d3b48 100644
--- a/src/logic/slbt_exec_compile.c
+++ b/src/logic/slbt_exec_compile.c
@@ -66,10 +66,12 @@ int slbt_exec_compile(
/* shared library object */
if (dctx->cctx->drvflags & SLBT_DRIVER_SHARED) {
- if (!(dctx->cctx->drvflags & SLBT_DRIVER_ANTI_PIC)) {
+ if (!(dctx->cctx->drvflags & SLBT_DRIVER_ANTI_PIC))
*ectx->dpic = "-DPIC";
- *ectx->fpic = "-fPIC";
- }
+
+ if (!(dctx->cctx->drvflags & SLBT_DRIVER_ANTI_PIC))
+ if (dctx->cctx->settings.picswitch)
+ *ectx->fpic = dctx->cctx->settings.picswitch;
*ectx->lout[0] = "-o";
*ectx->lout[1] = ectx->lobjname;
@@ -91,10 +93,12 @@ int slbt_exec_compile(
if (dctx->cctx->drvflags & SLBT_DRIVER_STATIC) {
slbt_reset_placeholders(ectx);
- if (dctx->cctx->drvflags & SLBT_DRIVER_PRO_PIC) {
+ if (dctx->cctx->drvflags & SLBT_DRIVER_PRO_PIC)
*ectx->dpic = "-DPIC";
- *ectx->fpic = "-fPIC";
- }
+
+ if (dctx->cctx->drvflags & SLBT_DRIVER_PRO_PIC)
+ if (dctx->cctx->settings.picswitch)
+ *ectx->fpic = dctx->cctx->settings.picswitch;
*ectx->lout[0] = "-o";
*ectx->lout[1] = ectx->aobjname;
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 4f422d2..a2501b9 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -1221,9 +1221,11 @@ static int slbt_exec_link_create_library(
/* shared/static */
if (dctx->cctx->drvflags & SLBT_DRIVER_ALL_STATIC) {
*ectx->dpic = "-static";
+ } else if (dctx->cctx->settings.picswitch) {
+ *ectx->dpic = "-shared";
+ *ectx->fpic = dctx->cctx->settings.picswitch;
} else {
*ectx->dpic = "-shared";
- *ectx->fpic = "-fPIC";
}
/* output */