From patchwork Fri Dec 15 23:25:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Stefan_Fr=C3=B6berg?= X-Patchwork-Id: 849420 X-Patchwork-Delegate: thomas.petazzoni@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yz66m5gryz9s84 for ; Sat, 16 Dec 2017 10:27:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id AF3D62EEFF; Fri, 15 Dec 2017 23:27:54 +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 klT0h0FlCNbt; Fri, 15 Dec 2017 23:27:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id AC1712E531; Fri, 15 Dec 2017 23:27:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 4F7F71C3EB5 for ; Fri, 15 Dec 2017 23:27:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 4AB6F86345 for ; Fri, 15 Dec 2017 23:27:51 +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 YeHp2sE9UgCP for ; Fri, 15 Dec 2017 23:27:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.petroprogram.com (mail.petroprogram.com [194.89.34.74]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0AE5187A60 for ; Fri, 15 Dec 2017 23:27:50 +0000 (UTC) Received: from localhost.localdomain (85-76-48-249-nat.elisa-mobile.fi [85.76.48.249]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: stefan.froberg@petroprogram.com) by mail.petroprogram.com (Postfix) with ESMTPSA id B7632442F5; Sat, 16 Dec 2017 02:31:18 +0200 (EET) From: =?utf-8?q?Stefan_Fr=C3=B6berg?= To: buildroot@buildroot.org Date: Sat, 16 Dec 2017 01:25:30 +0200 Message-Id: <20171215232530.9388-1-stefan.froberg@petroprogram.com> X-Mailer: git-send-email 2.13.6 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] gcc: Support configure option --with-linker-hash-style 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: thomas.petazzoni@free-electrons.com, =?utf-8?q?Stefan_Fr=C3=B6berg?= Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This will set the default hash style that GCC will always use during linking. Signed-off-by: Stefan Fröberg --- package/gcc/Config.in.host | 27 +++++++++++++++++++++++++++ package/gcc/gcc.mk | 12 ++++++++++++ 2 files changed, 39 insertions(+) diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host index 70cce0a5c5..b9391392e1 100644 --- a/package/gcc/Config.in.host +++ b/package/gcc/Config.in.host @@ -152,3 +152,30 @@ config BR2_GCC_ENABLE_GRAPHITE comment "graphite support needs gcc >= 5.x" depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5 + +choice + prompt "Hash style used during linking" + default BR2_GCC_HASH_STYLE_GNU + help + This tells GCC to pass --hash-style=choice option to the + linker for all final links where choice can be one of + "gnu", "sysv" or "both". + Using "gnu" should give best application startup time. + +config BR2_GCC_HASH_STYLE_GNU + bool "gnu" + help + For new style GNU ".gnu.hash" section. + +config BR2_GCC_HASH_STYLE_SYSV + bool "sysv" + help + For classic ELF ".hash" section. + +config BR2_GCC_HASH_STYLE_BOTH + bool "both" + help + For both the classic ELF ".hash" and + new style GNU ".gnu.hash". + +endchoice diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk index 27fc1e987c..51bb22d0e9 100644 --- a/package/gcc/gcc.mk +++ b/package/gcc/gcc.mk @@ -183,6 +183,18 @@ else HOST_GCC_COMMON_CONF_OPTS += --without-isl --without-cloog endif +ifeq ((BR2_GCC_HASH_STYLE_GNU),y) +HOST_GCC_COMMON_CONF_OPTS += --with-linker-hash-style=gnu +endif + +ifeq ((BR2_GCC_HASH_STYLE_SYSV),y) +HOST_GCC_COMMON_CONF_OPTS += --with-linker-hash-style=sysv +endif + +ifeq ((BR2_GCC_HASH_STYLE_BOTH),y) +HOST_GCC_COMMON_CONF_OPTS += --with-linker-hash-style=both +endif + ifeq ($(BR2_arc)$(BR2_or1k),y) HOST_GCC_COMMON_DEPENDENCIES += host-flex host-bison endif