From patchwork Wed May 30 11:46:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Korenblit X-Patchwork-Id: 922738 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=smile.fr Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40wpjT0NKzz9s1d for ; Wed, 30 May 2018 21:47:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 22BFF86935; Wed, 30 May 2018 11:47:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3JDLgR6O7KP2; Wed, 30 May 2018 11:47:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6711786769; Wed, 30 May 2018 11:47:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 7E9A21C218D for ; Wed, 30 May 2018 11:47:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 7BE0B2E0A2 for ; Wed, 30 May 2018 11:47:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UUMUt1Nvh4EB for ; Wed, 30 May 2018 11:47:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from idris.smile.fr (idris.smile.fr [91.216.209.19]) by silver.osuosl.org (Postfix) with ESMTPS id 18D472E028 for ; Wed, 30 May 2018 11:47:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by idris.smile.fr (Postfix) with ESMTP id 48DA01EE287C; Wed, 30 May 2018 13:46:57 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at smile.fr Received: from idris.smile.fr ([127.0.0.1]) by localhost (bluemind-mta.prod.vitry.intranet [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id HgCNs+bi7TZA; Wed, 30 May 2018 13:46:57 +0200 (CEST) Received: from sisellBox.daviel.idf.intranet (static-css-ccs-204145.business.bouyguestelecom.com [176.157.204.145]) by idris.smile.fr (Postfix) with ESMTPSA id DDC601EE276E; Wed, 30 May 2018 13:46:56 +0200 (CEST) From: Valentin Korenblit To: buildroot@buildroot.org Date: Wed, 30 May 2018 13:46:51 +0200 Message-Id: <20180530114651.3225-1-valentin.korenblit@smile.fr> X-Mailer: git-send-email 2.14.3 Subject: [Buildroot] [PATCH v2] package/clang: fix host-clang binaries X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Valentin Korenblit , romain.naour@gmail.com MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch fixes the following error when trying to execute clang compiler (host-variant): CommandLine Error: Option 'x86-use-base-pointer' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options The same happens for the other binaries, such as clang-format: ./clang-format : CommandLine Error: Option 'help-list' registered more than once! LLVM ERROR: inconsistency in registered CommandLine options Clang binaries are tools, and given that DLLVM_LINK_LLVM_DYLIB is set, they are linked against libLLVM.so. The problem is that binaries are also linking against some LLVM static libraries, resulting in the error shown above. However, it is not the same case for libclang, which is also a tool but links only against libLLVM.so. To fix this problem, add LLVM_DYLIB_COMPONENTS=all. Signed-off-by: Valentin Korenblit Tested-by: Joseph Kogut --- Currently there is no package in Buildroot that needs host-clang compiler. This error was found when trying to build libclc (WIP) after having applied: http://lists.busybox.net/pipermail/buildroot/2018-May/221386.html Changes v1 -> v2: *Use LLVM_DYLIB_COMPONENTS=all instead of patching CMakeLists.txt of clang binaries. package/clang/clang.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/clang/clang.mk b/package/clang/clang.mk index ae0140c783..dc086c6eed 100644 --- a/package/clang/clang.mk +++ b/package/clang/clang.mk @@ -89,5 +89,9 @@ HOST_CLANG_POST_INSTALL_HOOKS = HOST_CLANG_INSTALL_CLANG_TBLGEN HOST_CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON CLANG_CONF_OPTS += -DLLVM_LINK_LLVM_DYLIB=ON +# Prevent clang binaries from linking against LLVM static libs +HOST_CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all +CLANG_CONF_OPTS += -DLLVM_DYLIB_COMPONENTS=all + $(eval $(cmake-package)) $(eval $(host-cmake-package))