History

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.

Vlad Vissoultchev committed 10 years ago

Commit 174d06a1 parent e946eb21 file · +5 −2Browse files

Unified · Split

tcc.c+5−2
@@ -314,8 +314,11 @@ int main(int argc, char **argv) · 313 unmodified lines
314314 const char *filename = s->files[i] + 1;
315315 if (filename[0] == '-' && filename[1] == 'l') {
316316 if (tcc_add_library(s, filename + 2) < 0) {
317− tcc_error_noabort("cannot find library 'lib%s'", filename+2);
318− ret = 1;
317+ /* don't fail on -lm as it's harmless to skip math lib */
318+ if (strcmp(filename + 2, "m")) {
319+ tcc_error_noabort("cannot find library 'lib%s'", filename + 2);
320+ ret = 1;
321+ }
319322 }
320323 } else {
321324 if (1 == s->verbose)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t