Project

General

Profile

Support #13984

cetlib build failure with native clang from Xcode 8

Added by Adam Lyon almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Category:
Infrastructure
Target version:
-
Start date:
09/30/2016
Due date:
% Done:

100%

Estimated time:
Spent time:
Scope:
Internal
Experiment:
g-2
SSI Package:
cetlib
Duration:

Description

MarcP and I are experimenting with building the art suite and externals with Xcode 8 native clang (e.g. Mac El Capitan). We have a show-stopper build failure in cetlib...

[ 92%] Building CXX object cetlib/cetlib/test/CMakeFiles/cetlib_test_TestPlugin_plugin.dir/TestPlugin_plugin.cc.o
/Users/lyon/Development/clangstuff/dev/srcs/cetlib/cetlib/test/TestPlugin_plugin.cc:25:3: error: 'makePlugin' has C-linkage specified, but returns incomplete type 'std::unique_ptr<cettest::TestPluginBase>' which could
      be incompatible with C [-Werror,-Wreturn-type-c-linkage]
  makePlugin(std::string message)
  ^
/Users/lyon/Development/clangstuff/dev/srcs/cetlib/cetlib/test/TestPlugin_plugin.cc:31:1: error: 'pluginType' has C-linkage specified, but returns user-defined type 'std::string'
      (aka 'basic_string<char, char_traits<char>, allocator<char> >') which is incompatible with C [-Werror,-Wreturn-type-c-linkage]
DEFINE_BASIC_PLUGINTYPE_FUNC(cettest::TestPluginBase)
^
/Users/lyon/Development/clangstuff/dev/srcs/cetlib/cetlib/PluginTypeDeducer.h:35:5: note: expanded from macro 'DEFINE_BASIC_PLUGINTYPE_FUNC'
    pluginType()                                  \
    ^
2 errors generated.

How to fix?

clang.patch (1.08 KB) clang.patch Christopher Green, 10/03/2016 12:13 PM

History

#1 Updated by Ben Morgan almost 4 years ago

Briefly discussed with Adam and Marc over email, but for reference, this was originally reported as a support request on error handling in Issue #11826 (NB, that's marked as closed as it was a pure support request not a bug report)

#2 Updated by Christopher Green almost 4 years ago

  • File clang.patch added
  • Tracker changed from Bug to Support
  • Status changed from New to Feedback
  • Assignee set to Christopher Green
  • % Done changed from 0 to 100
  • Experiment g-2 added
  • Experiment deleted (-)

A trawl of the C++14 standard shows nothing that explicitly permits or prohibits the behavior we use, so we believe that the correct workaround is to add -Wno-return-type-c-linkage to the compile options. Please apply the attached patch and let me know if that solves the problem. There may be a couple of more places in art code where this adjustment needs to be applied. Please let us know if there are and include the error messages on this ticket, and we will address them in the same way.

#3 Updated by Christopher Green almost 4 years ago

Erroneous patch included previously.

#4 Updated by Christopher Green almost 4 years ago

  • File deleted (clang.patch)

#5 Updated by Kyle Knoepfel over 3 years ago

  • Status changed from Feedback to Closed


Also available in: Atom PDF