Bug#289274: marked as done (When linking statically, you need to order dependent pieces of code first)
Your message dated Sat, 8 Jan 2005 10:04:36 +0100
with message-id <16863.41508.875443.381699@gargle.gargle.HOWL>
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 arno@wagner.name Wed Dec 08 16:12:27 2004
Return-path: <arno@wagner.name>
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: <20041209001156.23426.qmail@kom-pc-aw.ethz.ch>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Arno Wagner <arno@wagner.name>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: libbz2-dev: libbz2 fails to link statically
X-Mailer: reportbug 3.2
Date: Thu, 09 Dec 2004 01:11:56 +0100
Delivered-To: submit@bugs.debian.org
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 doko@cs.tu-berlin.de Sat Jan 08 01:04:42 2005
Return-path: <doko@cs.tu-berlin.de>
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 (postfix@mail.cs.tu-berlin.de [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 doko@localhost)
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 <doko@cs.tu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <16863.41508.875443.381699@gargle.gargle.HOWL>
Date: Sat, 8 Jan 2005 10:04:36 +0100
To: 289274-done@bugs.debian.org (Debian Bug Tracking System)
Cc: Anibal Monsalve Salazar <A.Monsalve.Salazar@IEEE.org>
Subject: Re: Processed: gcc-doc: 289274: severity important, tags -fixed
In-Reply-To: <[🔎] handler.s.C.110517093214923.transcript@bugs.debian.org>
References: <20050108075526.GE16666@debianrules.debiancolombia.org>
<[🔎] handler.s.C.110517093214923.transcript@bugs.debian.org>
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: 289274-done@bugs.debian.org
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 to: