The dpkg problem revisited
Hi,
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[2]: *** [dselect] Error 1
If you remove the "static" keywords in the functions' headers, it links
ok. Those functions are only used in this source file, so declaring them
as static should be ok. They are actually used in a table directly
following them:
static const struct cmdinfo cmdinfos[]= {
{ "admindir", 0, 1, 0, &admindir, 0 },
{ "debug", 'D', 1, 0, 0, setdebug },
{ "help", 'h', 0, 0, 0, helponly },
{ "version", 0, 0, 0, 0, versiononly },
{ "licence", 0, 0, 0, 0, showcopyright }, /* UK spelling */
{ "license", 0, 0, 0, 0, showcopyright }, /* US spelling */
{ 0, 0 }
};
Andreas - do you have an idea what the problem is? A (hopefully known)
bug in ld probably?
Frank
Reply to: