View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015359CMakeCMakepublic2015-01-19 16:392016-06-10 14:31
ReporterLaurent Demailly 
Assigned ToKitware Robot 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionmoved 
PlatformApple MacOSOS XOS Version10.4.10
Product VersionCMake 3.1 
Target VersionFixed in Version 
Summary0015359: __attribute__((weak)) support/detection (weak symbols)
Descriptionit would be great if some built in recipe would set some variable depending on whether the
compiler/linker support __attribute__((weak))


this is done in autoconf the following way for instance:

AC_CACHE_CHECK(
  [for weak symbol support],
  [folly_cv_prog_cc_weak_symbols],
  [AC_LINK_IFELSE(
    [AC_LANG_SOURCE[
      extern "C" void configure_link_extern_weak_test()
__attribute__((weak));
      int main(int argc, char** argv) {
          return configure_link_extern_weak_test == nullptr;
      }]],
    [folly_cv_prog_cc_weak_symbols="yes"],
    [folly_cv_prog_cc_weak_symbols="no"])])

if test "$folly_cv_prog_cc_weak_symbols" = yes; then
  AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
            [Define to 1 if the linker supports weak symbols.])
fi


ps: sent similar request (more of a question on how to do it pending built in support by cmake base) to the cmake@cmake.org mailing list - hope it's ok to have some amount of duplicate
TagsNo tags attached.
Attached Files

 Relationships
related to 0015361closedKitware Robot CHECK_CXX_SOURCE_COMPILES doesn't use c++11 flags specified 

  Notes
(0037749)
Brad King (manager)
2015-01-19 16:43

Link to mailing list thread mentioned in description:

 detecting __attribute__((weak)) support
 http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/51503 [^]
(0037752)
Laurent Demailly (reporter)
2015-01-19 18:30

so I tried to use
CHECK_CXX_SOURCE_COMPILES to do the above
and stepped on
http://public.kitware.com/Bug/view.php?id=15361 [^]

(2 different issues though - one would for cmake to know about weak symbol support and the other is how to test compile with the same flags as requested)
(0042700)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2015-01-19 16:39 Laurent Demailly New Issue
2015-01-19 16:43 Brad King Note Added: 0037749
2015-01-19 18:30 Laurent Demailly Note Added: 0037752
2015-01-20 08:31 Brad King Relationship added related to 0015361
2016-06-10 14:29 Kitware Robot Note Added: 0042700
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team