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

--rtlib does not trigger -Wunused-command-line-argument on AArch64 #53397

Open
glandium opened this issue Jan 25, 2022 · 4 comments
Open

--rtlib does not trigger -Wunused-command-line-argument on AArch64 #53397

glandium opened this issue Jan 25, 2022 · 4 comments
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'

Comments

@glandium
Copy link
Contributor

On some platforms, --rtlib=libgcc/--rtlib=compiler-rt only affect the libraries linked. On some others, it affects the generated code. As such, it needs to be passed as a CFLAGS and a LDFLAGS. The problem is that on platforms where the generated code, having it in CFLAGS triggers a unused-command-line-argument warning. Whether it affects the generated code is a clang implementation detail that build systems shouldn't be concerned with.

STR:

  • touch foo.c
  • clang -c foo.c --rtlib=libgcc --target=aarch64-linux-android -> no warning
  • clang -c foo.c --rtlib=libgcc --target=i686-linux-android -> warning: argument unused during compilation: '--rtlib=libgcc' [-Wunused-command-line-argument]
@EugeneZelenko
Copy link
Contributor

Could you please clarify platforms?

@EugeneZelenko EugeneZelenko added clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' and removed new issue labels Jan 25, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Jan 25, 2022

@llvm/issue-subscribers-clang-driver

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Jan 25, 2022
… r=firefox-build-system-reviewers,andi

Instead of forcing it via a patch to clang itself (which now conflicts
with other changes on clang trunk, although the conflict is benign).

Because of llvm/llvm-project#53397 we need to
narrow down the warnings that trigger errors in the check for
`pthread_cond_timedwait_monotonic_np`.

Differential Revision: https://phabricator.services.mozilla.com/D136850
@glandium
Copy link
Contributor Author

Could you please clarify platforms?

See the --targets in the STR.

@MaskRay
Copy link
Member

MaskRay commented Jan 25, 2022

  } else if (Triple.isAArch64() &&
             getToolChain().IsAArch64OutlineAtomicsDefault(Args)) {
    CmdArgs.push_back("-target-feature");
    CmdArgs.push_back("+outline-atomics");
  }

added by [AArch64][Clang][Linux] Enable out-of-line atomics by default. sets the Claimed bit of OPT_rtlib_EQ, so [-Wunused-command-line-argument] is never triggered on AArch64. @ilinpv

I do think -rtlib= affecting code generation is unfortunate. There should be a diagnostic like the one issued for -c --unwindlib= Hope we can remove this when we stop supporting Clang using GCC<9.3.1 runtime. Alternatively, we can ask such users to specify -mno-outline-atomics.

@MaskRay MaskRay changed the title --rtlib triggers a unused-command-line-argument warning on some platforms --rtlib does not trigger -Wunused-command-line-argument on AArch64 Jan 25, 2022
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Jan 26, 2022
… r=firefox-build-system-reviewers,andi

Instead of forcing it via a patch to clang itself (which now conflicts
with other changes on clang trunk, although the conflict is benign).

Because of llvm/llvm-project#53397 we need to
narrow down the warnings that trigger errors in the check for
`pthread_cond_timedwait_monotonic_np`.

Differential Revision: https://phabricator.services.mozilla.com/D136850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl'
Projects
None yet
Development

No branches or pull requests

4 participants