summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/internal/slibtool_symlink_impl.c5
-rw-r--r--src/logic/slbt_exec_link.c28
2 files changed, 30 insertions, 3 deletions
diff --git a/src/internal/slibtool_symlink_impl.c b/src/internal/slibtool_symlink_impl.c
index 42185e8..d95beba 100644
--- a/src/internal/slibtool_symlink_impl.c
+++ b/src/internal/slibtool_symlink_impl.c
@@ -12,8 +12,9 @@
#include "slibtool_errinfo_impl.h"
#include "slibtool_symlink_impl.h"
-#define SLBT_DEV_NULL_FLAGS (SLBT_DRIVER_ALL_STATIC \
- | SLBT_DRIVER_DISABLE_SHARED)
+#define SLBT_DEV_NULL_FLAGS (SLBT_DRIVER_ALL_STATIC \
+ | SLBT_DRIVER_DISABLE_SHARED \
+ | SLBT_DRIVER_DISABLE_STATIC)
int slbt_create_symlink(
const struct slbt_driver_ctx * dctx,
diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c
index 3aa9d2f..8691760 100644
--- a/src/logic/slbt_exec_link.c
+++ b/src/logic/slbt_exec_link.c
@@ -786,6 +786,31 @@ static int slbt_exec_link_create_import_library(
return 0;
}
+static int slbt_exec_link_create_noop_symlink(
+ const struct slbt_driver_ctx * dctx,
+ struct slbt_exec_ctx * ectx,
+ const char * arfilename)
+{
+ struct stat st;
+
+ /* file exists? */
+ if (!(lstat(arfilename,&st)))
+ return 0;
+
+ /* needed? */
+ if (errno == ENOENT) {
+ if (slbt_create_symlink(
+ dctx,ectx,
+ "/dev/null",
+ arfilename,
+ false))
+ return SLBT_NESTED_ERROR(dctx);
+ return 0;
+ }
+
+ return SLBT_SYSTEM_ERROR(dctx);
+}
+
static int slbt_exec_link_create_archive(
const struct slbt_driver_ctx * dctx,
struct slbt_exec_ctx * ectx,
@@ -807,7 +832,8 @@ static int slbt_exec_link_create_archive(
/* -disable-static? */
if (dctx->cctx->drvflags & SLBT_DRIVER_DISABLE_STATIC)
if (dctx->cctx->rpath)
- return 0;
+ return slbt_exec_link_create_noop_symlink(
+ dctx,ectx,arfilename);
/* initial state */
slbt_reset_arguments(ectx);