File: README.openbsd

package info (click to toggle)
libcwd 1.0.2-1
  • links: PTS
  • area: non-free
  • in suites: lenny
  • size: 9,848 kB
  • ctags: 10,398
  • sloc: cpp: 23,215; sh: 8,819; ansic: 1,169; makefile: 848; exp: 234; awk: 11
file content (32 lines) | stat: -rw-r--r-- 1,525 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
16 Oct 2000
-----------

Only the static library is supported (libcwd.a).

OpenBSD has a few terrible linker bugs that makes the shared library
unusable.  Firstly, the normal way that libtool creates a shared library
results in a library that is not initialized (.init).  As a result,
global objects are not initialized (their constructor is never called).
This causes a core dump as soon as one of these objects are used.

I found out that using collect2 of GNU gcc works (although not when you
call it directly(?!) by using `g++ -shared' (instead of ld -Bshareable,
as libtool does): collect2 seems to find out which are the global
constructors (and destructors) and adds code to call them.

However, then a new linker bug surfaces: it seems not possible to overload
`operator delete' in a reliable way: calls to `delete' from libstdc++ do
not call the same function as calls to `delete' from for instance libcwd,
or the final application that it is linked with.  This is unacceptable
since the overloaded operator `new' and `delete' need to be called in pairs.

I was able to reproduce this buggy behaviour in a rather small test case,
using `g++ -shared -nostdlib' (not when using `g++ -shared').  In the case
of libcwd however it always failed, also when using `g++ -shared'.

I give up on openbsd for now, the linker is too buggy.  I have reported
the above problem to the libtool- as well as to the openbsd- developers and
received no reaction at all.  Gigni de nihilo nihil; in nihilum nil posse
reverti.

Carlo Wood