From 89f5e3327da73886837264325c7c4484da0fc257 Mon Sep 17 00:00:00 2001 From: midipix Date: Apr 16 2021 07:37:52 +0000 Subject: link mode: -module without -rpath is an executable, not a dynamic library. --- diff --git a/src/logic/slbt_exec_link.c b/src/logic/slbt_exec_link.c index c593423..b1c242c 100644 --- a/src/logic/slbt_exec_link.c +++ b/src/logic/slbt_exec_link.c @@ -1963,19 +1963,21 @@ int slbt_exec_link( return SLBT_NESTED_ERROR(dctx); /* dynamic library via -module */ - if (dctx->cctx->drvflags & SLBT_DRIVER_MODULE) { - if (!dot || strcmp(dot,".la")) { - if (slbt_exec_link_create_library( - dctx,ectx, - ectx->dsobasename, - ectx->dsofilename, - ectx->relfilename)) { + if (dctx->cctx->rpath && !fstaticonly) { + if (dctx->cctx->drvflags & SLBT_DRIVER_MODULE) { + if (!dot || strcmp(dot,".la")) { + if (slbt_exec_link_create_library( + dctx,ectx, + ectx->dsobasename, + ectx->dsofilename, + ectx->relfilename)) { + slbt_free_exec_ctx(actx); + return SLBT_NESTED_ERROR(dctx); + } + slbt_free_exec_ctx(actx); - return SLBT_NESTED_ERROR(dctx); + return 0; } - - slbt_free_exec_ctx(actx); - return 0; } }