Bug 795426 - cannot link with _ftime_s
Summary: cannot link with _ftime_s
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mingw32-gcc
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-02-20 13:50 UTC by Christophe Fergeau
Modified: 2014-05-30 09:51 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-29 13:21:59 UTC


Attachments (Terms of Use)

Description Christophe Fergeau 2012-02-20 13:50:07 UTC
// $ 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;
}

Comment 1 Fedora End Of Life 2013-04-03 17:22:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 2 Erik van Pienbroek 2014-05-29 13:21:59 UTC
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

Comment 3 Christophe Fergeau 2014-05-30 09:19:27 UTC
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.

Comment 4 Erik van Pienbroek 2014-05-30 09:45:38 UTC
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

Comment 5 Christophe Fergeau 2014-05-30 09:51:10 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.