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
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)

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