Please do not reply directly to this email. All additional comments should be made in the comments box of this bug.
Summary: cannot link with _ftime_s
https://bugzilla.redhat.com/show_bug.cgi?id=795426
Summary: cannot link with _ftime_s Product: Fedora Version: rawhide Platform: Unspecified OS/Version: Unspecified Status: NEW Severity: unspecified Priority: unspecified Component: mingw32-gcc AssignedTo: rjones@redhat.com ReportedBy: cfergeau@redhat.com QAContact: extras-qa@fedoraproject.org CC: rjones@redhat.com, kalevlember@gmail.com, erik-fedora@vanpienbroek.nl, fedora-mingw@lists.fedoraproject.org Classification: Fedora Story Points: --- Type: --- Regression: --- Mount Type: --- Documentation: ---
// $ i686-w64-mingw32-gcc -Wimplicit-function-declaration ./ftime.c // // /tmp/ccdYAiqO.o:ftime.c:(.text+0x16): undefined reference to`_imp___ftime_s' // collect2: error: ld returned 1 exit status // // No warning, this means the function is declared in headers (gcc -E shows // it comes from sec_api/sys/timeb_s.h) but it's not available at link time.
/* $ rpm -qa mingw32*
mingw32-binutils-2.22.51-3.fc17_cross.x86_64 mingw32-gcc-4.7.0-0.3.20120123.fc16_cross.x86_64 mingw32-filesystem-92-1.fc18_cross.noarch mingw32-cpp-4.7.0-0.3.20120123.fc16_cross.x86_64 mingw32-headers-2.0.999-0.1.trunk.20120120.fc17_cross.noarch mingw32-crt-2.0.999-0.3.trunk.20120124.fc17_cross.noarch mingw32-gcc-c++-4.7.0-0.3.20120123.fc16_cross.x86_64 */
#include <stdlib.h> // for NULL #include <sys/timeb.h>
int main(int argc, char **argv) { _ftime_s(NULL);
return 0; }
https://bugzilla.redhat.com/show_bug.cgi?id=795426
Erik van Pienbroek erik-fedora@vanpienbroek.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CLOSED Resolution|--- |RAWHIDE Last Closed| |2014-05-29 09:21:59
--- Comment #2 from Erik van Pienbroek erik-fedora@vanpienbroek.nl --- The mentioned testcase gives the expect result and doesn't show any warnings on the mingw-w64 toolchain which is currently in rawhide. Closing bug
https://bugzilla.redhat.com/show_bug.cgi?id=795426
Christophe Fergeau cfergeau@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|19 |20
--- Comment #3 from Christophe Fergeau cfergeau@redhat.com --- I'm still hitting this in f20 with mingw64-gcc, but this seems related to ccache:
$ which x86_64-redhat-linux-gcc /usr/lib64/ccache/x86_64-redhat-linux-gcc
$ LC_ALL=C x86_64-redhat-linux-gcc -Wimplicit-function-declaration ./mingw.c ./mingw.c: In function 'main': ./mingw.c:6:5: warning: implicit declaration of function '_ftime_s' [-Wimplicit-function-declaration] _ftime_s(NULL); ^ /tmp/ccswArMH.o: In function `main': mingw.c:(.text+0x1a): undefined reference to `_ftime_s' collect2: error: ld returned 1 exit status
$ /usr/bin/x86_64-w64-mingw32-gcc -Wimplicit-function-declaration ./mingw.c $ echo $? 0
No clue whether this should be reopened or not.
https://bugzilla.redhat.com/show_bug.cgi?id=795426
--- Comment #4 from Erik van Pienbroek erik-fedora@vanpienbroek.nl --- The symbol _ftime_s is win32 specific and part of the 'secure api': http://msdn.microsoft.com/en-us/library/95e68951.aspx Therefore it is expected that the symbol can't be found when using the native Linux gcc
https://bugzilla.redhat.com/show_bug.cgi?id=795426
--- Comment #5 from Christophe Fergeau cfergeau@redhat.com --- Sorry, dunno what I was thinking, I did not pay attention to the 'linux' bit in x86_64-redhat-linux-gcc and assumed this was a mingw one /o, apologies for the noise.