libm log function: always unreferenced

Bug #1327971 reported by Hong Xu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

For this simple code:

#include <math.h>

int main(void)
{
    log(0.0);

    return 0;
}

when compiled with `gcc -lm foo.c`, you would always get the following error message:

/tmp/ccTTLEYA.o: In function `main':
foo.c:(.text+0x9): undefined reference to `log'
collect2: error: ld returned 1 exit status

which doesn't make sense.

I tried the same code to be compiled with `clang -lm foo.c`, which compiles successfully.

Also, I tried the same code on a RHEL 6 machine with gcc, which compiles successfully.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libc6-dev 2.19-0ubuntu6
ProcVersionSignature: Ubuntu 3.13.0-29.53-generic 3.13.11.2
Uname: Linux 3.13.0-29-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
CurrentDesktop: Unity
Date: Mon Jun 9 00:28:33 2014
InstallationDate: Installed on 2014-05-27 (12 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
SourcePackage: eglibc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Hong Xu (xuhdev) wrote :
Revision history for this message
Hong Xu (xuhdev) wrote :

Invalid. Ignore it.

Changed in eglibc (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.