summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2018-08-03 22:09:51 +0000
committermidipix <writeonce@midipix.org>2018-08-03 21:13:31 -0400
commitec6c65d45c38a8927efb4e36af0dfff879f46b32 (patch)
tree44de2e7865b7c3f10b87cf21bc8eb61b1ac9599e /src
parenta3e2cfa926e49bb4f63557bd990f83b8f4685734 (diff)
downloadmdso-ec6c65d45c38a8927efb4e36af0dfff879f46b32.tar.bz2
mdso-ec6c65d45c38a8927efb4e36af0dfff879f46b32.tar.xz
driver: object file generation: create in a lib-specific folder (same as asm).
Diffstat (limited to 'src')
-rw-r--r--src/driver/mdso_driver_ctx.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/driver/mdso_driver_ctx.c b/src/driver/mdso_driver_ctx.c
index 562968d..2e7ddd9 100644
--- a/src/driver/mdso_driver_ctx.c
+++ b/src/driver/mdso_driver_ctx.c
@@ -118,7 +118,10 @@ static int mdso_dstdir_open(int fdcwd, const char * dstdir, const char * asmbase
int fddst;
int dirmode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
- if ((fdtop = openat(fdcwd,dstdir,O_DIRECTORY)) >= 0)
+ if (!dstdir)
+ fdtop = fdcwd;
+
+ else if ((fdtop = openat(fdcwd,dstdir,O_DIRECTORY)) >= 0)
(void)0;
else if (mkdirat(fdcwd,dstdir,dirmode) < 0)
@@ -329,7 +332,7 @@ int mdso_get_driver_ctx(
*dot = '\0';
- if (!cctx.dstdir)
+ if (!cctx.dstdir && !(cctx.drvflags & MDSO_DRIVER_GENERATE_OBJECTS))
fddst = AT_FDCWD;
else if ((fddst = mdso_dstdir_open(fdctx->fdcwd,cctx.dstdir,asmbase)) < 0)
@@ -380,7 +383,7 @@ int mdso_create_driver_ctx(
if (!(meta = argv_get(argv,optv,0,fdctx->fderr)))
return -1;
- if (!cctx->dstdir)
+ if (!cctx->dstdir && !(cctx->drvflags & MDSO_DRIVER_GENERATE_OBJECTS))
fddst = AT_FDCWD;
else if ((fddst = mdso_dstdir_open(