From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id 898A93844025 for ; Wed, 11 Aug 2021 21:34:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 898A93844025 Received: by mail-pl1-x632.google.com with SMTP id a5so4476780plh.5 for ; Wed, 11 Aug 2021 14:34:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7dgSvky1wtRyRZew9I5Ku9/j7Jddf8QZG2LWywJt0Kw=; b=jlSP32BRzG7lY0yBhNEbYbtbp6jX5cRrrf8YIr7gx0HjHBLLQ1mwQ8oAysL0wp99Z3 Erki3HQROiqhXkKrOu/n1ln2FsKYGgscp9titlwBFcenvxLP622MQqTkXfn4uX7n0wGG XzCT4ep19OYoc+MD1qvn9XGPgmrYRQiKN3xlDcZGM4xd+sSmB8RXWBrw7tnssuybEWdB qQInWJMiTezJ+kHB4GCeBTyynTEszV1YjWjTAcvlgEJp5RlbhGFUdAE02Yjg41xUShoJ +RiYikRZNcnmsAKLmkWKm9ri7jRQHkLnmEGTbXdEWwp+6o48WNPrRKdx6iQAY4PS2pqC vW2w== X-Gm-Message-State: AOAM531hgC1yV+544R1UXUkr2fXjwe3gkxKAotr/S81Ous1Sm1ERUwOe 0ixBEKvCq9P+LoFJTdOBXatafh5Nqfe3Sg== X-Google-Smtp-Source: ABdhPJzaXEyVS5+L4eyBP+I60415Osnq1ci0lcDkMND2m88GLtkjbzgP0LdeXvtqnHaU+d7tRhQDaQ== X-Received: by 2002:a65:63d7:: with SMTP id n23mr774699pgv.46.1628717681309; Wed, 11 Aug 2021 14:34:41 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:9c00:b9fc:4235:a544]) by smtp.gmail.com with ESMTPSA id n23sm466178pgv.76.2021.08.11.14.34.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 14:34:40 -0700 (PDT) Date: Wed, 11 Aug 2021 14:34:36 -0700 From: Fangrui Song To: Szabolcs Nagy Cc: libc-alpha@sourceware.org, Adhemerval Zanella , Szabolcs Nagy Subject: Re: [PATCH v2] aarch64: Skip traditional GD/LD TLS which are unsupported by Clang and LLD [BZ #28205] Message-ID: <20210811213436.hc33ru25aydbtdcf@google.com> References: <20210810210247.676100-1-maskray@google.com> <20210810211458.oxx3t5phzt3z3sp3@google.com> <20210811121740.GL20410@arm.com> <20210811155718.f3hvsh2y5ddaaebs@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20210811155718.f3hvsh2y5ddaaebs@google.com> X-Spam-Status: No, score=-16.6 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Aug 2021 21:34:53 -0000 On 2021-08-11, Fangrui Song wrote: >On 2021-08-11, Szabolcs Nagy wrote: >>The 08/10/2021 14:14, Fangrui Song via Libc-alpha wrote: >>>On 2021-08-10, Fangrui Song wrote: >>>> TLSDESC is the default on aarch64. Clang doesn't support >>>> -mtls-dialect=trad. Its integrated assembler doesn't support the >>>> marker. LLD's doesn't support R_AARCH64_TLSGD_*/R_AARCH64_TLSLD_* >>>> relocations. Just skip the tests. >>>> >>>> With https://sourceware.org/pipermail/libc-alpha/2021-August/129966.html >>>> ("aarch64: Make elf_machine_{load_address, dynamic} robust [BZ #28203]"), >>>> if we allow LLD in configure.ac, >>>> `make check` test results of LLD are on par with GNU ld. >>> >>>I messed up in the diff. >>>The correct diff needs `#include ` to make HAVE_TRAD_TLS >>>defined. >> >>the fixed patch looks good to me. >> >>but now i looked at elf/tls-macros.h and it seems >>to be for when there is on compiler support. >> >>i think the only thing the compiler does not >>support is mixing different tls access models to a >>variable in the same tu, but i'm not sure if that's >>useful or necessary for the tests: we can use many >>files with different -ftls-model= or >>__attribute__((tls_model(...))). >> >>is there a need for these hard to maintain macros? > >In GCC, mixing different tls access models to a variable in the same tu >can be emulated by: > > __thread int a __attribute__((tls_model("global-dynamic"))); > extern __thread int b __attribute__((alias("a"), tls_model("initial-exec"))); > >In Clang only one model is used. > > >Seems a good idea to switch them to variable attributes. alias() doesn't work. asm label works well. https://sourceware.org/pipermail/libc-alpha/2021-August/130083.html ("elf: Drop elf/tls-macros.h in favor of __thread and tls_model attributes [BZ #28152] [BZ #28205]") will modernize the tests.