Your message dated Sat, 8 Jan 2005 10:04:36 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Processed: gcc-doc: 289274: severity important, tags -fixed
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 9 Dec 2004 00:12:27 +0000
>From [EMAIL PROTECTED] Wed Dec 08 16:12:27 2004
Return-path: <[EMAIL PROTECTED]>
Received: from pc-3531.ethz.ch (kom-pc-aw.ethz.ch) [129.132.66.20] 
        by spohr.debian.org with smtp (Exim 3.35 1 (Debian))
        id 1CcBv1-0001H0-00; Wed, 08 Dec 2004 16:12:27 -0800
Received: (qmail 23427 invoked by uid 9289); 9 Dec 2004 00:11:56 -0000
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Arno Wagner <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: libbz2-dev: libbz2 fails to link statically
X-Mailer: reportbug 3.2
Date: Thu, 09 Dec 2004 01:11:56 +0100
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level: 

Package: libbz2-dev
Version: 1.0.2-1
Severity: important


When trying to statically link with the bzip2 library the linker
does not find symbols. 

Example:

E ~/exp/c/bzip2>cat mini.c
#include <stdlib.h>
#include <bzlib.h>
// compile: gcc -static -lbz2 mini.c
int main() {
   BZFILE * bzin;
   int bzerror;
   bzin = BZ2_bzReadOpen( &bzerror, stdin, 0, 0, NULL, 0);
   printf("bzin = %p\n", bzin);
 }

E ~/exp/c/bzip2>gcc -static -lbz2 mini.c
/tmp/ccGrXMW2.o(.text+0x40): In function `main':
: undefined reference to `BZ2_bzReadOpen'
collect2: ld returned 1 exit status


gcc is version 3.3.4 (Debian 1:3.3.4-13)

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.9
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages libbz2-dev depends on:
ii  libbz2-1.0                  1.0.2-1      A high-quality block-sorting file 
ii  libc6-dev                   2.3.2.ds1-18 GNU C Library: Development Librari

-- no debconf information

---------------------------------------
Received: (at 289274-done) by bugs.debian.org; 8 Jan 2005 09:04:43 +0000
>From [EMAIL PROTECTED] Sat Jan 08 01:04:42 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1CnCWX-0002vF-00; Sat, 08 Jan 2005 01:04:42 -0800
Received: from mailhost.cs.tu-berlin.de ([EMAIL PROTECTED] [130.149.17.13])
        by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id KAA02905;
        Sat, 8 Jan 2005 10:04:39 +0100 (MET)
Received: from localhost (localhost [127.0.0.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id D856EF216;
        Sat,  8 Jan 2005 10:04:38 +0100 (MET)
Received: from mailhost.cs.tu-berlin.de ([127.0.0.1])
 by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP
 id 19623-07; Sat,  8 Jan 2005 10:04:37 +0100 (MET)
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP;
        Sat,  8 Jan 2005 10:04:37 +0100 (MET)
Received: (from [EMAIL PROTECTED])
        by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id j0894ahi007161;
        Sat, 8 Jan 2005 10:04:36 +0100 (MET)
From: Matthias Klose <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <[EMAIL PROTECTED]>
Date: Sat, 8 Jan 2005 10:04:36 +0100
To: [EMAIL PROTECTED] (Debian Bug Tracking System)
Cc: Anibal Monsalve Salazar <[EMAIL PROTECTED]>
Subject: Re: Processed: gcc-doc: 289274: severity important, tags -fixed
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
        <[EMAIL PROTECTED]>
X-Mailer: VM 7.03 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.0 required=4.0 tests=BAYES_01 autolearn=no 
        version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Debian Bug Tracking System writes:
> > tags 289274 -fixed
> Bug#289274: When linking statically, you need to order dependent pieces of 
> code first
> Tags were: fixed
> Tags removed: fixed

it is documented:

       -llibrary
       -l library

           Search the library named library when linking.  (The second
           alternative with the library as a separate argument is only
           for POSIX compliance and is not recommended.)

           It makes a difference where in the command you write this
           option; the linker searches and processes libraries and
           object files in the order they are specified.  Thus, foo.o
           -lz bar.o searches library z after file foo.o but before
           bar.o.  If bar.o refers to functions in z, those functions
           may not be loaded.


Reply via email to