ftime doesn't fetch from libcompat.a using -lcompat
dmitry at atlantis.dp.ua
Thu Dec 18 01:54:43 PST 2003
I've found a very unusual bug. I've tried to build a legacy program which
uses ftime(), but I've got unresolved reference to `ftime'. I've created a
very simple program that demonstrates a bug:
struct timeb tb;
dmitry at test$ cc -lcompat a.c
/tmp/cck3ZpNz.o: In function `main':
/tmp/cck3ZpNz.o(.text+0xe): undefined reference to `ftime'
dmitry at test$ cc -lcompat -static a.c
/tmp/ccbGUAGZ.o: In function `main':
/tmp/ccbGUAGZ.o(.text+0xe): undefined reference to `ftime'
The most interesting thing here is that I can extract module ftime.o from
my /usr/lib/libcompat.a and link against it:
dmitry at test$ ar p /usr/lib/libcompat.a ftime.o >ftime.o
dmitry at test$ cc a.c ftime.o
dmitry at test$
It seems that symbol `ftime' gets somehow "undeclared" in library symbol
table. Could this error be fixed? It's present in 4.8-RELEASE and 4.9-RELEASE.
I haven't found anything in GNATS about this issue.
Atlantis ISP, System Administrator
e-mail: dmitry at atlantis.dp.ua
More information about the freebsd-stable