Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1927536

Summary: glibc: Static builds fail to link with "multiple definition of `__isnanl'" [rhel-7.9.z]
Product: Red Hat Enterprise Linux 7 Reporter: Ben Webb <benmwebb>
Component: glibcAssignee: Siddhesh Poyarekar <sipoyare>
Status: CLOSED ERRATA QA Contact: qe-baseos-tools-bugs
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.9CC: ashankar, codonell, dj, fweimer, jreznik, mnewsome, pfrankli, sipoyare, skolosov
Target Milestone: rcKeywords: Bugfix, Triaged, ZStream
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: glibc-2.17-324.el7_9 Doc Type: Bug Fix
Doc Text:
Cause: The fix for bug 1925204 resulted in a regression when building static programs that link against libm on i686 and x86_64. Consequence: Static builds using isnanl fail to link against libm with the error "multiple definition of `__isnanl'". Fix: The x86-specific code for function isnanl_pseudo was moved into its own file to avoid multiple definitions of the __isnanl during a static link. Result: Static builds linking against libm and using isnanl now succeed again.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-04-27 11:34:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Webb 2021-02-10 22:42:38 UTC
Description of problem:
Since updating to glibc-static-2.17-323.el7_9.x86_64, programs using isnan()
on long double values no longer link successfully with -static, erroring out
with "multiple definition of `__isnanl'".


Version-Release number of selected component (if applicable):
glibc-static-2.17-323.el7_9.x86_64


How reproducible:
Always


Steps to Reproduce:
1. cat test.c
#include <math.h>

int main() {
  long double x = 0.;
  return isnan(x);
}

2. gcc -Wall -static test.c -lm


Actual results:
gcc fails with

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libc.a(s_isnanl.o): In function `__isnanl':
(.text+0x0): multiple definition of `__isnanl'
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/libm.a(m_isnanl.o):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status


Expected results:
gcc compiles and links successfully.

Additional info:
The same test works correctly with glibc-static-2.17-322.el7_9.x86_64.
The changelog for -323 lists only one change, which likely is the cause:
"Fix isnanl check in printf. (#1925204)"

Comment 2 Siddhesh Poyarekar 2021-02-11 04:10:50 UTC
Thank you for reporting this.  isnanl gets packaged into both libc.a and libm.a and because glibc-2.17-323 created differences between the two versions, the static link started failing.

We're working on a fix for this.  Meanwhile an easy way to work around this would be to downgrade to glibc-2.17-317.

Alternatively, it may work in some cases to drop m_isnanl.o from libm.a and then linking against that modified archive.  Please note though that this is a temporary workaround and not a supported long term solution.

$ cp /lib64/libm.a $YOUR_BUILD_DIRECTORY/libm.a
$ ar d $BUILD_DIRECTORY/libm.a m_isnanl.o
$ gcc -Wall -static test.c $BUILD_DIRECTORY/libm.a

Comment 11 Sergey Kolosov 2021-03-30 18:40:19 UTC
Verified with the reproducer on glibc-2.17-324.el7_9

Comment 15 errata-xmlrpc 2021-04-27 11:34:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (glibc bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1392