Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scudo][standalone] Unable to link against -latomic causes inability build scudo test cases on LLVM 13.0.0-rc1 (PowerPC, RHEL) #50773

Closed
llvmbot opened this issue Aug 10, 2021 · 5 comments
Labels
bugzilla Issues migrated from bugzilla

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Aug 10, 2021

Bugzilla Link 51431
Resolution FIXED
Resolved on Oct 11, 2021 20:29
Version unspecified
OS Linux
Blocks #51489
Reporter LLVM Bugzilla Contributor
CC @amy-kwan,@tstellar
Fixed by commit(s) 4cd8dd3 cf035ca

Extended Description

The following fail on Linux RHEL on PowerPC8:
compiler-rt/lib/scudo/standalone/tests/ScudoCxxUnitTest-powerpc64le-Test
compiler-rt/lib/scudo/standalone/tests/ScudoCUnitTest-powerpc64le-Test
runtimes/CMakeFiles/check-runtimes

Due to:
ld.lld: error: unable to find library -latomic

This is still being investigated.

@amy-kwan
Copy link
Contributor

This failure is due to the fact that the RHEL system does not have libatomic on the system, and so we cannot link with it.

The specific failures:
[84/1028] Generating ScudoCUnitTest-powerpc64le-Test
FAILED: projects/compiler-rt/lib/scudo/standalone/tests/ScudoCUnitTest-powerpc64le-Test

[85/1028] Generating ScudoCxxUnitTest-powerpc64le-Test
FAILED: projects/compiler-rt/lib/scudo/standalone/tests/ScudoCxxUnitTest-powerpc64le-Test

[86/1028] Generating ScudoUnitTest-powerpc64le-Test
FAILED: projects/compiler-rt/lib/scudo/standalone/tests/ScudoUnitTest-powerpc64le-Test


The following commit has enabled the scudo standalone tests for Power:

commit f4ccbaf
Author: Mitch Phillips [email protected]
Date: Thu May 20 11:09:53 2021 -0700

[scudo] Add supported architectures.

Adds extra supported architectures that were available for vanilla
scudo, in preparation for D102543. Hopefully the dust has settled and
7d0a81ca38e427de9b7fb0961ec643b757028131 is no longer an issue.

Reviewed By: cryptoad, vitalybuka

Differential Revision: https://reviews.llvm.org/D102648

Moreover, in 2019, a commit to link against libatomic was added:

commit f50a953
Author: Kostya Kortchinsky [email protected]
Date: Wed Jul 3 16:32:01 2019 +0000

[scudo][standalone] Link tests against libatomic

Summary:
Some clang versions (< 6.0) do not inline the atomic builtin functions
leaving unresolved references to `__atomic_load_8` and so on (seems to
be mostly 64-bit atomics on 32-bit platforms).
I tried without success to use some cmake magic to detect when that
would be the case, and decided to fall back to unconditionally
linking libatomic.

Reviewers: morehouse, eugenis, vitalybuka, hctim, tejohnson

Reviewed By: tejohnson

Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D64134

llvm-svn: 365052

I think a solution can be linking against libatomic if libatomic is found.

@amy-kwan
Copy link
Contributor

I have put up https://reviews.llvm.org/D108503 to attempt to resolve this issue.

@amy-kwan
Copy link
Contributor

Hi Tom, I've committed https://reviews.llvm.org/rG4cd8dd3fe05e099792e1494dedd074eb5ba289b6 to attempt to resolve this issue.

Can we get this cherry-picked into the release branch?

@tstellar
Copy link
Collaborator

Merged: cf035ca

@tstellar
Copy link
Collaborator

mentioned in issue #51489

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants