Package: g++-3.4
Version: 3.4.6-6
Severity: important
g++-3.4 fails to link. g++-4.2 does not fail.
Copied test files from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16625#c27
The test files are:
$ cat foo.h
class Foo {
public:
virtual ~Foo() {}
virtual inline int f(int x) {
switch (x) {
case 0: return 0; break;
case 1: return 1; break;
case 2: return 2; break; // cases 0 to 2 bulk out the switch
statement
case 3: return 999; break; // cases 3 and 4 can be coalesced
case 4: return 999; break;
}
return -1;
}
};
extern int g(int);
extern int h();
$ cat lib1.cc
#include "foo.h"
int g(int i) {
Foo f;
return f.f(i);
}
$ cat lib2.cc
#include "foo.h"
int h() {
Foo f;
return f.f(0) + g(0);
}
$ cat main.cc
#include "foo.h"
int main() {
return g(0) + h();
}
Compiled them as follows.
g++-3.4 -Wall -W -O0 -c lib1.cc
g++-3.4 -Wall -W -O0 -c lib2.cc
g++-3.4 -Wall -W -o main lib1.o lib2.o main.cc
This is the error that I get:
`.gnu.linkonce.t._ZN3Foo1fEi' referenced in section `.rodata' of lib2.o:
defined in discarded section `.gnu.linkonce.t._ZN3Foo1fEi' of lib2.o
collect2: ld returned 1 exit status
-- System Information:
Debian Release: lenny/sid
APT prefers stable
APT policy: (990, 'stable'), (500, 'unstable'), (500, 'testing'), (1,
'experimental')
Architecture: amd64 (x86_64)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.22-3-amd64
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Versions of packages g++-3.4 depends on:
ii gcc-3.4 3.4.6-6 The GNU C compiler
ii gcc-3.4-base 3.4.6-6 The GNU Compiler Collection
(base
ii libc6 2.7-9 GNU C Library: Shared libraries
ii libstdc++6 4.3.0-1 The GNU Standard C++ Library v3
ii libstdc++6-dev 3.4.6-6 The GNU Standard C++
Library v3 (d
g++-3.4 recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]