From patchwork Thu Mar 24 17:03:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Max Filippov X-Patchwork-Id: 601731 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qWCSg0rLGz9sBG for ; Fri, 25 Mar 2016 04:03:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=p0zNBIFz; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3BA038A4CF; Thu, 24 Mar 2016 17:03:46 +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 zEzzqDnJ+dM7; Thu, 24 Mar 2016 17:03:45 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 19E5C8AA24; Thu, 24 Mar 2016 17:03:45 +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 1C9A51C0E10 for ; Thu, 24 Mar 2016 17:03:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1725D2F594 for ; Thu, 24 Mar 2016 17:03:44 +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 uUhzDs0sjvG8 for ; Thu, 24 Mar 2016 17:03:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by silver.osuosl.org (Postfix) with ESMTPS id C8E0B33A10 for ; Thu, 24 Mar 2016 17:03:42 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id oe12so35151359lbc.0 for ; Thu, 24 Mar 2016 10:03:42 -0700 (PDT) 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-transfer-encoding; bh=pQ8zZnGc39E5ddMIYEKIaDTol2okMUUGMXT74LlKnqw=; b=p0zNBIFzWVXU16bV9K0OdsNTUXkA3WYMZZ+/C+eJesSn6J/B0Xx1Mgw/jpnEqVq7oO KfwIoyFsEghl2rsEs8rvYbt3jhrv2DQ4tkPlb/dmnK8WmBbYXJemQXOz3mw9WdWQGAZL IlBC60dwrn0rtTOAPXdnxoE9KaCrxtO2SFyq655Giw4HybNJoOToKSszm0XjGu/hP3Z1 d0eXuMhnG8z47FzOS2EWgNgcHjFQVWxWxT8KUz4rX3VqrM73467hJ8xIbwtsVo8ciGsU 2AUiOarEVwgav18jo7nPdeUVJ96tVv+wuT69Z2Z8L1heVo+Rbe/saTLEVeqQ+Kk5MxEs bn+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=pQ8zZnGc39E5ddMIYEKIaDTol2okMUUGMXT74LlKnqw=; b=ItD4xdAd1DD4dH7lMifTTVNEA2CZOBWoAAuOX6wsQMH3DtBx3sPHCaXf1yYE5Hr+/M oDq/j9Vjrr/tkkJhejgIXbDjmkO82d4+6xMnOHvMG4eHnos2+OAAhgT9JhD5DGkVFnQs dPBEdDaXkCqeUY/2MdZpk6hLUk65SzghrkDsTQuIrt/1gxTg23PrlVF2QHSs97IMOWLN APneC9FLQlo+bcyqBKWxNKKbbAvjy7uAM0JDQx0uCxT+/oKYQ12O54ihJYJN+3ST8+bv Y5YNTi+XIQ5/0d6j2S64CThbl9rgNJWRlzcOik9BrqIqUVL+x5Pu/8sX95OhIRMSGAy5 mW5w== X-Gm-Message-State: AD7BkJJetYFqFDRIpnG0MTeybii0UKtbPEc/EYpXEQgyrAkFOyXVuQaXmBEVFfTFRhKxjw== X-Received: by 10.112.202.136 with SMTP id ki8mr3964406lbc.10.1458839020915; Thu, 24 Mar 2016 10:03:40 -0700 (PDT) Received: from octofox.metropolis ([5.19.183.212]) by smtp.gmail.com with ESMTPSA id s75sm1364823lfs.21.2016.03.24.10.03.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Mar 2016 10:03:39 -0700 (PDT) From: Max Filippov To: buildroot@uclibc.org Date: Thu, 24 Mar 2016 20:03:22 +0300 Message-Id: <1458839002-32141-1-git-send-email-jcmvbkbc@gmail.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Cc: Thomas Petazzoni , software , "Yann E. MORIN" Subject: [Buildroot] [PATCH] gcc: fix libsanitizer build with _FILE_OFFSET_BITS=64 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" After the commit f67a4f50e2ace3a2 "gcc: preserve CXXFLAGS_FOR_TARGET" target CFLAGS are passed to all libraries bundled with gcc. This breaks libsanitizer on gcc-4.9.x when building with _FILE_OFFSET_BITS=64: error: size of array ‘assertion_failed__837’ is negative ... libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:837:1: note: in expansion of macro ‘CHECK_SIZE_AND_OFFSET’ CHECK_SIZE_AND_OFFSET(dirent, d_ino); This issue is fixed in the libsanitizer mainline and in gcc-5.x. There's no issue with gcc-4.8.x and earlier. Reported-by: Julien CORJON Signed-off-by: Max Filippov Backported from: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 --- ...tizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/gcc/4.9.3/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch diff --git a/package/gcc/4.9.3/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch b/package/gcc/4.9.3/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch new file mode 100644 index 0000000..55f3228 --- /dev/null +++ b/package/gcc/4.9.3/140-sanitizer-Fix-build-with-_FILE_OFFSET_BITS-64.patch @@ -0,0 +1,37 @@ +From 3c536954a67a883630f4a7513a27f02a892c3dcb Mon Sep 17 00:00:00 2001 +From: Evgeniy Stepanov +Date: Tue, 21 Oct 2014 21:08:13 +0000 +Subject: [PATCH] [sanitizer] Fix build with _FILE_OFFSET_BITS=64. + +Sanitizer source is not affected by _FILE_OFFSET_BITS in general, +but this one file must be built with 32-bit off_t. More details in the code. + +git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220328 91177308-0d34-0410-b5e6-96231b3b80d8 +Signed-off-by: Max Filippov +--- + lib/sanitizer_common/sanitizer_platform_limits_posix.cc | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +index bbc1108..fc09522 100644 +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -13,7 +13,15 @@ + + #include "sanitizer_platform.h" + #if SANITIZER_LINUX || SANITIZER_MAC ++// Tests in this file assume that off_t-dependent data structures match the ++// libc ABI. For example, struct dirent here is what readdir() function (as ++// exported from libc) returns, and not the user-facing "dirent", which ++// depends on _FILE_OFFSET_BITS setting. ++// To get this "true" dirent definition, we undefine _FILE_OFFSET_BITS below. ++#ifdef _FILE_OFFSET_BITS ++#undef _FILE_OFFSET_BITS ++#endif + + #include "sanitizer_internal_defs.h" + #include "sanitizer_platform_limits_posix.h" + +-- +2.1.4 +