aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-20 09:10:13 +0200
committerlemon <lsof@mailbox.org>2025-10-20 09:10:13 +0200
commit4af53391532f91704e316cca92a9bf1c9da93307 (patch)
tree35c2aa68fd637a07e2b23a71881a6ce0d4e576e1
parentb6afdd647ce394dc7e1281cc42c05b6981cd62b2 (diff)
driver: pass thru linker -l args
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 07ccd58..c82c94e 100644
--- a/main.c
+++ b/main.c
@@ -89,6 +89,7 @@ static struct task {
const char *targ;
const char *inf[64];
enum inft inft[64];
+ vec_of(const char *) linkargs;
int ninf;
bool verbose;
} task;
@@ -149,6 +150,8 @@ optparse(char **args)
if (!strcmp(flag, "pie") || !strcmp(flag, "PIE")) ccopt.pie = set;
else if (!strcmp(flag, "pic") || !strcmp(flag, "PIC")) ccopt.pic = set;
else goto Bad;
+ } else if (*arg == 'l') {
+ vpush(&task.linkargs, arg-1);
} else if (!strcmp(arg, "v") || !strcmp(arg, "-verbose")) {
task.verbose = 1;
} else if (!strcmp(arg, "c")) {
@@ -267,6 +270,7 @@ dolink(void)
} else if (task.outft == OFTexe) {
vpush(&cmd, ccopt.pie ? "-pie" : "-no-pie");
}
+ vpushn(&cmd, task.linkargs.p, task.linkargs.n);
vpush(&cmd, "-o");
vpush(&cmd, task.out);
assert(task.ninf > 0);