Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Mar 2016 13:55:58 +0000
From:      David Chisnall <theraven@FreeBSD.org>
To:        Damjan Jovanovic <damjan.jov@gmail.com>
Cc:        mokhi <mokhi64@gmail.com>, emulation@freebsd.org, current@freebsd.org
Subject:   Re: FreeBSD MachO File format, your comments on it.
Message-ID:  <097363D7-DB74-4C48-90A7-BFACB1E0C0E1@FreeBSD.org>
In-Reply-To: <CAJm2B-kdnduoRHaskGkBpKOFyXL97eiqRsU0Ft0%2BQeQmSkR8=w@mail.gmail.com>
References:  <CAByVWPVv4bWb4D3ccSteraP51=J8%2BJkc=Rze9O%2B64ov5%2B9tG8Q@mail.gmail.com> <7554521E-81AB-43DE-A7FC-A9F334F660B7@FreeBSD.org> <CAJm2B-kdnduoRHaskGkBpKOFyXL97eiqRsU0Ft0%2BQeQmSkR8=w@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 24 Mar 2016, at 13:42, Damjan Jovanovic <damjan.jov@gmail.com> wrote:
>=20
> ELF itself is a disaster. Symbol lookup in ELF is process scoped, not
> library scoped like Windows's PE and Mac's Mach-O, so same named
> symbols from different libraries in the same process (loaded through
> any number of levels of indirection) can and do clash, resulting in
> memory corruption. This is why hacks like symbol versioning,
> RTLD_DEEPBIND on GNU's libc and -Bdirect on Solaris were invented.

This problem is addressed by some of the work that Sony has done =
recently that they are about to upstream to Clang/LLVM.

> We suffer from this problem badly on FreeBSD, as Clang's C++ standard
> library and GCC's standard library don't have fully compatible ABIs,
> so when both are loaded into the same process and the incompatible C++
> features are used -> memory corruption -> crash. Eg. compile Apache
> OpenOffice with GCC on a system built with Clang, and you'll see even
> the unit tests crash.

That shouldn=E2=80=99t happen, as libstd++ and libc++ have different =
symbols (libc++ puts its symbols in the __v1 namespace).  The problem =
can come from mixing libsupc++ and libcxxrt, but that=E2=80=99s only an =
issue if you have not built libstdc++ against libcxxrt.

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?097363D7-DB74-4C48-90A7-BFACB1E0C0E1>