From patchwork Sat Mar 7 08:27:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 447553 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id C78531400DD for ; Sat, 7 Mar 2015 19:28:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=ltRvOdEY; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 17D3595D3A; Sat, 7 Mar 2015 08:28:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6t4oy+O9QWSd; Sat, 7 Mar 2015 08:28:03 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id B47A495D39; Sat, 7 Mar 2015 08:28:03 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 81B1C1C1E95 for ; Sat, 7 Mar 2015 08:28:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7B58392775 for ; Sat, 7 Mar 2015 08:28:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id txKJ5eh1pibq for ; Sat, 7 Mar 2015 08:28:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by whitealder.osuosl.org (Postfix) with ESMTPS id 851B792773 for ; Sat, 7 Mar 2015 08:28:01 +0000 (UTC) Received: by wiwl15 with SMTP id l15so8579493wiw.0 for ; Sat, 07 Mar 2015 00:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=ualTpoXCDNOQTwh4txCh6zSGMFQMzvFNB+L3tB/TUV4=; b=ltRvOdEY899muQNfy/OAPePOyvdXb2xzUP7Yb3G2rYwAb2IhmcvASLAIPKwTeCyW+w zntQqhoMUdG5E3LB5w+ATXU8GkV72IbV2PDbFNdQGbDFdBH+bgdRNBdoIeWVDBZYTDFt 84TTqowEXm09UhSZepoMmB2lJWh3FoZYi5pNnaKEDEuSAQ/AlytGPDqquRuMuneC+Ytz AI2BOS23wspKcPteqk+/DNEB7cFuqXOmkHo3geuM1ny8zR6KqnJVpOLxib6xfpaGKrBE p4imtJAJt1msMyTbShYQa5X3ahkrOcl9erkbHwMPslv97hVYOqXEKDJIU337DqFx4/sl a3Dw== X-Received: by 10.181.27.201 with SMTP id ji9mr53392126wid.20.1425716880001; Sat, 07 Mar 2015 00:28:00 -0800 (PST) Received: from mobeast.localdomain (dynamic-adsl-78-15-134-197.clienti.tiscali.it. [78.15.134.197]) by mx.google.com with ESMTPSA id u16sm18407574wjr.5.2015.03.07.00.27.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Mar 2015 00:27:59 -0800 (PST) From: Fabio Porcedda To: buildroot@uclibc.org Date: Sat, 7 Mar 2015 09:27:55 +0100 Message-Id: <1425716875-7054-1-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.3.1 MIME-Version: 1.0 Cc: Thomas Petazzoni Subject: [Buildroot] [PATCH v4] cmake: don't use any header available in $(HOST_DIR)/usr/include X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The -I options added to CMAKE_C_FLAGS are passed to the compiler before the -I options of the cmake internal headers, so when the host-xz package was already built, a #include directive loads the host-xz header instead of the cmake internal one. Because we don't want to use any header avaiable in -I$(HOST_DIR)/usr/include, just get rid of the -I options in the HOST_CFLAGS. Fix build failure: make host-xz host-cmake .../output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:17:1: error: conflicting types for ‘lzma_block_buffer_decode’ lzma_block_buffer_decode(lzma_block *block, lzma_allocator *allocator, ^ In file included from /home/tetsuya/buildroot/br2/output/host/usr/include/lzma.h:296:0, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/common.h:34, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_decoder.h:16, from /home/tetsuya/buildroot/br2/output/build/host-cmake-3.1.3/Utilities/cmliblzma/liblzma/common/block_buffer_decoder.c:13: /home/tetsuya/buildroot/br2/output/host/usr/include/lzma/block.h:577:27: note: previous declaration of ‘lzma_block_buffer_decode’ was here extern LZMA_API(lzma_ret) lzma_block_buffer_decode( ^ Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/build.make:261: recipe for target 'Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o' failed make[3]: *** [Utilities/cmliblzma/CMakeFiles/cmliblzma.dir/liblzma/common/block_buffer_decoder.c.o] Error 1 Fixes: http://autobuild.buildroot.org/results/4edf6e169dc4a00d8a8bd16a86eba2316cbbd9e5 http://autobuild.buildroot.org/results/a9ff38b22a36a2f8427d33085d3263a8cbfbd746 http://autobuild.buildroot.org/results/ecaa0227249207b5450519832a193c1585ac8177 Signed-off-by: Fabio Porcedda Cc: Thomas Petazzoni Cc: Baruch Siach Cc: Samuel Martin Tested-by: Samuel Martin Acked-by: Samuel Martin --- Notes: v4: - Use sed instead of filter-out (Thomas P.) - Add to the message the steps to reproduce the build failure v3: - Use filter-out instead of sed (Baruch) v2: - Instead of tring to use the system lzma library when avaiable, just always use the internal one (Thomas P.). package/cmake/cmake.mk | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/package/cmake/cmake.mk b/package/cmake/cmake.mk index 8c64b58..6581047 100644 --- a/package/cmake/cmake.mk +++ b/package/cmake/cmake.mk @@ -12,13 +12,19 @@ CMAKE_LICENSE_FILES = Copyright.txt HOST_CMAKE_DEPENDENCIES = host-pkgconf +# Get rid of -I* options to prevent that a header avaiable in +# $(HOST_DIR)/usr/include is used instead of a cmake one, e.g. lzma* +# headers of the xz package +HOST_CMAKE_CFLAGS = $(shell echo $(HOST_CFLAGS) | \ + sed -r "s/(^|[[:space:]]+)-I[[:space:]]*[^[:space:]]*//") + define HOST_CMAKE_CONFIGURE_CMDS (cd $(@D); \ LDFLAGS="$(HOST_LDFLAGS)" \ - CFLAGS="$(HOST_CFLAGS)" \ + CFLAGS="$(HOST_CMAKE_CFLAGS)" \ ./bootstrap --prefix=$(HOST_DIR)/usr \ --parallel=$(PARALLEL_JOBS) -- \ - -DCMAKE_C_FLAGS="$(HOST_CFLAGS)" \ + -DCMAKE_C_FLAGS="$(HOST_CMAKE_CFLAGS)" \ -DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS)" \ -DCMAKE_EXE_LINKER_FLAGS="$(HOST_LDFLAGS)" \ -DBUILD_CursesDialog=OFF \