Bug 7974 - ccache 3.1.4 fails to build on MinGW32
ccache 3.1.4 fails to build on MinGW32
Product: ccache
Classification: Unclassified
Component: ccache
x64 Windows 7
: P5 normal
: 3.2
Assigned To: Joel Rosdahl
Joel Rosdahl
Depends on:
  Show dependency treegraph
Reported: 2011-02-24 16:29 UTC by Ken Sharp
Modified: 2012-08-11 08:26 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ken Sharp 2011-02-24 16:29:39 UTC
There are a lot of errors when trying to compile ccache 3.1.4 under MinGW32

$ make
gcc -g -O2 -Wall -W  -o ccache.exe main.o ccache.o mdfour.o hash.o execute.o uti
l.o args.o stats.o version.o cleanup.o snprintf.o unify.o manifest.o hashtable.o
 hashtable_itr.o murmurhashneutral2.o hashutil.o getopt_long.o exitfn.o lockfile
.o counters.o language.o compopt.o -Lzlib  -lm -lz
ccache.o: In function `parse_sloppiness':
C:/MinGW/msys/1.0/home/ccache-3.1.4/ccache.c:1750: undefined reference to `strto
ccache.o: In function `calculate_common_hash':
C:/MinGW/msys/1.0/home/ccache-3.1.4/ccache.c:861: undefined reference to `strtok
execute.o: In function `find_executable_in_path':
C:/MinGW/msys/1.0/home/ccache-3.1.4/execute.c:244: undefined reference to `strto
C:/MinGW/msys/1.0/home/ccache-3.1.4/execute.c:246: undefined reference to `strto
args.o: In function `args_init_from_string':
C:/MinGW/msys/1.0/home/ccache-3.1.4/args.c:45: undefined reference to `strtok_r'

hashutil.o: In function `hash_command_output':
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:238: undefined reference to `pipe
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:241: undefined reference to `fork
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:266: undefined reference to `wait
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:270: undefined reference to `WIFE
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:271: undefined reference to `WEXI
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:270: undefined reference to `WEXI
hashutil.o: In function `hash_multicommand_output':
C:/MinGW/msys/1.0/home/ccache-3.1.4/hashutil.c:288: undefined reference to `strt
collect2: ld returned 1 exit status
make: *** [ccache.exe] Error 1
Comment 1 Joel Rosdahl 2011-02-27 02:05:08 UTC
I don't know much about MinGW, but according to <http://lists-archives.org/mingw-users/18786-fork-waitpid-and-setpid.html>, the right way to solve it is to port the code to Windows APIs.

Fortunately, Ramiro Polla has already made it possible to build ccache natively in Windows, but there hasn't been any official Windows build yet. I'll ask him about the status.
Comment 2 Joel Rosdahl 2011-03-03 21:05:03 UTC
The current master branch (which will become ccache 3.2 at some yet unknown time) mostly works on Windows right now.
Comment 3 Joel Rosdahl 2012-08-11 08:26:06 UTC
Closing this as WONTFIX since Windows builds won't be supported for ccache 3.1.