Received: with rfc822 via encapsulated-mail; Sun, 10 Mar 1996 22:41:37 GMT From chiark.chu.cam.ac.uk!ian Sun Mar 10 14:40:38 1996 Return-Path: Received: from pixar.com by mongo.pixar.com with smtp (Smail3.1.28.1 #15) id m0tvtn4-0005ycC; Sun, 10 Mar 96 14:40 PST Received: from artemis.chu.cam.ac.uk by pixar.com with SMTP id AA27187 (5.67b/IDA-1.5 for debian-bugs-pipe@mongo.pixar.com); Sun, 10 Mar 1996 14:40:36 -0800 Received: from chiark.chu.cam.ac.uk by artemis.chu.cam.ac.uk with smtp (Smail3.1.29.1 #33) id m0tvtmt-0007uSC; Sun, 10 Mar 96 22:40 GMT Received: by chiark.chu.cam.ac.uk id m0tvtmH-0002YGC (Debian /\oo/\ Smail3.1.29.1 #29.35); Sun, 10 Mar 96 22:39 GMT Message-Id: Date: Sun, 10 Mar 96 22:39 GMT From: Ian Jackson To: Debian bugs submission address Subject: GCC -O3 produces unsatisfied external ref to static function Package: gcc Version: 2.7.2-5 This bug is the one that the people have been seeing who have been trying to compile dpkg using GCC 2.7.2 (ELF or M68K). The next version of dpkg will not compile dselect/main.cc (the problematic file) with -O3, instead using -O2 for most files, so this will no longer be a problem for dpkg. Ian. -chiark:~/junk> cat t.cc /**/ struct structure { void (*functionpointer)(void); }; static void function(void) { } static const struct structure table[]= { function }; int main(void) { table[0].functionpointer(); } -chiark:~/junk> g++ -O3 -v t.cc gcc -O3 -v t.cc -lg++ -lstdc++ -lm Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2/specs gcc version 2.7.2 /usr/lib/gcc-lib/i486-linux/2.7.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=7 -D__ELF__ -Dunix -Di386 -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386) -D__OPTIMIZE__ -D__i486__ t.cc /tmp/cca27459.ii GNU CPP version 2.7.2 (i386 Linux/ELF) #include "..." search starts here: #include <...> search starts here: /usr/lib/g++-include /usr/local/include /usr/i486-linux/include /usr/lib/gcc-lib/i486-linux/2.7.2/include /usr/include End of search list. /usr/lib/gcc-lib/i486-linux/2.7.2/cc1plus /tmp/cca27459.ii -quiet -dumpbase t.cc -O3 -version -o /tmp/cca27459.s GNU C++ version 2.7.2 (i386 Linux/ELF) compiled by GNU C version 2.7.2. as -V -Qy -o /tmp/cca274591.o /tmp/cca27459.s GNU assembler version 2.6 (i486-linux), using BFD version 2.6.0.2 ld -m elf_i386 -dynamic-linker /lib/ld-linux.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib/gcc-lib/i486-linux/2.7.2 /tmp/cca274591.o -lg++ -lstdc++ -lm -lgcc -lc -lgcc /usr/lib/crtend.o /usr/lib/crtn.o /tmp/cca274591.o(.rodata+0x0): undefined reference to `function(void)' -chiark:~/junk> dpkg -l gcc binutils Desired=Unknown/Install/Remove/Purge | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Rev Description +++-============-=========-====-=============================================== ii gcc 2.7.2 5 The GNU C compiler (ELF version). ii binutils 2.6 2 The GNU assembler and binary utilities (ELF ver -chiark:~/junk>