[Bug 1035996] Re: libcrypt and gcc ain't providing crypt() as advertised

Jason Conti 1035996 at bugs.launchpad.net
Mon Aug 13 17:26:17 UTC 2012


Thanks for the bug report. With the changes to the linker in 11.10, you
must specify the -llibrary arguments after the objects that reference
them. So in the above case:

gcc crypt.c -lcrypt

Please see http://wiki.debian.org/ToolChain/DSOLinking for an overview
of the changes.

** Changed in: manpages (Ubuntu)
       Status: New => Invalid

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

Title:
  libcrypt and gcc ain't providing crypt() as advertised

Status in “manpages” package in Ubuntu:
  Invalid

Bug description:
  So crypt(3) from the binary package manpages-dev tells me I should
  have crypt(), usable with -lcrypt.

  As I sometimes needs to compute such a crappy hash (I can't even
  remember when the last time was, or why, but that had to do with
  legacy code), I wrote this small utility:

  https://github.com/pcarrier/stuff/commit/f3de13682f28354397dc1b7caef5c1dd13fdfc36

  It compiles completely fine under Squeeze using "gcc -lcrypt crypt.c".

  For some reason I'm not so lucky with precise.

  % gcc -lcrypt crypt.c
  /tmp/cczm5dUv.o: In function `main':
  crypt.c:(.text+0x36): undefined reference to `crypt'
  crypt.c:(.text+0x5d): undefined reference to `crypt'
  collect2: ld returned 1 exit status
  zsh: exit 1     gcc -lcrypt crypt.c

  % readelf -Ws /lib/x86_64-linux-gnu/libcrypt-2.15.so|grep crypt@
      19: 0000000000004f40    12 FUNC    GLOBAL DEFAULT   13 encrypt@@GLIBC_2.2.5
      22: 0000000000000ca0   131 FUNC    GLOBAL DEFAULT   13 crypt@@GLIBC_2.2.5
      24: 0000000000000ca0   131 FUNC    WEAK   DEFAULT   13 fcrypt@@GLIBC_2.2.5

  % dpkg -l|grep -E 'gcc|libc6'
  ii  gcc                                    4:4.6.3-1ubuntu5                             GNU C compiler
  ii  gcc-4.6                                4.6.3-1ubuntu5                               GNU C compiler
  ii  gcc-4.6-base                           4.6.3-1ubuntu5                               GCC, the GNU Compiler Collection (base package)
  ii  gcc-4.6-base:i386                      4.6.3-1ubuntu5                               GCC, the GNU Compiler Collection (base package)
  ii  libc6                                  2.15-0ubuntu10                               Embedded GNU C Library: Shared libraries
  ii  libc6:i386                             2.15-0ubuntu10                               Embedded GNU C Library: Shared libraries
  ii  libc6-dev                              2.15-0ubuntu10                               Embedded GNU C Library: Development Libraries and Header Files
  ii  libc6-i386                             2.15-0ubuntu10                               Embedded GNU C Library: 32-bit shared libraries for AMD64
  ii  libgcc1                                1:4.6.3-1ubuntu5                             GCC support library
  ii  libgcc1:i386                           1:4.6.3-1ubuntu5                             GCC support library

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: manpages-dev 3.35-0.1ubuntu1
  ProcVersionSignature: Ubuntu 3.2.0-29.46-generic 3.2.24
  Uname: Linux 3.2.0-29-generic x86_64
  ApportVersion: 2.0.1-0ubuntu12
  Architecture: amd64
  Date: Mon Aug 13 01:26:30 2012
  Dependencies: manpages 3.35-0.1ubuntu1
  InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120731)
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=en_GB:en
   TERM=xterm
   PATH=(custom, user)
   LANG=en_GB.UTF-8
   SHELL=/bin/zsh
  SourcePackage: manpages
  UpgradeStatus: No upgrade log present (probably fresh install)

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




More information about the foundations-bugs mailing list