MantisBT - CMake | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0010717 | CMake | Modules | public | 2010-05-14 15:59 | 2016-06-10 14:31 |
| Reporter | Daniel Richard G. | ||||
| Assigned To | Bill Hoffman | ||||
| Priority | normal | Severity | major | Reproducibility | sometimes |
| Status | closed | Resolution | moved | ||
| Platform | OS | OS Version | |||
| Product Version | CMake-2-8 | ||||
| Target Version | Fixed in Version | ||||
| Summary | 0010717: CheckIncludeFile.cmake sometimes finds files that aren't there | ||||
| Description | I am using CMake 2.8.1 on an OSF/Tru64 system. My listfile uses CheckTypeSize.cmake to check for the availability of various C99 integer types, and this file in turn uses CheckIncludeFile.cmake to look for sys/types.h, stdint.h, and stddef.h. On this system, the correct result of these checks is as follows: -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - not found -- Looking for stddef.h -- Looking for stddef.h - found Sometimes, however---maybe 1 out of every 2 or 3 tries, it's not hard to reproduce---I see this: -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found Which is bogus, of course; this system does not have stdint.h anywhere! So I used --debug-trycompile, and rigged CheckTypeSize.cmake to error out as soon as HAVE_STDINT_H was true, and poked around to see what might have been causing this erroneous result. Some telemetry: cport@drum:/tmp/tgpack-test/CMakeFiles/CMakeTmp> gnu-stat CheckIncludeFile.c CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o File: `CheckIncludeFile.c' Size: 113 Blocks: 2 IO Block: 8192 regular file Device: 800406h/8389638d Inode: 146087 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 14/ cport) Gid: ( 15/ users) Access: 2010-05-13 19:51:41.531453000 -0400 Modify: 2010-05-13 19:51:41.549021000 -0400 Change: 2010-05-13 19:51:41.549997000 -0400 File: `CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o' Size: 6856 Blocks: 14 IO Block: 8192 regular file Device: 800406h/8389638d Inode: 152298 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 14/ cport) Gid: ( 15/ users) Access: 2010-05-13 19:52:01.967532000 -0400 Modify: 2010-05-13 19:51:41.239629000 -0400 Change: 2010-05-13 19:51:41.239629000 -0400 cport@drum:/tmp/tgpack-test/CMakeFiles/CMakeTmp> cat CheckIncludeFile.c #include <stdint.h> #ifdef __CLASSIC_C__ int main() { return 0; } #else int main(void) { return 0; } #endif cport@drum:/tmp/tgpack-test/CMakeFiles/CMakeTmp> gnu-grep physadr_t CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o Binary file CMakeFiles/cmTryCompileExec.dir/CheckIncludeFile.c.o matches cport@drum:/tmp/tgpack-test/CMakeFiles/CMakeTmp> gnu-grep -Rl physadr_t /usr/include /usr/include/sys/types.h Notice that the CheckIncludeFile.c.o object file slightly predates CheckIncludeFile.c, and the object file contains a type definition that appears only in sys/types.h. The object file thus appears to be from the sys/types.h check. And yet, the CMake run ended right after the stdint.h check was successful. So it seems that the stdint.h check succeeded only because it didn't actually attempt to compile the test program #including the header, because for whatever reason, a dependency mechanism failed, and it re-used the compiled object from the successful sys/types.h check. (The failing dependency mechanism does not appear to be the makefile processor, because neither setting MAKE=gmake or PATH-redirecting "make" to gmake makes the problem go away.) I believe a fix would be for try_compile() to delete any existing output object file before it attempts compilation. Why take the risk? | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2010-05-14 15:59 | Daniel Richard G. | New Issue | |||
| 2010-08-03 12:23 | Kovarththanan Rajaratnam | Category | CMake => Modules | ||
| 2011-01-17 16:00 | David Cole | Assigned To | => David Cole | ||
| 2011-01-17 16:00 | David Cole | Status | new => assigned | ||
| 2011-01-17 16:02 | David Cole | Note Added: 0024811 | |||
| 2011-01-17 16:02 | David Cole | Status | assigned => resolved | ||
| 2011-01-17 16:02 | David Cole | Fixed in Version | => CMake 2.8.4 | ||
| 2011-01-17 16:02 | David Cole | Resolution | open => no change required | ||
| 2011-01-17 17:47 | Daniel Richard G. | Note Added: 0024838 | |||
| 2011-01-17 17:47 | Daniel Richard G. | Status | resolved => feedback | ||
| 2011-01-17 17:47 | Daniel Richard G. | Resolution | no change required => reopened | ||
| 2011-01-17 17:50 | David Cole | Assigned To | David Cole => Bill Hoffman | ||
| 2011-01-17 17:50 | David Cole | Status | feedback => assigned | ||
| 2016-06-10 14:28 | Kitware Robot | Note Added: 0041698 | |||
| 2016-06-10 14:28 | Kitware Robot | Status | assigned => resolved | ||
| 2016-06-10 14:28 | Kitware Robot | Fixed in Version | CMake 2.8.4 => | ||
| 2016-06-10 14:28 | Kitware Robot | Resolution | reopened => moved | ||
| 2016-06-10 14:31 | Kitware Robot | Status | resolved => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||