Undefined reference to 'crypt' when compiling

Bug #1023973 reported by Kasper Dupont
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
make-dfsg (Ubuntu)
New
Undecided
Unassigned

Bug Description

When trying to compile a program on Ubuntu 12.04, which uses crypt() and linking with -lcrypt as specified in the CRYPT(3) man page, compilation fails with: Undefined reference to `crypt'

The program works flawless on many earlier Linux versions including multiple Fedora versions and Ubuntu 10.04.

Reporting this against libc6 because that's the package libcrypt belongs to in Ubuntu 10.04.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libc6 2.15-0ubuntu10
ProcVersionSignature: Ubuntu 3.2.0-24.39-generic 3.2.16
Uname: Linux 3.2.0-24-generic i686
NonfreeKernelModules: nvidia
ApportVersion: 2.0.1-0ubuntu8
Architecture: i386
Date: Thu Jul 12 18:06:23 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release i386 (20110427.1)
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: eglibc
UpgradeStatus: Upgraded to precise on 2012-05-08 (64 days ago)

Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in eglibc (Ubuntu):
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

invalid. please make sure that object files go before libraries on the command line.

Changed in eglibc (Ubuntu):
status: Confirmed → Invalid
Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :

The GNU make implicit rule for building an executable from a single c source file can only put the libraries before the source file. It worked in earlier Ubuntu versions, so it is a regression.

So it turns out libc wasn't the appropriate component to report the bug against. Should the bug be reassigned to gcc or make?

Revision history for this message
Kasper Dupont (ubuntu-launchpad-feb) wrote :

Reassigning to gcc

affects: eglibc (Ubuntu) → gcc-defaults (Ubuntu)
Changed in gcc-defaults (Ubuntu):
status: Invalid → New
Matthias Klose (doko)
affects: gcc-defaults (Ubuntu) → make (Ubuntu)
Logan Rosen (logan)
affects: make (Ubuntu) → make-dfsg (Ubuntu)
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.