Re: The dpkg problem revisited
Frank Neumann <Frank.Neumann@arbi.informatik.uni-oldenburg.de> writes:
|> this is a problem Juergen already pointed out some weeks ago, and I
|> noticed the same thing: dpkg requires one small patch to compile ok
|> on the m68k platform. Juergen asked Andreas if he could look into this,
|> but I think Andreas didn't see the explanation of the problem, so I'll
|> resend it:
|> In dpkg-1.1.0/dselect/main.cc there are 3 functions named helponly(),
|> versiononly() and setdebug(). In the original source they are declared as
|> "static void", but if you try to link these (gcc 2.7.2, binutils 2.6),
|> ld says:
|> gcc -o dselect main.o bindings.o curkeys.o helpmsgs.o basecmds
|> .o baselist.o basetop.o pkgcmds.o pkgdepcon.o pkgdisplay.o pkg
|> info.o pkgkeys.o pkglist.o pkgsublist.o pkgtop.o methkeys.o meth
|> od.o methparse.o methlist.o -L../lib -ldpkg -lncurses
|> main.o(.rodata+0x698): undefined reference to `setdebug(cmdinfo const *, char co
|> nst *)'
|> main.o(.rodata+0x6b6): undefined reference to `helponly(cmdinfo const *, char co
|> nst *)'
|> main.o(.rodata+0x6d4): undefined reference to `versiononly(cmdinfo const *, char
|> const *)'
|> make: *** [dselect] Error 1
That's a bug in the compiler, the g++ part. It doesn't notice that
the functions are referenced and doesn't compile them in. You can
work around it by decreasing the optimization level when compiling
main.cc (the default -O3 includes -finline-functions, which is the
culprit). I have already reported that bug to bug-g++, hopefully it
will be fixed in the next release.