The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=15235 
====================================================================== 
Reported By:                Andrew Aladjev
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15235
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-11-06 11:57 EST
Last Modified:              2014-11-06 11:57 EST
====================================================================== 
Summary:                    CMAKE_LD_FLAGS from toolchain is ignored by
compiler's check
Description: 
I want to use gcc's thread sanitizer. I have toolchain.cmake

set (CMAKE_SYSTEM_NAME "Linux")
set (CMAKE_C_COMPILER "gcc-4.8.3")
set (CMAKE_C_FLAGS "-fPIE -Werror -Wno-maybe-uninitialized -fsanitize=thread
-fno-omit-frame-pointer" CACHE STRING "gcc-4.8.3 thread cflags")
set (CMAKE_LD_FLAGS "-pie")

Steps to Reproduce: 
cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.cmake ..

/usr/bin/gcc-4.8.3 -fPIE -Werror -Wno-maybe-uninitialized -fsanitize=thread
-fno-omit-frame-pointer
CMakeFiles/cmTryCompileExec3265698553.dir/testCCompiler.c.o -o
cmTryCompileExec3265698553 -rdynamic

gcc-4.8.3: error: -fsanitize=thread linking must be done with -pie or -shared

CMAKE_C_FLAGS works, but CMAKE_LD_FLAGS is ignored.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-11-06 11:57 Andrew Aladjev New Issue                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to