[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
i386 ld + shared libs + weak == problems
OpenBSD-current has a problem with weak symbols and shared libraries.
Specifically, libraries such as slang that link against libc give trouble.
ld pulls libc as a subsidiary library to slang, and marks symbols as
secondary symbols. Then, when it encounters the real -lc on the command line,
it gets confused, remembers it marked those symbols as secondary, and discards
them.
This affects a large number of ports if you try to compile them on current.
You'll see messages telling you that such_and_such was not resolved
(use -lc ?), where you KNOW you used -lc.
The current work-around is to make sure you've got a -lc IN FRONT of other
libraries.
I'm slowly wading through old ld's code, trying to make sense of that jumble
and find what to change.
I'm not at all sure I'll find it.
If somebody would beat me to it, I would be grateful.
(If you want to reproduce the problem, it's quite easy: just build a small
dynamic library that links with -lc. Then try to use the library with code
that uses any system call such as open)
--
Marc Espie
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'