[Bug 874418] [NEW] linking against librt doesn't provide sem_post

Gary Duzan 874418 at bugs.launchpad.net
Fri Oct 14 16:37:44 UTC 2011


Public bug reported:

We have software that uses semaphores but not pthreads. Therefore, our
code links against librt, as documented in the sem_post man page. This
worked fine in 10.04 and 11.04, but not in 11.10.

> cat a.c
#include <semaphore.h>
int main()
{
    sem_t *mysem;

    int ret;

    ret = sem_post(mysem);
    return 0;
}
> gcc -g -lrt -o a a.c
/tmp/ccUadHKv.o: In function `main':
a.c:8: undefined reference to `sem_post'
collect2: ld returned 1 exit status

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: libc6-dev 2.13-20ubuntu5
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu3
Architecture: amd64
Date: Fri Oct 14 12:30:58 2011
SourcePackage: eglibc
UpgradeStatus: Upgraded to oneiric on 2011-10-07 (6 days ago)

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


** Tags: amd64 apport-bug oneiric

-- 
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/874418

Title:
  linking against librt doesn't provide sem_post

Status in “eglibc” package in Ubuntu:
  New

Bug description:
  We have software that uses semaphores but not pthreads. Therefore, our
  code links against librt, as documented in the sem_post man page. This
  worked fine in 10.04 and 11.04, but not in 11.10.

  > cat a.c
  #include <semaphore.h>
  int main()
  {
      sem_t *mysem;

      int ret;

      ret = sem_post(mysem);
      return 0;
  }
  > gcc -g -lrt -o a a.c
  /tmp/ccUadHKv.o: In function `main':
  a.c:8: undefined reference to `sem_post'
  collect2: ld returned 1 exit status

  ProblemType: Bug
  DistroRelease: Ubuntu 11.10
  Package: libc6-dev 2.13-20ubuntu5
  ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
  Uname: Linux 3.0.0-12-generic x86_64
  NonfreeKernelModules: nvidia
  ApportVersion: 1.23-0ubuntu3
  Architecture: amd64
  Date: Fri Oct 14 12:30:58 2011
  SourcePackage: eglibc
  UpgradeStatus: Upgraded to oneiric on 2011-10-07 (6 days ago)

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




More information about the foundations-bugs mailing list