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.
Unified · Split
| @@ -314,8 +314,11 @@ int main(int argc, char **argv) · 313 unmodified lines | |||
| 314 | const char *filename = s->files[i] + 1; | 314 | const char *filename = s->files[i] + 1; |
| 315 | if (filename[0] == '-' && filename[1] == 'l') { | 315 | if (filename[0] == '-' && filename[1] == 'l') { |
| 316 | if (tcc_add_library(s, filename + 2) < 0) { | 316 | if (tcc_add_library(s, filename + 2) < 0) { |
| 317 | tcc_error_noabort("cannot find library 'lib%s'", filename+2); | 317 | /* don't fail on -lm as it's harmless to skip math lib */ |
| 318 | ret = 1; | 318 | if (strcmp(filename + 2, "m")) { |
| 319 | tcc_error_noabort("cannot find library 'lib%s'", filename + 2); | ||
| 320 | ret = 1; | ||
| 321 | } | ||
| 319 | } | 322 | } |
| 320 | } else { | 323 | } else { |
| 321 | if (1 == s->verbose) | 324 | if (1 == s->verbose) |