aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2016-05-20 15:12:32 +0300
committerseyko <seyko2@gmail.com>2016-05-20 15:12:32 +0300
commit19a169ceb896f78205bc23b847938c58f14d1dda (patch)
tree3bb430b5c22acf6c024749760d522c95c4c92b61 /libtcc.c
parent1339d0475954fa2278977562b618d9bab044bc82 (diff)
downloadtinycc-19a169ceb896f78205bc23b847938c58f14d1dda.tar.gz
tinycc-19a169ceb896f78205bc23b847938c58f14d1dda.tar.bz2
--whole-archive support
A patch is implemented as suggested in tinycc-devel mail list. From: Reuben Thomas Date: Thu, 31 Jul 2014 16:52:53 +0100 Subject: [PATCH] Add --{no,}-whole-archive support I resurrected the patch supplied to the mailing list in 2009 Since --whole-archive is a useful flag to get tcc working with autotools, and of course in its own right, I suggest you have a look at the patch and see if it is acceptable. I cannot see any suggestion that it was actively rejected last time round, just no evidence that it was ever added.
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libtcc.c b/libtcc.c
index b0fcdf9..a39bd5f 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1406,9 +1406,11 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags,
ret = tcc_load_ldscript(s1);
#endif
if (ret < 0)
- tcc_error_noabort("unrecognized file type");
+ tcc_error_noabort("%s: unrecognized file type (error=%d)", filename, ret);
the_end:
+ if (s1->verbose)
+ printf("+> %s\n", filename);
tcc_close();
return ret;
}
@@ -2306,6 +2308,16 @@ ST_FUNC int tcc_parse_args1(TCCState *s, int argc, char **argv)
s->rdynamic = 1;
break;
case TCC_OPTION_Wl:
+ if (optarg && *optarg == '-') {
+ int offs = 0;
+ if (!strncmp("-no", optarg+1, 3))
+ offs += 3;
+ if (!strcmp("-whole-archive", optarg+1 + offs)) {
+ args_parser_add_file(s, "", (offs == 0) ? TCC_FILETYPE_AR_WHOLE_ON :
+ TCC_FILETYPE_AR_WHOLE_OFF);
+ break;
+ }
+ }
if (pas->linker_arg.size)
--pas->linker_arg.size, cstr_ccat(&pas->linker_arg, ',');
cstr_cat(&pas->linker_arg, optarg, 0);