In case anyone has a deja-vu: yes, it's true. This problem came up when I tried to fix bug 11333. Once a fix for that was out a user found out that his pthreads library was no longer detected. The root cause for this is that the CheckSymbolExists and CheckCXXSymbolExists macros do not work if you use gcc/g++ and -O3.
It looks like gcc simply optimizes out any reference to the tested symbol.
Given the fact that we don't really ever use that symbol anywhere it is even
correct to do so. Just that this is not what we want.
I pushed a topic test-symbol-exists to stage that verifies that this is indeed
a problem in Check{,CXX}SymbolExists, it iterates through all build
configurations (were this problem does _not_ happen) and later explicitely
adds a -O3 test if it is gcc/g++ which then _does_ fail.
So, there are 3 points that I need advise:
-what should happen with this topic? Should I merge it to next? Then we will
get a ton of failures on at least everything that is using GNU compilers.
-which other compilers can be tested this way, I mean using -O3? From what I
know Clang does understand this and even -O4, what is about the Intel one?
-how to fix this thing at the end? I was thinking about just doing
#include <stdio.h>
printf("%s is at %p\n", ${SYMBOL}, &${SYMBOL}));
Is anyone aware of some place where this wouldn't work? Or should I just put
this in and try out?
Greetings,
Eike
signature.asc
Description: This is a digitally signed message part.
-- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
