From patchwork Thu Feb 7 22:01:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 157785 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1201166jaa; Thu, 7 Feb 2019 14:02:57 -0800 (PST) X-Google-Smtp-Source: AHgI3IbUhRZ/tbYAWD94hIMiH/zOOsvuJxaRLTye7A/7oSSnMHfqHolUE+ky1grjiDNYL6ydyggC X-Received: by 2002:a63:2d46:: with SMTP id t67mr17339529pgt.140.1549576977326; Thu, 07 Feb 2019 14:02:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549576977; cv=none; d=google.com; s=arc-20160816; b=qnEgwU/cneWSiguir5YwCbjgTWtCGmFj+aUu4YhIj/FJzkRfL3Bfz2Oqy5wcKk/FH0 vs8pzOBZ0ojedL8yAuQMQmMRm8K5QCrwVcC39O3+UlKe5IbTZqWZv9pcWYvf3XCX1htN RfzWzkSsb70bux6hOQOCehscgczmZMEB5zeX6W5UzDsJdHqU1MmDLWiIIdxq3A116d8L D1QcTNKc/05dTbFdUfwhFc6bDjmtMz/aikjZE9YYKQZK1PLkPBqyf9QIcPDxsDOxJWjZ J7FjnstseAw+r4HqDIu6Dj4jhU7yUZoWjR6Xe168ALkm/g93d2A76Q2NRCS2zjljYHjI 9R+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=o+AJ8QXrg2DBnZGy5ZK6HlHEP2OPjBoRWVCrnuFEEho=; b=VkzJXo5fO37kCdkq1xWORu18ASBDFDqed0z8vw3ZTHT7C0FEv1iQ09UbyEubHHbwsW Z4jG3KUDyM6q9ZFUaX2OturarV56K4Xc3n0xGYLrq0/Iok0ckmf4RjJuU6hrWTL6SjNm a4S1WkuwVN/1m5Jk4aoHj4YrRKKz6+K54glhDj4OKE+hwYI5bq9KRAvq4G89U5sRvzDq 5wdKorWVFqjvr4zmc55HnBgBLaaljskuXUJFyOFi6tTOVC674OKCCpMtaNs1WJrwmECE yzJT6lHSO+VOfvh1bi15pX0+bB+2dnJF9EsXC4Ac2viK/BAzAnhA07lA61Lw4a6kpMXG ljtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hT0sOTj7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z67si153559pfb.268.2019.02.07.14.02.57; Thu, 07 Feb 2019 14:02:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=hT0sOTj7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727191AbfBGWCz (ORCPT + 31 others); Thu, 7 Feb 2019 17:02:55 -0500 Received: from mail-qk1-f201.google.com ([209.85.222.201]:43184 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727174AbfBGWCy (ORCPT ); Thu, 7 Feb 2019 17:02:54 -0500 Received: by mail-qk1-f201.google.com with SMTP id z126so1388603qka.10 for ; Thu, 07 Feb 2019 14:02:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=o+AJ8QXrg2DBnZGy5ZK6HlHEP2OPjBoRWVCrnuFEEho=; b=hT0sOTj7b3PLD8UwlhjluEWCgaUqFcwBupSFo+rIsarXYKEEWRH8u5FdyH7Xyl9LMI BzEnQsTHoKZJRQxb6hXGp7lQh0jmZm3p0FYgvxRFytFo6ty1cwfFm3I+I4L4j+PNQH3a gz33UvMVgKqYwpyW7oeYb8bcxcbe+sOBeFgWf5nnPwdONZq/izCL3HqA4tP4mhgnqGAq se5QlTXVg+Jfy5sonuqLJR4zqRK768Pt6ayAIESLzTLDpKkHDCxl1BGzCjwCOHsVcQfN RR8BQfIeBGdlTq30stNQ0Oi8PfTYdErpUaW/zDoFT+nFtJGLGkHwP73oPrd4SRZzqhLI dKWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=o+AJ8QXrg2DBnZGy5ZK6HlHEP2OPjBoRWVCrnuFEEho=; b=qstcMYN0NtGEHUTffHYmohaPqcgZntJPo8T755339nlkMsC5WrpXJJWy7Pba8xf7rp HKkyV+p1IN/vrNKqM2a5klX64Re17YeN8UIWK1tYlBCrlnabTAdN/hGiTtLoVPnuvgr2 W+gJsQbZsAt1JG40o2mHTQdqU6jtTm4laX9OgxR9p/2uFG6YBV6pBmu2kdZZb3fWwCUe 0Qd3izQSCH7+m0qZDoa7hDkWiPgjYu7/ZnOwudR+56zCwqz5gSmY+if++BfZfunu9CZp IUl0FvdYv7cd8CNsZJaLMY7pYNyouT+c6YMdmagouROq/xkh0q01FBIScgZhdsbYM20T 2iPw== X-Gm-Message-State: AHQUAuZfljyP4f15rkaFB7UP9Np6DWGxorw+Bw1z6FXKrHUIZISYxa05 5rNsZmeGR6WE8d5xPi8Nc4lSZHmSzzou2+N3iJw= X-Received: by 2002:a0c:b0b6:: with SMTP id o51mr10787701qvc.40.1549576972858; Thu, 07 Feb 2019 14:02:52 -0800 (PST) Date: Thu, 7 Feb 2019 14:01:52 -0800 In-Reply-To: <20190207220155.81351-1-ndesaulniers@google.com> Message-Id: <20190207220155.81351-4-ndesaulniers@google.com> Mime-Version: 1.0 References: <20190207220155.81351-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.20.1.791.gb4d0f1c61a-goog Subject: [PATCH 4/4] Makefile: lld: set -O2 linker flag when linking with LLD From: ndesaulniers@google.com To: yamada.masahiro@socionext.com Cc: Nick Desaulniers , Rui Ueyama , Nathan Chancellor , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -O2 enables tail merging of string table strings. For arm64: 0.34% size improvement with lld -O2 over lld for vmlinux. 3.30% size improvement with lld -O2 over lld for Image.lz4-dtb. Link: https://github.com/ClangBuiltLinux/linux/issues/343 Suggested-by: Rui Ueyama Suggested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) -- 2.20.1.791.gb4d0f1c61a-goog Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor diff --git a/Makefile b/Makefile index 6307c17259ea..c07208ec49d4 100644 --- a/Makefile +++ b/Makefile @@ -718,6 +718,10 @@ else KBUILD_CFLAGS += -Wno-unused-but-set-variable endif +ifdef CONFIG_LD_IS_LLD +KBUILD_LDFLAGS += -O2 +endif + KBUILD_CFLAGS += $(call cc-disable-warning, unused-const-variable) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls