[cmake-developers] [CMake 0012457]: Wrong detection for pthread under Linux
Mantis Bug Tracker
mantis at public.kitware.com
Wed Sep 14 11:28:56 EDT 2011
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=12457
======================================================================
Reported By: Funda Wang
Assigned To:
======================================================================
Project: CMake
Issue ID: 12457
Category: CMake
Reproducibility: always
Severity: major
Priority: normal
Status: new
======================================================================
Date Submitted: 2011-09-14 11:28 EDT
Last Modified: 2011-09-14 11:28 EDT
======================================================================
Summary: Wrong detection for pthread under Linux
Description:
The patch introduced in http://public.kitware.com/Bug/view.php?id=11333 produces
wrong result for Linux.
It always builds successful when checking symbols within the first round
detection. i.e.
<snip>
Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory
`/home/fwang/rpm/BUILD/OpenSceneGraph-3.0.0/build/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/fwang/rpm/BUILD/OpenSceneGraph-3.0.0/build/CMakeFiles/CMakeTmp/CMakeFiles
1
Building C object CMakeFiles/cmTryCompileExec.dir/CheckSymbolExists.c.o
/usr/bin/gcc -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fomit-frame-pointer -mtune=generic -march=i586
-fasynchronous-unwind-tables -o a.c.o -c a.c
Linking C executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt
--verbose=1
/usr/bin/gcc -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector
--param=ssp-buffer-size=4 -fomit-frame-pointer -mtune=generic -march=i586
-fasynchronous-unwind-tables -Wl,--as-needed -Wl,--no-undefined
-Wl,-z,relro -Wl,-O1 -Wl,--build-id -Wl,--enable-new-dtags a.c.o -o
cmTryCompileExec -rdynamic
gmake[1]: Leaving directory
`/home/fwang/rpm/BUILD/OpenSceneGraph-3.0.0/build/CMakeFiles/CMakeTmp'
File
/home/fwang/rpm/BUILD/OpenSceneGraph-3.0.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
void cmakeRequireSymbol(int dummy,...){(void)dummy;}
int main()
{
#ifndef pthread_create
cmakeRequireSymbol(0,&pthread_create);
#endif
return 0;
}
</snip>
Maybe check libc's pthread function should be conditioned with platform.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2011-09-14 11:28 Funda Wang New Issue
======================================================================
More information about the cmake-developers
mailing list