aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Vissoultchev <wqweto@gmail.com>2016-04-06 19:25:30 +0300
committerVlad Vissoultchev <wqweto@gmail.com>2016-04-08 12:18:31 +0300
commit174d06a3ff549702d1c7b9df6ce7a096801ba3ae (patch)
tree19f7e9c57a8c00783d8b90264ffb656b3f1be330
parente946eb2a4109e0de5f8514457f851897a4824c3e (diff)
downloadtinycc-174d06a3ff549702d1c7b9df6ce7a096801ba3ae.tar.gz
tinycc-174d06a3ff549702d1c7b9df6ce7a096801ba3ae.tar.bz2
Skip math library if not found when -lm option is used
This only silences "cannot find library" error and allows Makefiles targeting gcc to not complain about missing libraries If there is custom libm then standard handling applies.
-rw-r--r--tcc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tcc.c b/tcc.c
index 95e1a15..6d9bf52 100644
--- a/tcc.c
+++ b/tcc.c
@@ -314,8 +314,11 @@ int main(int argc, char **argv)
const char *filename = s->files[i] + 1;
if (filename[0] == '-' && filename[1] == 'l') {
if (tcc_add_library(s, filename + 2) < 0) {
- tcc_error_noabort("cannot find library 'lib%s'", filename+2);
- ret = 1;
+ /* don't fail on -lm as it's harmless to skip math lib */
+ if (strcmp(filename + 2, "m")) {
+ tcc_error_noabort("cannot find library 'lib%s'", filename + 2);
+ ret = 1;
+ }
}
} else {
if (1 == s->verbose)