Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp280869ybg; Mon, 8 Jun 2020 23:52:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzB6t9g9dEYT16oj0yP7Gv60uRvcv6uB76pEDLvrt3ejsz0p/0aYYQPyk3QFLy/6a5qzzCh X-Received: by 2002:a17:906:76c4:: with SMTP id q4mr25588554ejn.371.1591685541671; Mon, 08 Jun 2020 23:52:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591685541; cv=none; d=google.com; s=arc-20160816; b=G3qveYsIGP4IiEaTOQB2ehPE1zkYEzcTfwatfCPsRI6OPQz9mz5rsgpTwauSKwSOsA lv7RHHREAZyYxohjwTbUxXXUolWEEkCXkBzk+sA7lnesFWzXZvCS5CGvP0Jb0YhqlGyU 14ct1hVbwf6wMOMS4/j6EJ8QfiO2BTQX9J9sZ8d+X6h9ZDZw2cVGhHqiBmiQYgt1/7Oz 8HRf5dtzVy3BtBLdve4PyMkqmFxTb/7pq0a9NItRLpdCMq1k4cdi/Ud1fpNt6sTryR7j ZDdx+YXtLN0Nd07G5l0yneunbNFe9LZ0y102Y/AnpvlbNU0py70YaUBFpvwVczgTbPB0 B4Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=RHHEgKs08w4gtyUuvEKRh0wDiEnPgGPvKLzkrDV04iM=; b=oPJYKt2tJLMp8HcH8pNgqMIbrz7sGNWTxEVdfriPyETnZ3K1yOnXB9a/j24okAAlDK Ub7iZwLo+lHJ7BveUAPwOdpsu++lzaznZerRfQaDXvkhJVRAeLlkMHYsUbCyjyLM0q2Z 2YLcmnR8OWVHDW9vUdMJPYiVupWH7j0dO2B26eLxh6bVVbeI4kteo6EeQYnE+y5XEmer cKWg/uL8EayucjsmxTJSF3u13D+3WOlqslVcKBDEtV0yzHhjTyF1r1v8l3nK/Ij1XTyv 8VIqiqvpMGfmplE/HMieKFINOZ4gp/cZhyikg+fBWTUdyqGx95B0j7uTtX/tM3YjB2dO 2XmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t9si9854977ejd.172.2020.06.08.23.51.58; Mon, 08 Jun 2020 23:52:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727911AbgFIGtW (ORCPT + 99 others); Tue, 9 Jun 2020 02:49:22 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:10726 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbgFIGtW (ORCPT ); Tue, 9 Jun 2020 02:49:22 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0596Vjqi191885; Tue, 9 Jun 2020 02:49:21 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 31gg81hspu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jun 2020 02:49:21 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0596Vtac192581; Tue, 9 Jun 2020 02:49:21 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 31gg81hsp7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jun 2020 02:49:20 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0596k9oR002782; Tue, 9 Jun 2020 06:49:18 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma04fra.de.ibm.com with ESMTP id 31g2s7t687-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Jun 2020 06:49:18 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0596nFrb57671682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Jun 2020 06:49:15 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B3AC42054; Tue, 9 Jun 2020 06:49:15 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD04B42041; Tue, 9 Jun 2020 06:49:14 +0000 (GMT) Received: from osiris (unknown [9.171.82.114]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Tue, 9 Jun 2020 06:49:14 +0000 (GMT) Date: Tue, 9 Jun 2020 08:49:13 +0200 From: Heiko Carstens To: Nick Desaulniers Cc: Nathan Chancellor , Vasily Gorbik , Christian Borntraeger , linux-s390 , LKML , clang-built-linux Subject: Re: [PATCH v2] s390: vdso: Use $(LD) instead of $(CC) to link vDSO Message-ID: <20200609064913.GA6796@osiris> References: <20200602192523.32758-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-09_01:2020-06-08,2020-06-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 phishscore=0 impostorscore=0 clxscore=1011 bulkscore=0 mlxlogscore=999 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006090046 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 02, 2020 at 12:52:26PM -0700, Nick Desaulniers wrote: > On Tue, Jun 2, 2020 at 12:25 PM Nathan Chancellor > wrote: > > > > Currently, the VDSO is being linked through $(CC). This does not match > > how the rest of the kernel links objects, which is through the $(LD) > > variable. > > > > When clang is built in a default configuration, it first attempts to use > > the target triple's default linker, which is just ld. However, the user > > can override this through the CLANG_DEFAULT_LINKER cmake define so that > > clang uses another linker by default, such as LLVM's own linker, ld.lld. > > This can be useful to get more optimized links across various different > > projects. > > > > However, this is problematic for the s390 vDSO because ld.lld does not > > have any s390 emulatiom support: > > > > https://github.com/llvm/llvm-project/blob/llvmorg-10.0.1-rc1/lld/ELF/Driver.cpp#L132-L150 > > > > Thus, if a user is using a toolchain with ld.lld as the default, they > > will see an error, even if they have specified ld.bfd through the LD > > make variable: > > > > $ make -j"$(nproc)" -s ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- LLVM=1 \ > > LD=s390x-linux-gnu-ld \ > > defconfig arch/s390/kernel/vdso64/ > > ld.lld: error: unknown emulation: elf64_s390 > > clang-11: error: linker command failed with exit code 1 (use -v to see invocation) > > > > Normally, '-fuse-ld=bfd' could be used to get around this; however, this > > can be fragile, depending on paths and variable naming. The cleaner > > solution for the kernel is to take advantage of the fact that $(LD) can > > be invoked directly, which bypasses the heuristics of $(CC) and respects > > the user's choice. Similar changes have been done for ARM, ARM64, and > > MIPS. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/1041 > > Signed-off-by: Nathan Chancellor > > Thanks, with this, I'm more confident that the linker flags don't change. > Reviewed-by: Nick Desaulniers ... > > -KBUILD_CFLAGS_64 += -nostdlib -Wl,-soname=linux-vdso64.so.1 \ > > - -Wl,--hash-style=both > > +ldflags-y := -fPIC -shared -nostdlib -soname=linux-vdso64.so.1 \ > > + --hash-style=both -T I added the --build-id flag according to commit 7a0a93c51799 ("arm64: vdso: Explicitly add build-id option") and applied the patch. Thanks!