From e414f6489e055c981970b7210b941c2a41cc322b Mon Sep 17 00:00:00 2001
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Date: Wed, 2 Apr 2025 17:05:17 +0300
Subject: [PATCH] llvm-config: remove LLVM_LDFLAGS from --ldflags output

On native OE builds the LLVM_LDFLAGS gets a lot of extra flags which may
depend on exact build dir and as such be inappropriate to binaries
shared through sstate-cache. It is not possible to override this
behaviour in llvm-config since crossscripts are not being used for
native builds. As a OE-specific modification ignore LLVM_LDFLAGS for
native builds.

Upstream-Status: Inappropriate [OE-Specific]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 llvm/tools/llvm-config/llvm-config.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp
index a739f0d8dbea..3120f95fba9d 100644
--- a/llvm/tools/llvm-config/llvm-config.cpp
+++ b/llvm/tools/llvm-config/llvm-config.cpp
@@ -542,7 +542,7 @@ int main(int argc, char **argv) {
         OS << ActiveIncludeOption << ' ' << LLVM_CXXFLAGS << '\n';
       } else if (Arg == "--ldflags") {
         OS << ((HostTriple.isWindowsMSVCEnvironment()) ? "-LIBPATH:" : "-L")
-           << ActiveLibDir << ' ' << LLVM_LDFLAGS << '\n';
+           << ActiveLibDir << '\n';
       } else if (Arg == "--system-libs") {
         PrintSystemLibs = true;
       } else if (Arg == "--libs") {
