[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH] build/xen: fix symbol generation with LLVM LD


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Wed, 6 Jul 2022 07:30:01 +0000
  • Accept-language: zh-CN, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+SsFrAz8LFJzc6j3+sB7yowLQVnl4nJlI4MGGzCSIzc=; b=Cae0eGyeHRmY5iq5dicLhiVzt/Qhr++3OZEPbcxBqrPD4VAgOYChxZVj/DwpZAreWqZWn8Je/AakQT0lRpXjcWA/okDemv3tuEdmYjjfarbXDpM2q6t5n32eHCEco5dYufptGy+PiNFDnnteAew0gYiAALoIlXcSYSVG3hChICDnmeJ8Kh+eseEav6WoWOBrc+pZelsyGNqneT6exIolxBYapZyZMQtKPbgir359RTAWNOeBTAz/UWXg9KlKHNTZ4tYUpSLhwH9O+p+goCxke/50K5w3bmr62rgDZg0iFEut4h6+wHklLuRbYc3pVKpOnqWeVz5keUodqg70E8RVGw==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=+SsFrAz8LFJzc6j3+sB7yowLQVnl4nJlI4MGGzCSIzc=; b=l9Sg4BZ36gNudDsr8ewXi/cqQkGmtqL+QhYblVbmHiYrgQ3zNd5CcA9oUKDMcJ/w14zfWZ44g+caP0CRlRRlu57VkPqQK53klanmt2MuOVuONWna/UfNrxl1c1/qleGMAmmsHWp/1XpM1gVqjCyuFQJ/T8AWyz1NjLJJAqdG+slHj/+9nZcx+015tLex+q9SgTbgrBH/QiofhnVW4djATzlAlNYrkm9xjBYLPYjMFHYNoY+Mt1NPeTx8R4avly39hzT+kEw2jyx5z0CmuKJm7jE3h9JNMfq3LC618XJukG8emddCWXvevz+Y2K8E/NDxsi9muILbqi2W95zvt4mA4w==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=MWK6jOM5tnTPAt6peMwFKOKeIVM6/3QDN8/82kUD1T0kkicxPho9ORX9NYimsOLcQYikPvWhGXHR7FpOYUHhy+hmjOu1HNJnnVpseuvGhqLcbKgnfb6Kd8p1PRMbLNx5evQEqpNsdNFg/13e8oNvmRwpwUIrlX7BkPsVNtNEbHEehFJQWULmwx1jQ7XbPCDhIOl7VVIGjm38EezM965AJ+RdQFGAO0Cx+IHka80GfYpJHXKItmosKWCd9F+Dn4xWanlgH73X98X9cC87MbMBSt7mkGUUSuGQNf+QINw35ZGeT9zEDgEGmfG1gaKt5x97XN/fowTVeEx3rOMimdR3Dg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PbTvLI1q4JRb4M1tcBBhRwBr6M6wJ0nZJ45utpjFqioelJao6QRKfRx90r4RAellCi1uU/PvdVZ1wA8KGxPDiF10G24cpHL/KeelYCABSlKslpUe5FvBCr577RxduTOOLV+2QkHIEU1uaZp2LyE/DkhrOGemB8FSIrXod9v4BKpVn4S7Img77MGAvSLd1iFLf2N0t8DqubuE4oaOr4/xAs2G99i3Lg2nwDe8hZTosh7RbRvbvq0y6Dhomxx/JXlapI/66HSqYDlGx06ARUj/01e1YbAKtQ3ENVkT+5j793JjZHHGB1/qwkkF9YqfOlrwjTEbXWKoSrFB1NOXS1FWjQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 06 Jul 2022 07:30:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYYIullYwWquPok065ghlly9/2gK1xPR9A
  • Thread-topic: [PATCH] build/xen: fix symbol generation with LLVM LD

Hi,

It seems that this patch has been stale for more than 2 months and from
the discussion in this thread I think some actions need to be taken from the
author. So I am sending this email as a gentle reminder.

Kind regards,
Henry

> -----Original Message-----
> Subject: [PATCH] build/xen: fix symbol generation with LLVM LD
> 
> Current LLVM LD implementation will turn global hidden symbols in
> object files into local ones when generating the .symtab of the Xen
> binary image.
> 
> This is different from GNU ld implementation, that will only do the
> conversion (or remove the symbols) when generation .dynsym but not
> .symtab.  Such conversion breaks the processing of symbols done by
> tools/symbols.
> 
> Use protected symbol visibility instead of hidden, as that preserves
> the symbol binding while not generating GOT or PLT indirections that
> are not compatible with some of the inline assembly constructs
> currently used.
> 
> While there also make the visibility setting compiler support
> non-optional: compilers not supporting it won't be able to build Xen
> anyway, and will just throw a compiler error sooner rather than later
> during the build.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
> ---
>  xen/Kconfig                | 4 ----
>  xen/include/xen/compiler.h | 9 +++++----
>  2 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/xen/Kconfig b/xen/Kconfig
> index 134e6e68ad..a9182fb13d 100644
> --- a/xen/Kconfig
> +++ b/xen/Kconfig
> @@ -29,10 +29,6 @@ config LD_IS_GNU
>  config LD_IS_LLVM
>       def_bool $(success,$(LD) --version | head -n 1 | grep -q "^LLD")
> 
> -# -fvisibility=hidden reduces -fpic cost, if it's available
> -config CC_HAS_VISIBILITY_ATTRIBUTE
> -     def_bool $(cc-option,-fvisibility=hidden)
> -
>  # Use -f{function,data}-sections compiler parameters
>  config CC_SPLIT_SECTIONS
>       bool
> diff --git a/xen/include/xen/compiler.h b/xen/include/xen/compiler.h
> index 933aec09a9..c144b17217 100644
> --- a/xen/include/xen/compiler.h
> +++ b/xen/include/xen/compiler.h
> @@ -125,10 +125,11 @@
>  #define __must_be_array(a) \
>    BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a),
> typeof(&a[0])))
> 
> -#ifdef CONFIG_CC_HAS_VISIBILITY_ATTRIBUTE
> -/* Results in more efficient PIC code (no indirections through GOT or PLT). 
> */
> -#pragma GCC visibility push(hidden)
> -#endif
> +/*
> + * Results in more efficient PIC code (no indirections through GOT or PLT)
> + * and is also required by some of the assembly constructs.
> + */
> +#pragma GCC visibility push(protected)
> 
>  /* Make the optimizer believe the variable can be manipulated arbitrarily. */
>  #define OPTIMIZER_HIDE_VAR(var) __asm__ ( "" : "+g" (var) )
> --
> 2.36.0
> 


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.