Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
To: openembedded-core@lists.openembedded.org
Cc: Khem Raj <raj.khem@gmail.com>
Subject: [PATCH v6 07/13] llvm: forcibly disable __isoc23_strtol usage
Date: Mon, 07 Apr 2025 12:48:12 +0300	[thread overview]
Message-ID: <20250407-mesa-25-v6-7-29bf4cae8d28@oss.qualcomm.com> (raw)
In-Reply-To: <20250407-mesa-25-v6-0-29bf4cae8d28@oss.qualcomm.com>

In the multiconfig builds the llvm-native build can get reused from the
sstate cache with uninative being bypassed. This can result in the
undefined __isoc23_strtol symbols (which are supported by the uninative,
but not by the host library).

In order to prevent such link issues, forcibly disable usage of C23
strtol functions inside the native LLVM build.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
---
 meta/recipes-devtools/llvm/llvm/isoc23.h  | 11 +++++++++++
 meta/recipes-devtools/llvm/llvm_20.1.1.bb |  4 ++++
 2 files changed, 15 insertions(+)

diff --git a/meta/recipes-devtools/llvm/llvm/isoc23.h b/meta/recipes-devtools/llvm/llvm/isoc23.h
new file mode 100644
index 0000000000000000000000000000000000000000..b6738b6aaeb4e140aebad37ba0efb48a29cfac9b
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/isoc23.h
@@ -0,0 +1,11 @@
+/*
+ * Copyright (c) 2024 Qualcomm Technologies, Inc.
+ * SPDX-License-Identifier: Apache-2.0-with-LLVM-exception
+ */
+#include <features.h>
+
+#undef __GLIBC_USE_C23_STRTOL
+#define __GLIBC_USE_C23_STRTOL 0
+
+#undef __GLIBC_USE_C2X_STRTOL
+#define __GLIBC_USE_C2X_STRTOL 0
diff --git a/meta/recipes-devtools/llvm/llvm_20.1.1.bb b/meta/recipes-devtools/llvm/llvm_20.1.1.bb
index b95473c88b64961cb6ae2f4ace14aac4600cf98e..69f19aee59388f92c254c1f049622845713f4e94 100644
--- a/meta/recipes-devtools/llvm/llvm_20.1.1.bb
+++ b/meta/recipes-devtools/llvm/llvm_20.1.1.bb
@@ -27,6 +27,7 @@ SRC_URI = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${PV}/
            file://0007-llvm-allow-env-override-of-exe-path.patch \
            file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch \
            file://llvm-config \
+           file://isoc23.h \
            "
 SRC_URI[sha256sum] = "4d5ebbd40ce1e984a650818a4bb5ae86fc70644dec2e6d54e78b4176db3332e0"
 UPSTREAM_CHECK_URI = "https://github.com/llvm/llvm-project"
@@ -71,6 +72,9 @@ LLVM_TARGETS ?= "AMDGPU;${@get_llvm_host_arch(bb, d)}"
 ARM_INSTRUCTION_SET:armv5 = "arm"
 ARM_INSTRUCTION_SET:armv4t = "arm"
 
+
+BUILD_CPPFLAGS += "-include ${UNPACKDIR}/isoc23.h"
+
 EXTRA_OECMAKE += "-DLLVM_ENABLE_ASSERTIONS=OFF \
                   -DLLVM_ENABLE_EXPENSIVE_CHECKS=OFF \
                   -DLLVM_ENABLE_PIC=ON \

-- 
2.39.5



  parent reply	other threads:[~2025-04-07  9:48 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  9:48 [PATCH v6 00/13] mesa: upgrade to 25.0.2 Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 01/13] runqemu: also set GBM_BACKENDS_PATH Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 02/13] llvm: move libLLVM.so.N.M to llvm-libllvm package Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 03/13] llvm: use OECMAKE_SOURCEPATH to specify cmake dir Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 04/13] llvm: handle libdir in llvm-config Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 05/13] llvm: also use llvm-config wrapper for nativesdk recipes Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 06/13] llvm: remove LLVM_LDFLAGS from llvm-config --ldflags output Dmitry Baryshkov
2025-04-07  9:48 ` Dmitry Baryshkov [this message]
2025-04-07 11:22   ` [OE-core] [PATCH v6 07/13] llvm: forcibly disable __isoc23_strtol usage Alexander Kanavin
2025-04-07 11:58     ` Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 08/13] llvm: support building libclc Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 09/13] llvm: add SPIRV-LLVM-Translator support Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 10/13] llvm: enable more targets to build Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 11/13] mesa: upgrade 24.0.7 -> 25.0.2 Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 12/13] bindgen-cli: a tool to generate Rust bindings Dmitry Baryshkov
2025-04-07  9:48 ` [PATCH v6 13/13] mesa: add support for RustiCL under PACKAGECONFIG "opencl" Dmitry Baryshkov
2025-04-08 13:34 ` [OE-core] [PATCH v6 00/13] mesa: upgrade to 25.0.2 Mathieu Dubois-Briand
2025-04-08 19:08   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250407-mesa-25-v6-7-29bf4cae8d28@oss.qualcomm.com \
    --to=dmitry.baryshkov@oss.qualcomm.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox