From patchwork Wed Jul 15 19:41:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Fredrickson X-Patchwork-Id: 1329772 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=uclibc-ng.org (client-ip=2a00:1828:2000:679::23; helo=helium.openadk.org; envelope-from=devel-bounces@uclibc-ng.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=dhE89Id0; dkim-atps=neutral Received: from helium.openadk.org (helium.openadk.org [IPv6:2a00:1828:2000:679::23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B6SSR6ngsz9sRk for ; Thu, 16 Jul 2020 05:41:41 +1000 (AEST) Received: from helium.openadk.org (localhost [IPv6:::1]) by helium.openadk.org (Postfix) with ESMTP id 7A59410159; Wed, 15 Jul 2020 21:41:35 +0200 (CEST) X-Original-To: devel@uclibc-ng.org Delivered-To: devel@helium.openadk.org Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by helium.openadk.org (Postfix) with ESMTPS id F08E510159 for ; Wed, 15 Jul 2020 21:41:29 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id a14so2537361pfi.2 for ; Wed, 15 Jul 2020 12:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=9PYEvomVFV4qooHx2u14qNojb2ZN4fEMOrXeqzbQY8I=; b=dhE89Id0O7SND90xK+bVi7isRCwo6xZfzIoBRbVeVVxgMKz71c5o/ss6K8d12jLdT+ +dWhd4QIZZcr9XDuySNNG8PSETASykfWmqlCTXOWcbGokqYDSiJ43ZHBYdq+qQGpzstR gBKcAHGLJBbv7DTlpPwDq+dw+HZmNC5DhFQZruUK7R6/Tiz3tlxqW1SODOJMxxwD/DD8 cwJMa8BfPzLOzo0O14CW0w4jUp0a7umathpkXii+6wbBPwVQYkD5RDCl8/UyHBehKE3Z 7BnpvEc2jn+BGfuW+zt8fH8QI76jgeSo3ROQ6M0pAnXORHjiIj26TTpcsW7sg4bz4G3k GIsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language; bh=9PYEvomVFV4qooHx2u14qNojb2ZN4fEMOrXeqzbQY8I=; b=mWQATr7Nzt6Zs/RWmBgAUglYjdyfYEK92VKPOfwWy8SVMTxWqEMS730bckF1IRM26/ F962ILPTDBmOEtoWxegLKF/GZDnT6caR8yKOJDpfBp9/YH4xD1J97La8PIz5bdVWTsq6 1Ysv9UAJKI8vKokAIaoBp4vBN8j/Ve9+x/0LcEyJrliKKKH3n6gjGDRr8IJh/Tmhnc4+ VT+sACXZMOxIgZVAJDrjdD7n/CiozEdVJ5vBBeVtdvhgJ60X6u8vE3ZvCOVzXRwLthoN bq96cXHWAdNxyZ89ScGf/HeYuhPzw8nO0OxiLWp+xd3kPWmBAeWp7+tlMEDwmtNW/B68 pGyA== X-Gm-Message-State: AOAM533qe9hvFo5BamllW6oaArUgD2Lhs+kXNGA1YlLgU98SYhueBwSw aavdhBfoXvOhcDw3/xr4MzpYscxPMtk= X-Google-Smtp-Source: ABdhPJx+ELopWHfIhtR6N8hif2oqcZGowp7InXylV+qQ5RIX9LbE1KldqfePb8gT8rNG/mzMQisEHA== X-Received: by 2002:a62:82ce:: with SMTP id w197mr717166pfd.322.1594842087383; Wed, 15 Jul 2020 12:41:27 -0700 (PDT) Received: from [10.0.0.250] (96-82-249-149-static.hfc.comcastbusiness.net. [96.82.249.149]) by smtp.gmail.com with ESMTPSA id a14sm2829366pfh.81.2020.07.15.12.41.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jul 2020 12:41:26 -0700 (PDT) To: devel@uclibc-ng.org From: Lance Fredrickson Message-ID: Date: Wed, 15 Jul 2020 13:41:26 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Language: en-US Subject: [uclibc-ng-devel] Fix static linking with GCC-10 X-BeenThere: devel@uclibc-ng.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: uClibc-ng Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devel-bounces@uclibc-ng.org Sender: "devel" Starting with GCC-10 multiple definitions of global variables by will be rejected. https://gcc.gnu.org/gcc-10/porting_to.html This fixes multiple definitions of _dl_pagesize and _dl_tls_static_size while attempting static linking. Of course this only occurs when compiling something that requires these symbols. First patch submission so hopefully all done correctly. thanks, Lance Fredrickson From e0686f7c03ce8e51ccffefeb6365e50311e6dd10 Mon Sep 17 00:00:00 2001 From: lancethepants Date: Wed, 15 Jul 2020 13:09:26 -0600 Subject: [PATCH] Starting with GCC-10 multiple definitions of global variables by will be rejected. This fixes multiple definitions of _dl_pagesize and _dl_tls_static_size while attempting static linking. --- libc/misc/elf/dl-support.c | 2 +- libpthread/nptl/sysdeps/generic/libc-tls.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libc/misc/elf/dl-support.c b/libc/misc/elf/dl-support.c index 87cd1bb72..eaf08f5bb 100644 --- a/libc/misc/elf/dl-support.c +++ b/libc/misc/elf/dl-support.c @@ -29,7 +29,7 @@ void (*_dl_init_static_tls) (struct link_map *) = &_dl_nothread_init_static_tls; ElfW(Phdr) *_dl_phdr; size_t _dl_phnum; -size_t _dl_pagesize; +extern size_t _dl_pagesize; void internal_function _dl_aux_init (ElfW(auxv_t) *av); void internal_function _dl_aux_init (ElfW(auxv_t) *av) diff --git a/libpthread/nptl/sysdeps/generic/libc-tls.c b/libpthread/nptl/sysdeps/generic/libc-tls.c index d746c9a38..a1d2ef913 100644 --- a/libpthread/nptl/sysdeps/generic/libc-tls.c +++ b/libpthread/nptl/sysdeps/generic/libc-tls.c @@ -72,7 +72,7 @@ struct dtv_slotinfo_list *_dl_tls_dtv_slotinfo_list; /* Number of modules in the static TLS block. */ size_t _dl_tls_static_nelem; /* Size of the static TLS block. */ -size_t _dl_tls_static_size; +extern size_t _dl_tls_static_size; /* Size actually allocated in the static TLS block. */ size_t _dl_tls_static_used; /* Alignment requirement of the static TLS block. */