[Bug 995787] Re: ld discards -lrt despite clock_gettime being used, and wrongfully fails to link

2012-05-06 Thread Mike Hommey
Forget it, it's an ordering problem. (And I can't find how to close a bug) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/995787 Title: ld discards -lrt despite clock_gettime being used, and wrongful

[Bug 995787] [NEW] ld discards -lrt despite clock_gettime being used, and wrongfully fails to link

2012-05-06 Thread Mike Hommey
Public bug reported: $ cat > test.c < int main() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); return 0; } EOF $ gcc -o test -lrt test.c test.c:(.text+0x15): undefined reference to `clock_gettime' Adding -Wl,--no-as-needed before -lrt makes it link. Using gold instead of BFD ld also