Skip to content

Cling visibility and semantic interposition#8204

Merged
Axel-Naumann merged 7 commits intoroot-project:masterfrom
Axel-Naumann:cling-visibility-semantic-interpos
May 25, 2021
Merged

Cling visibility and semantic interposition#8204
Axel-Naumann merged 7 commits intoroot-project:masterfrom
Axel-Naumann:cling-visibility-semantic-interpos

Conversation

@Axel-Naumann
Copy link
Copy Markdown
Member

Wit kudos to @hahnjo !

@Axel-Naumann Axel-Naumann self-assigned this May 19, 2021
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@vgvassilev
Copy link
Copy Markdown
Member

Yes! Could you also now try running clingtest as part of the regular ROOT testing procedure? I believe (with minor adjustments) it will work.

Comment on lines +134 to +136
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
ROOT_ADD_CXX_FLAG(CMAKE_CXX_FLAGS "-fno-semantic-interposition")
endif()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We likely also want this for Clang, right? (or is CMAKE_CXX_COMPILER_ID set to GNU in that case as well?)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found this restriction in https://reviews.llvm.org/D102453:

Note: we cannot add -fno-semantic-interposition for Clang. Clang's implementation additionally optimizes global variables, which is incompatible with unfortunate ELF -fno-pic default: direct access relocations for external data. If the executable has a -fno-pic object file referencing a global variable declared in a public header, the direct access relocation will cause a copy relocation. The executable and libLLVM.so/libclang-cpp.so will disagree on the address.

OTOH why not try :-)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, unfortunate. On the other hand, we don't want users to call into LLVM directly so we should be fine?

@Axel-Naumann Axel-Naumann force-pushed the cling-visibility-semantic-interpos branch from e469190 to 56b0727 Compare May 19, 2021 12:46
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann
Copy link
Copy Markdown
Member Author

@vgvassilev

Could you also now try running clingtest as part of the regular ROOT testing procedure? I believe (with minor adjustments) it will work.

Sure, but this PR makes this neither easier nor more difficult, nor should it have any other effect :-) We probably want a new build flavor, to make sure that things work both with and without cling-test. I.e. enable cling-test only on some builds. Which ones - one Fedora, one Mac? And I agree we should have this PR tested with cling-test.

@Axel-Naumann Axel-Naumann force-pushed the cling-visibility-semantic-interpos branch from 56b0727 to cdf7d78 Compare May 19, 2021 12:57
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
See console output.

@Axel-Naumann Axel-Naumann force-pushed the cling-visibility-semantic-interpos branch from cdf7d78 to c2ddba2 Compare May 19, 2021 12:59
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann Axel-Naumann force-pushed the cling-visibility-semantic-interpos branch from c2ddba2 to 2b5f647 Compare May 19, 2021 15:41
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann Axel-Naumann force-pushed the cling-visibility-semantic-interpos branch from 2b5f647 to 2bf3685 Compare May 19, 2021 15:47
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 19, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
@root-project root-project deleted a comment from phsft-bot May 21, 2021
Instead of relying on CLING_CXXFLAGS to collect as needed, set
the visbility explicitly, and use target_properties instead of
CMAKE_CXXFLAGS.
To prevent non-ROOT LLVM-libraries from replacing the symbols
cling needs (with possible version mismatches), tell GCC to
just always resolve calls to dynamic symbols to symbols from
libCling itself.
Rather than string-replacing visibility, use the CMake interface.
Do not set visibility in the ROOT case; ROOT can handle that
just fine itself.
ROOT actually does *not* need visibility=default, now that the
few symbols that are required for using cling (apart from clingtest)
are explicitly requested through attributes.
@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann
Copy link
Copy Markdown
Member Author

@phsft-bot build

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14
How to customize builds

@Axel-Naumann
Copy link
Copy Markdown
Member Author

@phsft-bot build with flags -Dclingtest=On

@phsft-bot
Copy link
Copy Markdown

Starting build on ROOT-debian10-i386/cxx14, ROOT-performance-centos8-multicore/default, ROOT-fedora30/cxx14, ROOT-fedora31/noimt, ROOT-ubuntu16/nortcxxmod, mac1014/python3, mac11.0/cxx17, windows10/cxx14 with flags -Dclingtest=On
How to customize builds

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora31/noimt.
Running on root-fedora-31-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-performance-centos8-multicore/default.
Running on olbdw-01.cern.ch:/data/sftnight/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on windows10/cxx14.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Errors:

  • [2021-05-25T08:16:40.906Z] CMake Error at C:/build/workspace/root-pullrequests-build/build/interpreter/cling/tools/plugins/clad/clad-prefix/src/clad-stamp/clad-configure-Release.cmake:37 (message):
  • [2021-05-25T08:16:40.906Z] CMake Error at C:/build/workspace/root-pullrequests-build/build/interpreter/cling/tools/plugins/clad/clad-prefix/src/clad-stamp/clad-configure-Release.cmake:47 (message):
  • [2021-05-25T08:16:40.906Z] CMake Error at CMakeLists.txt:257 (message):

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-fedora30/cxx14.
Running on root-fedora30-2.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-ubuntu16/nortcxxmod.
Running on sft-ubuntu-1604-1.cern.ch:/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

@phsft-bot
Copy link
Copy Markdown

Build failed on mac1014/python3.
Running on macitois21.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link
Copy Markdown

Build failed on ROOT-debian10-i386/cxx14.
Running on pcepsft11.dyndns.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@Axel-Naumann
Copy link
Copy Markdown
Member Author

Macs were failing exactly like this before (in numba, with -Dclingtest=On): #3760 (comment)

Copy link
Copy Markdown
Member

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Collaborator

@oshadura oshadura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CMake changes makes sense to me, thanks for improvements!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ROOT 6.24 breaks Alice O2 due to symbol confusion with system llvm 11

5 participants