From 7c3e61cef2f522ad4008682c5b7671eeee2bf0e5 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 14 Mar 2024 20:40:34 +0000 Subject: link mode: do not create dependency files for explicit archive outputs. --- src/internal/slibtool_linkcmd_impl.h | 3 ++- src/logic/linkcmd/slbt_linkcmd_archive.c | 12 +++++++----- src/logic/slbt_exec_link.c | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/internal/slibtool_linkcmd_impl.h b/src/internal/slibtool_linkcmd_impl.h index c0db6e1..e1b384e 100644 --- a/src/internal/slibtool_linkcmd_impl.h +++ b/src/internal/slibtool_linkcmd_impl.h @@ -68,7 +68,8 @@ int slbt_exec_link_create_archive( const struct slbt_driver_ctx * dctx, struct slbt_exec_ctx * ectx, const char * arfilename, - bool fpic); + bool fpic, + bool fdep); int slbt_exec_link_create_library( const struct slbt_driver_ctx * dctx, diff --git a/src/logic/linkcmd/slbt_linkcmd_archive.c b/src/logic/linkcmd/slbt_linkcmd_archive.c index c55b369..b7c090b 100644 --- a/src/logic/linkcmd/slbt_linkcmd_archive.c +++ b/src/logic/linkcmd/slbt_linkcmd_archive.c @@ -74,7 +74,8 @@ slbt_hidden int slbt_exec_link_create_archive( const struct slbt_driver_ctx * dctx, struct slbt_exec_ctx * ectx, const char * arfilename, - bool fpic) + bool fpic, + bool fdep) { int fdcwd; char ** argv; @@ -159,10 +160,11 @@ slbt_hidden int slbt_exec_link_create_archive( return SLBT_NESTED_ERROR(dctx); /* .deps */ - if (slbt_exec_link_create_dep_file( - dctx,ectx,ectx->cargv, - arfilename,true)) - return SLBT_NESTED_ERROR(dctx); + if (fdep) + if (slbt_exec_link_create_dep_file( + dctx,ectx,ectx->cargv, + arfilename,true)) + return SLBT_NESTED_ERROR(dctx); /* ar spawn */ if ((slbt_spawn(ectx,true) < 0) && (ectx->pid < 0)) { diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index 0509047..50709d3 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -205,7 +205,7 @@ int slbt_exec_link(const struct slbt_driver_ctx * dctx) /* non-pic libfoo.a */ if (dot && !strcmp(dot,".a")) - if (slbt_exec_link_create_archive(dctx,ectx,output,false)) { + if (slbt_exec_link_create_archive(dctx,ectx,output,false,false)) { slbt_ectx_free_exec_ctx(ectx); return SLBT_NESTED_ERROR(dctx); } @@ -258,7 +258,7 @@ int slbt_exec_link(const struct slbt_driver_ctx * dctx) if (slbt_exec_link_create_archive( dctx,ectx, ectx->arfilename, - fpic)) { + fpic,true)) { slbt_ectx_free_exec_ctx(ectx); return SLBT_NESTED_ERROR(dctx); } -- cgit v1.2.3