Menu

#1968 WSL standard build with GCC-3.4.5 cross -- undefined references to __findfirst64i32 and __findnext64i32

WSL
closed
None
Bug
out-of-date
User_Error
False
2015-01-15
2013-05-06
No

After building and installing from git master, I can no longer compile even a trivial test case:

#include <_mingw.h>
int main(){ return 0; }

yields:

$ mingw32-gcc foo.c
/home/keith/mingw32/lib/libmingwex.a(dirent.o): In function `opendir':
/home/keith/src/mingw/mingw-wsl/build/../src/libcrt/tchar/dirent.c:219: undefined reference to `__findfirst64i32'
/home/keith/mingw32/lib/libmingwex.a(dirent.o): In function `readdir':
/home/keith/src/mingw/mingw-wsl/build/../src/libcrt/tchar/dirent.c:295: undefined reference to `__findnext64i32'
/home/keith/mingw32/lib/libmingwex.a(dirent.o): In function `rewinddir':
/home/keith/src/mingw/mingw-wsl/build/../src/libcrt/tchar/dirent.c:398: undefined reference to `__findfirst64i32'
/home/keith/mingw32/lib/libmingwex.a(dirent.o): In function `seekdir':
/home/keith/src/mingw/mingw-wsl/build/../src/libcrt/tchar/dirent.c:466: undefined reference to `__findnext64i32'
collect2: ld returned 1 exit status

Pre-processed source isn't particularly enlightening; (the bug lies, not here, but in the interpretation of _tfindfirst and _tfindnext, when WSL's dirent.c is compiled, during the build of WSL itself):

$ mingw32-gcc -E foo.c
# 1 "foo.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "foo.c"
# 1 "/home/keith/mingw32/usr/local/include/_mingw.h" 1 3
# 32 "/home/keith/mingw32/usr/local/include/_mingw.h" 3

# 33 "/home/keith/mingw32/usr/local/include/_mingw.h" 3
# 1 "/home/keith/mingw32/usr/local/include/sdkddkver.h" 1 3
# 26 "/home/keith/mingw32/usr/local/include/sdkddkver.h" 3

# 27 "/home/keith/mingw32/usr/local/include/sdkddkver.h" 3
# 34 "/home/keith/mingw32/usr/local/include/_mingw.h" 2 3
# 246 "/home/keith/mingw32/usr/local/include/_mingw.h" 3
struct threadlocalinfostruct;
struct threadmbinfostruct;
typedef struct threadlocalinfostruct *pthreadlocinfo;
typedef struct threadmbcinfostruct *pthreadmbcinfo;

typedef struct localeinfo_struct {
  pthreadlocinfo locinfo;
  pthreadmbcinfo mbcinfo;
} _locale_tstruct, *_locale_t;
# 2 "foo.c" 2
int main(){ return 0; }

Within your current ChangeLog, I see:

2012-09-11  Earnie Boyd  <earnie@users.sourceforge.net>

        Redo the filters based on assumptions discussed in mingw-dvlpr list.

        ...

        * include/io.h (_findfirst*): What a mess.  Reworked.
        (_wfindfirst*): Ditto.
        (_findnext*): Ditto.
        (_wfindnext*): Ditto.
        (_finddata*_t): Ditto.
        (_wfinddata*_t): Ditto.
        (_FINDDATA_T_DEFINED): Add filter.

        ...

Unfortunately, however you've reworked it, it no longer seems to DTRT for me; with mingw32-nm, inspecting the dirent.o build from WSL git master, I see:

$ mingw32-nm `find . -name dirent.o`
...
00000000 t .text
         U _GetLastError@0
         U __errno
         U __findclose
         U __findfirst64i32
         U __findnext64i32
         U __fullpath
...

whereas, inspecting the corresponding build from my end-of-line mingwrt CVS sandbox, I see (as it should be):

$ mingw32-nm mingwex/dirent.o 
...
00000000 t .text
         U _GetLastError@0
         U __errno
         U __findclose
         U __findfirst
         U __findnext
         U __fullpath
...

Related

Issues: #1975

Discussion

  • Keith Marshall

    Keith Marshall - 2013-05-08
    • status: assigned --> closed
    • Resolution: none --> out-of-date
    • Category: Unknown --> User_Error
     
  • Keith Marshall

    Keith Marshall - 2013-05-08

    This may be a red herring, due to me having cloned the defunct pre-Allura repository.

    Unable to reproduce, with clone from correct source. Closing.