This is just for compiler-rt. The reason for having -fno-omit-frame-pointer is that tools like https://perf.wiki.kernel.org/index.php/Main_Page would work on ASAN binaries. Adrian On Mon, Jul 20, 2015, at 02:23 PM, adek at adek.io wrote:> Hey, > > Thanks for ideas. I tried them on, but none of them succeeded. > > If I remove this line: > https://github.com/llvm-mirror/compiler-rt/blob/c9d8d35a5c2bdd6a0dd41f1b6cf3afb822df6a6e/CMakeLists.txt#L207 > > Everything is correctly built with -fno-omit-frame-pointer. > > Any suggestion why it would be the case? > > Thanks, > Adrian > > On Mon, Jul 20, 2015, at 01:39 PM, Martin J. O'Riordan wrote: > > I regularly use '-DCMAKE_CXX_FLAGS' when configuring CLang/LLVM to > > distinguish my builds (Alpha/Beta/Final) or to build custom versions, > > usually by adding additional '-D' flags, but I discovered I had to add > > the ':STRING' qualifier to it when invoking 'cmake'. With 'gmake' this > > is equivalent to '--with-extra-options="whatever flags": > > > > -DCMAKE_CXX_FLAGS:STRING="whatever flags" > > > > This works regardless of whether it is a Debug or Release build. > > > > All the best, > > > > MartinO > > > > -----Original Message----- > > From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On > > Behalf Of Chris Bieneman > > Sent: 20 July 2015 19:23 > > To: adek at adek.io > > Cc: llvmdev at cs.uiuc.edu > > Subject: Re: [LLVMdev] CMake does not propagate flags to build > > > > Adrian, > > > > What makes you think CMAKE_CXX_FLAGS isn’t being respected? > > > > The tests will always occur regardless of whether or not you set the > > CXX_FLAGS explicitly. > > > > -Chris > > > > > On Jul 20, 2015, at 9:36 AM, adek at adek.io wrote: > > > > > > > > > Hey Pete, > > > > > > I also tried CMAKE_CXX_FLAGS_RELEASE > > > with the same effect. > > > > > > On Mon, Jul 20, 2015, at 09:34 AM, Pete Cooper wrote: > > >> Hi Adrian > > >> > > >> I’m not sure if the CMAKE_CXX_FLAGS is used in LLVM. We have our own > > >> flags for different configurations. I don’t remember if our ones > > >> inherit from CMAKE_CXX_FLAGS or override it completely. Anyway, they are: > > >> - CMAKE_CXX_FLAGS_DEBUG > > >> - CMAKE_CXX_FLAGS_MINSIZEREL > > >> - CMAKE_CXX_FLAGS_RELEASE > > >> - CMAKE_CXX_FLAGS_RELWITHDEBINFO > > >> > > >> The one of those you get depends on what you set CMAKE_BUILD_TYPE to. > > >> Options are ‘Debug, Release, RelWithDebInfo, MinSizeRel’ > > >> > > >> Cheers, > > >> Pete > > >>> On Jul 17, 2015, at 8:41 PM, adek at adek.io wrote: > > >>> > > >>> '-DCMAKE_CXX_FLAGS=-fno-omit-frame-pointer -Wno-maybe-uninitialized > > >>> -fPIC -fPIE' > > >>> -- The C compiler identification is GNU 4.8.1 > > >>> -- The CXX compiler identification is GNU 4.8.1 > > >>> -- Check for working C compiler: > > >>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc > > >>> -- Check for working C compiler: > > >>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc > > >>> -- works > > >>> -- Detecting C compiler ABI info > > >>> -- Detecting C compiler ABI info - done > > >>> -- Detecting C compile features > > >>> -- Detecting C compile features - done > > >>> -- Check for working CXX compiler: > > >>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ > > >>> -- Check for working CXX compiler: > > >>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ > > >>> -- works > > >>> -- Detecting CXX compiler ABI info > > >>> -- Detecting CXX compiler ABI info - done > > >>> -- Detecting CXX compile features > > >>> -- Detecting CXX compile features - done > > >>> -- Found PythonInterp: > > >>> /home/engshare/third-party2/python/2.7.5/centos6-native/da39a3e/bin/ > > >>> python2.7 > > >>> (found version "2.7.5") > > >>> -- Looking for unwind.h > > >>> -- Looking for unwind.h - found > > >>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG > > >>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG - Success > > >>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG > > >>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG - Success > > >>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG > > >>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG - Success > > >>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG > > >>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG - Success > > >>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG > > >>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG - > > >>> Success > > >>> > > >>> Is it still related to this: > > >>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-March/071394.html > > >>> > > >>> > > >>> Adrian Zgorzałek > > >>> > > >>> _______________________________________________ > > >>> LLVM Developers mailing list > > >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > >> > > > > > > _______________________________________________ > > > LLVM Developers mailing list > > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
At the moment I don’t believe we support building ASAN with -fno-omit-frame-pointer because doing so would likely have significant adverse impact on performance. Samsonov would know better, but especially if you’re looking to run profiling tools you really don’t want frame pointers for the runtime libraries. -Chris> On Jul 20, 2015, at 3:00 PM, adek at adek.io wrote: > > This is just for compiler-rt. The reason for having > -fno-omit-frame-pointer is that tools like > https://perf.wiki.kernel.org/index.php/Main_Page would work on ASAN > binaries. > > Adrian > > On Mon, Jul 20, 2015, at 02:23 PM, adek at adek.io wrote: >> Hey, >> >> Thanks for ideas. I tried them on, but none of them succeeded. >> >> If I remove this line: >> https://github.com/llvm-mirror/compiler-rt/blob/c9d8d35a5c2bdd6a0dd41f1b6cf3afb822df6a6e/CMakeLists.txt#L207 >> >> Everything is correctly built with -fno-omit-frame-pointer. >> >> Any suggestion why it would be the case? >> >> Thanks, >> Adrian >> >> On Mon, Jul 20, 2015, at 01:39 PM, Martin J. O'Riordan wrote: >>> I regularly use '-DCMAKE_CXX_FLAGS' when configuring CLang/LLVM to >>> distinguish my builds (Alpha/Beta/Final) or to build custom versions, >>> usually by adding additional '-D' flags, but I discovered I had to add >>> the ':STRING' qualifier to it when invoking 'cmake'. With 'gmake' this >>> is equivalent to '--with-extra-options="whatever flags": >>> >>> -DCMAKE_CXX_FLAGS:STRING="whatever flags" >>> >>> This works regardless of whether it is a Debug or Release build. >>> >>> All the best, >>> >>> MartinO >>> >>> -----Original Message----- >>> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On >>> Behalf Of Chris Bieneman >>> Sent: 20 July 2015 19:23 >>> To: adek at adek.io >>> Cc: llvmdev at cs.uiuc.edu >>> Subject: Re: [LLVMdev] CMake does not propagate flags to build >>> >>> Adrian, >>> >>> What makes you think CMAKE_CXX_FLAGS isn’t being respected? >>> >>> The tests will always occur regardless of whether or not you set the >>> CXX_FLAGS explicitly. >>> >>> -Chris >>> >>>> On Jul 20, 2015, at 9:36 AM, adek at adek.io wrote: >>>> >>>> >>>> Hey Pete, >>>> >>>> I also tried CMAKE_CXX_FLAGS_RELEASE >>>> with the same effect. >>>> >>>> On Mon, Jul 20, 2015, at 09:34 AM, Pete Cooper wrote: >>>>> Hi Adrian >>>>> >>>>> I’m not sure if the CMAKE_CXX_FLAGS is used in LLVM. We have our own >>>>> flags for different configurations. I don’t remember if our ones >>>>> inherit from CMAKE_CXX_FLAGS or override it completely. Anyway, they are: >>>>> - CMAKE_CXX_FLAGS_DEBUG >>>>> - CMAKE_CXX_FLAGS_MINSIZEREL >>>>> - CMAKE_CXX_FLAGS_RELEASE >>>>> - CMAKE_CXX_FLAGS_RELWITHDEBINFO >>>>> >>>>> The one of those you get depends on what you set CMAKE_BUILD_TYPE to. >>>>> Options are ‘Debug, Release, RelWithDebInfo, MinSizeRel’ >>>>> >>>>> Cheers, >>>>> Pete >>>>>> On Jul 17, 2015, at 8:41 PM, adek at adek.io wrote: >>>>>> >>>>>> '-DCMAKE_CXX_FLAGS=-fno-omit-frame-pointer -Wno-maybe-uninitialized >>>>>> -fPIC -fPIE' >>>>>> -- The C compiler identification is GNU 4.8.1 >>>>>> -- The CXX compiler identification is GNU 4.8.1 >>>>>> -- Check for working C compiler: >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc >>>>>> -- Check for working C compiler: >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc >>>>>> -- works >>>>>> -- Detecting C compiler ABI info >>>>>> -- Detecting C compiler ABI info - done >>>>>> -- Detecting C compile features >>>>>> -- Detecting C compile features - done >>>>>> -- Check for working CXX compiler: >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ >>>>>> -- Check for working CXX compiler: >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ >>>>>> -- works >>>>>> -- Detecting CXX compiler ABI info >>>>>> -- Detecting CXX compiler ABI info - done >>>>>> -- Detecting CXX compile features >>>>>> -- Detecting CXX compile features - done >>>>>> -- Found PythonInterp: >>>>>> /home/engshare/third-party2/python/2.7.5/centos6-native/da39a3e/bin/ >>>>>> python2.7 >>>>>> (found version "2.7.5") >>>>>> -- Looking for unwind.h >>>>>> -- Looking for unwind.h - found >>>>>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG >>>>>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG - Success >>>>>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG >>>>>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG - Success >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG - Success >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG - Success >>>>>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG >>>>>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG - >>>>>> Success >>>>>> >>>>>> Is it still related to this: >>>>>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-March/071394.html >>>>>> >>>>>> >>>>>> Adrian Zgorzałek >>>>>> >>>>>> _______________________________________________ >>>>>> LLVM Developers mailing list >>>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>>>> >>>> >>>> _______________________________________________ >>>> LLVM Developers mailing list >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >>> >>> _______________________________________________ >>> LLVM Developers mailing list >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Sorry for the late response. Yes, we explicitly add -fomit-frame-pointer when we build sanitizer runtimes, and it may override what you set in CMAKE_CXX_FLAGS. It is indeed related to performance overhead, which is especially critical for slower tools like ThreadSanitizer, which inserts a call into runtime for *every* load/store in the original problem. On Mon, Jul 20, 2015 at 3:25 PM, Chris Bieneman <cbieneman at apple.com> wrote:> At the moment I don’t believe we support building ASAN with > -fno-omit-frame-pointer because doing so would likely have significant > adverse impact on performance. Samsonov would know better, but especially > if you’re looking to run profiling tools you really don’t want frame > pointers for the runtime libraries. >> > -Chris > > > On Jul 20, 2015, at 3:00 PM, adek at adek.io wrote: > > > > This is just for compiler-rt. The reason for having > > -fno-omit-frame-pointer is that tools like > > https://perf.wiki.kernel.org/index.php/Main_Page would work on ASAN > > binaries. > > > > Adrian > > > > On Mon, Jul 20, 2015, at 02:23 PM, adek at adek.io wrote: > >> Hey, > >> > >> Thanks for ideas. I tried them on, but none of them succeeded. > >> > >> If I remove this line: > >> > https://github.com/llvm-mirror/compiler-rt/blob/c9d8d35a5c2bdd6a0dd41f1b6cf3afb822df6a6e/CMakeLists.txt#L207 > >> > >> Everything is correctly built with -fno-omit-frame-pointer. > >> > >> Any suggestion why it would be the case? > >> > >> Thanks, > >> Adrian > >> > >> On Mon, Jul 20, 2015, at 01:39 PM, Martin J. O'Riordan wrote: > >>> I regularly use '-DCMAKE_CXX_FLAGS' when configuring CLang/LLVM to > >>> distinguish my builds (Alpha/Beta/Final) or to build custom versions, > >>> usually by adding additional '-D' flags, but I discovered I had to add > >>> the ':STRING' qualifier to it when invoking 'cmake'. With 'gmake' this > >>> is equivalent to '--with-extra-options="whatever flags": > >>> > >>> -DCMAKE_CXX_FLAGS:STRING="whatever flags" > >>> > >>> This works regardless of whether it is a Debug or Release build. > >>> > >>> All the best, > >>> > >>> MartinO > >>> > >>> -----Original Message----- > >>> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > On > >>> Behalf Of Chris Bieneman > >>> Sent: 20 July 2015 19:23 > >>> To: adek at adek.io > >>> Cc: llvmdev at cs.uiuc.edu > >>> Subject: Re: [LLVMdev] CMake does not propagate flags to build > >>> > >>> Adrian, > >>> > >>> What makes you think CMAKE_CXX_FLAGS isn’t being respected? > >>> > >>> The tests will always occur regardless of whether or not you set the > >>> CXX_FLAGS explicitly. > >>> > >>> -Chris > >>> > >>>> On Jul 20, 2015, at 9:36 AM, adek at adek.io wrote: > >>>> > >>>> > >>>> Hey Pete, > >>>> > >>>> I also tried CMAKE_CXX_FLAGS_RELEASE > >>>> with the same effect. > >>>> > >>>> On Mon, Jul 20, 2015, at 09:34 AM, Pete Cooper wrote: > >>>>> Hi Adrian > >>>>> > >>>>> I’m not sure if the CMAKE_CXX_FLAGS is used in LLVM. We have our own > >>>>> flags for different configurations. I don’t remember if our ones > >>>>> inherit from CMAKE_CXX_FLAGS or override it completely. Anyway, > they are: > >>>>> - CMAKE_CXX_FLAGS_DEBUG > >>>>> - CMAKE_CXX_FLAGS_MINSIZEREL > >>>>> - CMAKE_CXX_FLAGS_RELEASE > >>>>> - CMAKE_CXX_FLAGS_RELWITHDEBINFO > >>>>> > >>>>> The one of those you get depends on what you set CMAKE_BUILD_TYPE to. > >>>>> Options are ‘Debug, Release, RelWithDebInfo, MinSizeRel’ > >>>>> > >>>>> Cheers, > >>>>> Pete > >>>>>> On Jul 17, 2015, at 8:41 PM, adek at adek.io wrote: > >>>>>> > >>>>>> '-DCMAKE_CXX_FLAGS=-fno-omit-frame-pointer -Wno-maybe-uninitialized > >>>>>> -fPIC -fPIE' > >>>>>> -- The C compiler identification is GNU 4.8.1 > >>>>>> -- The CXX compiler identification is GNU 4.8.1 > >>>>>> -- Check for working C compiler: > >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc > >>>>>> -- Check for working C compiler: > >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/gcc > >>>>>> -- works > >>>>>> -- Detecting C compiler ABI info > >>>>>> -- Detecting C compiler ABI info - done > >>>>>> -- Detecting C compile features > >>>>>> -- Detecting C compile features - done > >>>>>> -- Check for working CXX compiler: > >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ > >>>>>> -- Check for working CXX compiler: > >>>>>> /home/engshare/third-party2/gcc/4.8.1/centos6-native/cc6c9dc/bin/g++ > >>>>>> -- works > >>>>>> -- Detecting CXX compiler ABI info > >>>>>> -- Detecting CXX compiler ABI info - done > >>>>>> -- Detecting CXX compile features > >>>>>> -- Detecting CXX compile features - done > >>>>>> -- Found PythonInterp: > >>>>>> /home/engshare/third-party2/python/2.7.5/centos6-native/da39a3e/bin/ > >>>>>> python2.7 > >>>>>> (found version "2.7.5") > >>>>>> -- Looking for unwind.h > >>>>>> -- Looking for unwind.h - found > >>>>>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG > >>>>>> -- Performing Test COMPILER_RT_HAS_FPIC_FLAG - Success > >>>>>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG > >>>>>> -- Performing Test COMPILER_RT_HAS_FPIE_FLAG - Success > >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG > >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_BUILTIN_FLAG - Success > >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG > >>>>>> -- Performing Test COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG - Success > >>>>>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG > >>>>>> -- Performing Test COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG - > >>>>>> Success > >>>>>> > >>>>>> Is it still related to this: > >>>>>> http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-March/071394.html > >>>>>> > >>>>>> > >>>>>> Adrian Zgorzałek > >>>>>> > >>>>>> _______________________________________________ > >>>>>> LLVM Developers mailing list > >>>>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >>>>> > >>>> > >>>> _______________________________________________ > >>>> LLVM Developers mailing list > >>>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >>> > >>> > >>> _______________________________________________ > >>> LLVM Developers mailing list > >>> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >>> > >> > >> _______________________________________________ > >> LLVM Developers mailing list > >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Alexey Samsonov vonosmas at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150721/af94cc5b/attachment.html>