Received: by 10.223.164.221 with SMTP id h29csp244807wrb; Fri, 3 Nov 2017 13:43:09 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RZnMeB2cjIALdxNpc56f5xgG8C+EpmcC9QY/buKlaL9RByIN9a9onbufjWmq3fbpLew9kI X-Received: by 10.159.203.133 with SMTP id ay5mr7064647plb.361.1509741789716; Fri, 03 Nov 2017 13:43:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509741789; cv=none; d=google.com; s=arc-20160816; b=rDjQ3jGFhXH0GkQ6Amr1/RqL/P5Gdqg26m9gjk9aF8+cTLToHBEqECHx9FAW9jbRi/ lbLXUCZ2ZgWcfYFLppZhMHfH03Uq7rGyNGXyrUSP4+YlOQ3IvtRwvOCK2u17jXR3hECq 0SQ8N7zXNjXFaVqE/o20RAHcAQxIPNaFmkUNSKiMjEoC23LKm1RwK5IxQHtyMfHp6/u6 5uB/64orltqGnGUbl6KmOfO7ZX09kVcRAqSA0vLF7Ia7ysPC8qX6VxvPUWoJzq59jwIh 24e0K0+uhW4flO3ZcfiYGNf7QQ6Eu6UL0996ofvumypqoT722d4Ks6hc0Z0rmt5siHkV 5WXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=7YsEsq2Cpx6yNSZIcJ5ef5qm/BtpWQMEppNvt/3UYcE=; b=JzOYlTJ5+wwgN5yJgyYZmvmrTwK03e9zdS8BANuCCj7HdA3bZbzsp97f4BcFBsxMe5 rbYZHoY+FhZnXgZ5r3V4S21nfJtV08XeaGWPljse7qVI0lyae1fOj0Kf2/s0dZadKXl4 MYf9tk7tjR1rMpfD3zJl9sFu73O/YONqC66kctRpWGSTV3rRSHxtzBC27873HkeIb2v/ OAUQtOj9v7bkcX2W1P/42wQig4fJ++Khas263n5jrB/CKxvhfAJkosYuvwVyw4M6zqyn VcTnMkzvQAnWimHySIxMZ/FRJd50lSGpRIn8SbNUcp5I+S4Rh25IapYERKp/1eiYORkr dM2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=GorgZso9; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si7001443pfm.64.2017.11.03.13.42.56; Fri, 03 Nov 2017 13:43:09 -0700 (PDT) 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=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=GorgZso9; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752968AbdKCUmU (ORCPT + 92 others); Fri, 3 Nov 2017 16:42:20 -0400 Received: from mail-bl2nam02on0075.outbound.protection.outlook.com ([104.47.38.75]:45328 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751944AbdKCUmS (ORCPT ); Fri, 3 Nov 2017 16:42:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7YsEsq2Cpx6yNSZIcJ5ef5qm/BtpWQMEppNvt/3UYcE=; b=GorgZso9YYz0rlaH/sJTuRYgJrIsMERLIIIhQfXUVqDs8NkncjWqN4p9heVbz04TfGf0qCYqltbFsK9JCjnZZoMlHof55dWUN6E+1RvQA80nItLXQ/RJpmWZAlvNfX+fJoKvgQaRDNISpqWvAN7Rh6M3hjN6uhpZxqMuzVQLxxI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (50.233.148.156) by SN4PR0701MB3840.namprd07.prod.outlook.com (2603:10b6:803:4f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Fri, 3 Nov 2017 20:42:14 +0000 Date: Fri, 3 Nov 2017 23:41:57 +0300 From: Yury Norov To: Sami Tolvanen Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Greg Hackmann , Kees Cook , Matthias Kaehlcke , Nick Desaulniers Subject: Re: [PATCH 08/15] arm64: don't pass -maarch64linux to GNU gold Message-ID: <20171103204157.o3y7gapsvulb7kmt@yury-thinkpad> References: <20171103171203.107569-1-samitolvanen@google.com> <20171103171203.107569-10-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171103171203.107569-10-samitolvanen@google.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: VI1PR0801CA0077.eurprd08.prod.outlook.com (2603:10a6:800:7d::21) To SN4PR0701MB3840.namprd07.prod.outlook.com (2603:10b6:803:4f::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b4a85827-f5a4-40aa-88fa-08d522fb5e61 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:SN4PR0701MB3840; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3840;3:oPTXB32KzNF7GPtnYCyD9dENS4KOzsIYyI5sgxBVHiGjljSi1mQsDC6/1hFEJ/0Sx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wgYV5tYxSTaUBZIQhKn2F7jS8r6k3s/qQyt0xIs+GcM/aw0sFgO2a/XB1ZkmPiZ3PR0f3hfISYwDWE+j6aGLNneqOcvElgHvg0NEpbavTP8KGZ/hjX5r/WPiM1ClMrlhJZh3P+BFrOZ9aqmhi6xcsdY5hQp8zDLa210iWimzme8MdpMNpHFyn9JsTMdfSLKNnOt76FXjjLUycoTM5A29YbgoqxQROW2FPd91PUsmOXnY+N5iEGYmpwy3ckaorEiUI6MMRMtjJWrFTQxLFzJaXC7Xo5GOnM3u364WyqLYvqjkBQAqk3JXM52HPzmooc7x120CSU3HPLFLthraS2OSj4h8hm28Ifl/gj92P+jCHK6OsqvN8uHXWaqnJJQxBuiIrXc3CkI= X-Exchange-Antispam-Report-Test: UriScan:(211936372134217)(153496737603132); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(3231021)(920507027)(93006095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123564025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:SN4PR0701MB3840;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:SN4PR0701MB3840; X-Microsoft-Exchange-Diagnostics: 1;SN4PR0701MB3840;4:VfthuRPbMkLwBv7bCoHM9FJdjSkw0ZARNcZrgztwip169KGgm1CVEHl8yMuB/7GgqaF9LQ5X73PxlB0l3eYu5XvVKyR4vK0+TOKAo5eWQ0f4gEDtOc+vAOhD4xvJx3xkJ6Rljl7CfebGJWYkr+5pJpp/XmBpxTMwAqF5aWZY4x50ygtDkYX9m2fYB5jfnO8v890Ao/e2gzSJbN09/ihL/RM0sTPea/nKdCg3uu7JhZz6aMQe68Y+DtUWHr7Im6iDB9830Hd6u2X4jymHvePCZnTp7BnyriZ2ssTXZAyeBV8hJvLwoZFOCRi7fABEk4zu29b/8wqIvqP6NJr44l2z4DLlnsvnHw8+oMiVuUFnVqI= X-Forefront-PRVS: 0480A51D4A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(7916004)(346002)(376002)(24454002)(51444003)(189002)(199003)(3846002)(76506005)(54356999)(72206003)(45080400002)(106356001)(97736004)(478600001)(305945005)(105586002)(34040400001)(25786009)(6496005)(16526018)(9686003)(83506002)(5660300001)(53936002)(2906002)(101416001)(76176999)(1076002)(6116002)(50986999)(66066001)(6666003)(47776003)(4326008)(189998001)(81156014)(81166006)(229853002)(6486002)(8676002)(33716001)(6246003)(68736007)(316002)(8936002)(7736002)(16586007)(54906003)(50466002)(33646002)(2950100002)(42882006)(6916009)(23726003)(58126008);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0701MB3840;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;SN4PR0701MB3840;23:SxXMWVkaZy3nt52MZ3eSUC+++sia+9KACqC/Htl?= =?us-ascii?Q?z9jNmPXNYKO/+yEdUZw809X85m1b8Rf+ypstFI7wCOrkdAWGxIAe/F25F7TU?= =?us-ascii?Q?OIb7uQPcPyYplZbE2ffZwkFHk5ABc+/f2XLDcwfBjRGDboRAFqliy1PNUV8E?= =?us-ascii?Q?sLqmEd4mCy+aeGpOU4hh/hCe7dK9e7OqtiAYsYzD0UYJTV11+ve4VgWrttz5?= =?us-ascii?Q?FBQcGuW8QhUY5hDJMsFqnJibxMEfGr6YsDWZIt5n3c8cQ7YI+wEGlMjFt/QM?= =?us-ascii?Q?7kiZ9f7SF7IkOY01sorE08LTUf0Cy1ib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E7GqF43PGtcQwPuI1AtZvm0rIMWGIUxjuVXmxXCDkN+V79q3yIt7t5DL8EmVfY2S4bGRopp+Wz7R+uo7UNq5Pt7He7k9Oan4H414XoXnb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2017 20:42:14.7129 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4a85827-f5a4-40aa-88fa-08d522fb5e61 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3840 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sami, Very interesting reading, thank you. On Fri, Nov 03, 2017 at 10:11:53AM -0700, Sami Tolvanen wrote: > This change fixes the following error message when linking with GNU > gold: > > ld.gold: error: unrecognized emulation aarch64linux > > Signed-off-by: Sami Tolvanen > --- > arch/arm64/Makefile | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index eb6f3c9ec6cb..c16bd1ab37f8 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -64,14 +64,18 @@ KBUILD_CPPFLAGS += -mbig-endian > CHECKFLAGS += -D__AARCH64EB__ > AS += -EB > LD += -EB > +ifneq ($(ld-name),gold) > LDFLAGS += -maarch64linuxb > +endif > UTS_MACHINE := aarch64_be > else > KBUILD_CPPFLAGS += -mlittle-endian > CHECKFLAGS += -D__AARCH64EL__ > AS += -EL > LD += -EL > +ifneq ($(ld-name),gold) > LDFLAGS += -maarch64linux > +endif > UTS_MACHINE := aarch64 > endif -maarch64linux was added to LDFLAGS, and -mabi=lp64 was added to CFLAGS at the same patch to ensure that kernel will be compiled and linked in lp64 mode, even if toolchain by default compiles and links targets in ilp32 mode. So I think that simple removing this flag looks inaccurate. Also, IIUC, this patch is not related to LTO, because if ld.gold doesn't recognize -maarch64linux with LTO, it will not recognize it in non-LTO build. Am I right? I think that more correct way to do it would be either: - add maarch64linux to ld.gold, if possible. In discussion to other patches people talk that they need very fresh clang to build kernel properly, so this may be considered as similar issue; - if ld.gold understands some synonyms like -mabi=lp64, it should be passed to LDFLAGS here; - if ld.gold can link only lp64 objects, it should be commented here. But in this case I don't understand for example how to build vdso for ilp32 userspace... Thanks, Yury From 1583066076459230047@xxx Fri Nov 03 17:17:38 +0000 2017 X-GM-THRID: 1583066076459230047 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread