From patchwork Mon Sep 2 16:06:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 271987 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 675622C007B for ; Tue, 3 Sep 2013 02:10:59 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 873D5909A6; Mon, 2 Sep 2013 16:10:58 +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 YNHP4r1KtJul; Mon, 2 Sep 2013 16:10:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 2940390CE2; Mon, 2 Sep 2013 16:10:57 +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 157331BF9A3 for ; Mon, 2 Sep 2013 16:10:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 1169490CE2 for ; Mon, 2 Sep 2013 16:10:56 +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 so8n3pFjZsIh for ; Mon, 2 Sep 2013 16:10:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (top.free-electrons.com [176.31.233.9]) by whitealder.osuosl.org (Postfix) with ESMTP id 140B3909A6 for ; Mon, 2 Sep 2013 16:10:55 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id D717E85F; Mon, 2 Sep 2013 18:07:53 +0200 (CEST) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3E863862 for ; Mon, 2 Sep 2013 18:07:16 +0200 (CEST) From: Thomas Petazzoni To: buildroot@uclibc.org Date: Mon, 2 Sep 2013 18:06:38 +0200 Message-Id: <1378138000-12739-13-git-send-email-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1378138000-12739-1-git-send-email-thomas.petazzoni@free-electrons.com> References: <1378138000-12739-1-git-send-email-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [PATCHv2 12/14] gcc: provide option to enable mudflap support X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net The mudflap library is only useful if one uses the -fmudflap gcc option, to do more checks on pointers/arrays. This commit adds an option to enable/disable mudflap support at the gcc level. By default, it is disabled, which saves a little bit of build time compared to the default of gcc which consists in enabling mudflap support. Since mudflap is now disabled by default, and ensured to be enabled on some platforms where it is not available, some gcc.mk code that was used to disable mudflap in problematic configurations can be removed. Whether -fmudflap is used when building is left to the user. Signed-off-by: Thomas Petazzoni --- package/gcc/Config.in.host | 15 +++++++++++++++ package/gcc/gcc-final/gcc-final.mk | 8 ++++++++ package/gcc/gcc.mk | 24 +++++++----------------- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host index 111da3b..d6c568d 100644 --- a/package/gcc/Config.in.host +++ b/package/gcc/Config.in.host @@ -155,3 +155,18 @@ config BR2_GCC_ENABLE_OPENMP depends on !BR2_PTHREADS_NONE && !BR2_avr32 && !BR2_arc help Enable OpenMP support for the compiler + +config BR2_GCC_ENABLE_LIBMUDFLAP + bool "Enable libmudflap support" + # There are architectures, or specific configurations for + # which mudflap is not supported. + depends on !BR2_avr32 && !BR2_bfin && !BR2_ARM_INSTRUCTIONS_THUMB &&!BR2_powerpc_SPE + help + libmudflap is a gcc library used for the mudflap pointer + debugging functionality. It is only needed if you intend to + use the -fmudflap gcc flag. + + See http://gcc.gnu.org/wiki/Mudflap_Pointer_Debugging and + the help of the gcc -fmudflap option for more details. + + If you're unsure, leave this option disabled. diff --git a/package/gcc/gcc-final/gcc-final.mk b/package/gcc/gcc-final/gcc-final.mk index 14ec06a..58c84ab 100644 --- a/package/gcc/gcc-final/gcc-final.mk +++ b/package/gcc/gcc-final/gcc-final.mk @@ -116,6 +116,14 @@ ifeq ($(BR2_INSTALL_OBJC),y) HOST_GCC_FINAL_USR_LIBS += libobjc endif +ifeq ($(BR2_GCC_ENABLE_LIBMUDFLAP),y) +ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),y) +HOST_GCC_FINAL_USR_LIBS += libmudflapth +else +HOST_GCC_FINAL_USR_LIBS += libmudflap +endif +endif + ifneq ($(HOST_GCC_FINAL_USR_LIBS),) define HOST_GCC_FINAL_INSTALL_USR_LIBS mkdir -p $(TARGET_DIR)/usr/lib diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index 20d6d14..58eae30 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -119,6 +119,12 @@ else HOST_GCC_COMMON_CONF_OPT += --disable-tls endif +ifeq ($(BR2_GCC_ENABLE_LIBMUDFLAP),y) +HOST_GCC_COMMON_CONF_OPT += --enable-libmudflap +else +HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap +endif + ifeq ($(BR2_PTHREADS_NONE),y) HOST_GCC_COMMON_CONF_OPT += \ --disable-threads \ @@ -192,25 +198,9 @@ HOST_GCC_COMMON_CONF_OPT += \ --with-bugurl="http://bugs.buildroot.net/" endif -# AVR32 GCC special configuration -ifeq ($(BR2_avr32),y) -HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap -endif - -# ARM Thumb and mudflap aren't friends -ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y) -HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap -endif - -# Blackfin doesn't do mudflap -ifeq ($(BR2_bfin),y) -HOST_GCC_COMMON_CONF_OPT += --disable-libmudflap -endif - -# Disable mudflap and enable proper double/long double for SPE ABI +# Enable proper double/long double for SPE ABI ifeq ($(BR2_powerpc_SPE),y) HOST_GCC_COMMON_CONF_OPT += \ - --disable-libmudflap \ --enable-e500_double \ --with-long-double-128 endif