[Bug 1327971] [NEW] libm log function: always unreferenced

Hong Xu hong at topbug.net
Mon Jun 9 07:35:46 UTC 2014


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
Foundations Bugs, which is subscribed to eglibc in Ubuntu.
https://bugs.launchpad.net/bugs/1327971

Title:
  libm log function: always unreferenced

Status in “eglibc” package in Ubuntu:
  New

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)

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



More information about the foundations-bugs mailing list