From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by sourceware.org (Postfix) with ESMTPS id E7CFA3858D37 for ; Thu, 20 Apr 2023 21:20:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E7CFA3858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rtems.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-54fe2e39156so10083667b3.2 for ; Thu, 20 Apr 2023 14:20:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682025638; x=1684617638; h=to:subject:message-id:date:from:reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ozXDPGX1Kwo3UiEJIB6a2wE007lNygCrnwAhNheB5sI=; b=Yai06GbgrJRUN2PtB5urWWqbgMksx3p/vs3BC9DpieV1wBnPsDhIzGcPh01L1MOmkm CvZ+6587WRDK50XSNjvtqSMlPn1duGSf3ywcTK8D43xW6D9qYldcAdtsBZa3MjlwxmkF 7AV5Tdju9GjUtCFEaFu8oulBelPr0h72ZVz1DpOd+PPAdVXh6mBrms1D0zbqG7G49fQZ A1HoaNEbdsxEJFiPndF6x2U6M3bTTh2VqZt/b85KVo3CesbVUvFy2aoi3/3NZ3VJHyob /JBHtofAzR6EkwcxB85OiNt0IECpNzvhbeBMAU8BGg0ob+gDFZ8Ih81mBLXI7HK1TKyP iFTA== X-Gm-Message-State: AAQBX9d1R/xcfTxZIMV0cs6yUpSjachTAgw+UUa7uiaz2rY+xOZsRC7A aBz5B1pMWNf4+NGI9GBPiiSXfTY4Q34= X-Google-Smtp-Source: AKy350bdfLiOe3M5tnh/aGja0CKK/Kvp/QRO8YzzAk47XTsblR1vL2xczx4L841jnwfu3EMFnq3VRQ== X-Received: by 2002:a0d:f283:0:b0:54f:a613:cee2 with SMTP id b125-20020a0df283000000b0054fa613cee2mr160865ywf.31.1682025637937; Thu, 20 Apr 2023 14:20:37 -0700 (PDT) Received: from mail-yw1-f177.google.com (mail-yw1-f177.google.com. [209.85.128.177]) by smtp.gmail.com with ESMTPSA id z205-20020a0dd7d6000000b0054f856bdc4dsm569519ywd.38.2023.04.20.14.20.37 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Apr 2023 14:20:37 -0700 (PDT) Received: by mail-yw1-f177.google.com with SMTP id 00721157ae682-54fe0146b01so10071577b3.3 for ; Thu, 20 Apr 2023 14:20:37 -0700 (PDT) X-Received: by 2002:a25:c590:0:b0:b8f:5939:1649 with SMTP id v138-20020a25c590000000b00b8f59391649mr261792ybe.4.1682025637054; Thu, 20 Apr 2023 14:20:37 -0700 (PDT) MIME-Version: 1.0 Reply-To: joel@rtems.org From: Joel Sherrill Date: Thu, 20 Apr 2023 16:20:25 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Placement of signgam in libc instead of libm To: Newlib Content-Type: multipart/alternative; boundary="00000000000099927505f9cb1ce1" X-Spam-Status: No, score=-3031.5 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,KAM_DMARC_STATUS,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000099927505f9cb1ce1 Content-Type: text/plain; charset="UTF-8" Hi While double some checking that all references used by the long double math routines Jennifer are resolved when linking, we have found a small oddity. The file libc/reent/signgam.c is implemented as follows: int * __signgam (void) { return &_REENT_SIGNGAM(_REENT); } When TLS is enabled, the macro _REENT_SIGNGAM resolves to _tls_gamma_signgam which is in the file libm/math/w_lgamma.c. This creates the first reference from libc to libm that I have ever seen and requires explicitly linking with -lm -lc when using lgamma(). Would anyone be opposed to moving this method to libm/math? --joel --00000000000099927505f9cb1ce1--