]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Apply fix for clang crashing on invalid -Wa,-march= values
authorDimitry Andric <dim@FreeBSD.org>
Sun, 5 Dec 2021 17:54:13 +0000 (18:54 +0100)
committerDimitry Andric <dim@FreeBSD.org>
Fri, 10 Dec 2021 21:28:56 +0000 (22:28 +0100)
commite4bde9c969cc1d079403850e964d9548316968a1
treed67cfc831a6ba145863b27993778d1e2e2bcecba
parent71746ff01dc0352205a517bf7870768f67a23633
Apply fix for clang crashing on invalid -Wa,-march= values

Merge commit df08b2fe8b35 from llvm git (by Dimitry Andric):

  [AArch64] Avoid crashing on invalid -Wa,-march= values

  As reported in https://bugs.freebsd.org/260078, the gnutls Makefiles
  pass -Wa,-march=all to compile a number of assembly files. Clang does
  not support this -march value, but because of a mistake in handling
  the arguments, an unitialized Arg pointer is dereferenced, which can
  cause a segfault.

  Work around this by adding a check if the local WaMArch variable is
  initialized, and if so, using its value in the diagnostic message.

  Reviewed By: tschuett

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

PR: 260078
Reported by: bz
MFC after: 3 days

(cherry picked from commit a9cd5c30d64e213c537c76c2a261f7a222f348bf)
contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/AArch64.cpp