From patchwork Thu Oct 27 18:59:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= X-Patchwork-Id: 14481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9650DECAAA1 for ; Thu, 27 Oct 2022 19:00:09 +0000 (UTC) Received: from mail.lindev.ch (mail.lindev.ch [5.39.83.55]) by mx.groups.io with SMTP id smtpd.web09.1360.1666897202204865417 for ; Thu, 27 Oct 2022 12:00:02 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=softfail (domain: baylibre.com, ip: 5.39.83.55, mailfrom: bero@baylibre.com) Received: from c64.fritz.box (unknown [81.221.122.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bero@lindev.ch) by mail.lindev.ch (Postfix) with ESMTPSA id E92CC410036A; Thu, 27 Oct 2022 20:59:59 +0200 (CEST) From: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= To: openembedded-core@lists.openembedded.org Cc: =?utf-8?q?Bernhard_Rosenkr=C3=A4nzer?= Subject: [PATCH 1/1] cmake-native: Fix host tool contamination (Bug: 14951) Date: Thu, 27 Oct 2022 20:59:39 +0200 Message-Id: <20221027185937.2023904-1-bero@baylibre.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 27 Oct 2022 19:00:09 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/172200 Trying to build cmake-native on a host system where curl was built with cmake (resulting in CURLConfig.cmake and friends, which do not use the same naming schemes expected by cmake-native's build process, being installed to a system wide cmake directory like /usr/lib64/cmake/CURL) results in undefined references to all libcurl symbols. The problem is that cmake-native sees and uses the system wide /usr/lib64/cmake/CURL/CURLConfig.cmake, which defines CURL::libcurl and CURL::curl as opposed to setting ${CURL_LIBRARIES} as expected by cmake-native. find_package(CURL) (cmake-native's CMakeLists.txt, line 478) succeeds, but incorrectly uses the system wide CURLConfig.cmake, resulting CMAKE_CURL_LIBRARIES to be set to an empty string (cmake-native's CMakeLists.txt, line 484), causing the cmake-native build to miss -lcurl. The simplest fix is to let cmake know the right value for CURL_LIBRARIES. Making it -lcurl should always work with libcurl-native in recipe-sysroot-native. Signed-off-by: Bernhard Rosenkränzer --- meta/recipes-devtools/cmake/cmake-native_3.24.0.bb | 1 + 1 file changed, 1 insertion(+) diff --git a/meta/recipes-devtools/cmake/cmake-native_3.24.0.bb b/meta/recipes-devtools/cmake/cmake-native_3.24.0.bb index 722a486f20..bcc87eb8f2 100644 --- a/meta/recipes-devtools/cmake/cmake-native_3.24.0.bb +++ b/meta/recipes-devtools/cmake/cmake-native_3.24.0.bb @@ -32,6 +32,7 @@ CMAKE_EXTRACONF = "\ -DCMAKE_USE_SYSTEM_LIBRARY_EXPAT=0 \ -DENABLE_ACL=0 -DHAVE_ACL_LIBACL_H=0 \ -DHAVE_SYS_ACL_H=0 \ + -DCURL_LIBRARIES=-lcurl \ " do_configure () {