Public bug reported:

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)

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug trusty

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1327971

Title:
  libm log function: always unreferenced

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1327971/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to