Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Dec 2013 14:02:47 -0500
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        =?ISO-8859-1?Q?Bernhard_Fr=F6hlich?= <decke@FreeBSD.org>
Cc:        vbox@freebsd.org, Jason bacon <jwbacon@tds.net>
Subject:   Re: Problem with compat9x
Message-ID:  <52B1F157.7090009@FreeBSD.org>
In-Reply-To: <CAE-m3X1Qr0L2c3w_enrB=i5M7rPxxjUX342qKKdNsE8bP%2BoB0g@mail.gmail.com>
References:  <52AF4676.3020102@tds.net>	<CAE-m3X2RJQRr0BAPuvhCOsCXLyTYegO9REctWf8AP9yasUFnTw@mail.gmail.com>	<52AF8F8D.7070103@FreeBSD.org> <CAE-m3X1Qr0L2c3w_enrB=i5M7rPxxjUX342qKKdNsE8bP%2BoB0g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2013-12-17 05:56:01 -0500, Bernhard Fröhlich wrote:
> On Tue, Dec 17, 2013 at 12:41 AM, Jung-uk Kim <jkim@freebsd.org>
> wrote:
>> On 2013-12-16 14:57:55 -0500, Bernhard Fröhlich wrote:
>>> 
>>> Yes I am aware of that and if you look at the commit history
>>> you will see that I have tried to fix that issue with the last
>>> commit. It has fixed the issue for a couple of vbox binaries
>>> (VBoxSVC, VBoxManage) but some are still broken. (VBoxHeadless,
>>> VirtualBox)
>>> 
>>> The conflicts entry for compat9x was there already and I will
>>> need to add it again as it seems.
>> 
>> BTW, I have a real fix for the problem, i.e., build with Clang
>> (well, as much as possible).  In fact, only couple of files
>> (under src/recompiler) are absolutely needed to be compiled with
>> GCC in 4.3.x.  Therefore, there is no need for libstdc++.so
>> dependency at all.
>> 
>> Here are my experimental ports (based on official vbox@ ports,
>> i.e., https://redports.org/browser/virtualbox/emulators)
>> 
>> http://redports.org/browser/jkim/emulators
> 
> Probably I don't understand what you want to archive but I don't
> think patching virtualbox to compile 95% of it with clang and still
> having to compile the remaining 5% with gcc is of any benefit.

% find VirtualBox-4.3.4 -type f \( -name "*.c" -or -name "*.cpp" \) |
wc -l
    6187
% find VirtualBox-4.3.4/src/recompiler -type f \( -name "*.c" -or
- -name "*.cpp" \) | wc -l
      28

It's at least 99%. ;-)

Seriously, my point is we need to reduce libstdc++.so dependency from
ports tree at all cost because '-rpath' is really asking for serious
trouble in the long run (*unless* the binary is completely
self-contained, of course), IMHO.  I had very unpleasant experience
with LibreOffice and I learned it the hard way.  Whatever I do with
the port, people always complained that something is broken in a weird
way.  Almost every time, I found some *.so from its dependencies are
built with different C++ headers and runtime.  Imagine you have foo.so
built with g++48 and bar.so built with g++46 and an executable built
with libc++.so and requiring them both, directly or indirectly, for
example.  No fun at all. :-(

> We need to carry all the clang patches in our port which makes it a
> big beast and have likely no chance to get those workarounds
> included upstream because they won't accept patches for a compiler
> that can't fully build vbox.

Patches are not too big.  In fact, many patches are also beneficial to
GCC build because most of them fix compiler warnings with GCC, too.  I
don't see any problem of submitting those patches.

Actually, the recompiler (based on ancient QEMU) must be updated to
remove GCC dependency in the first place, i.e., the infamous global
register, IMHO.  FYI, recent QEMU can be built with Clang just fine.

> The issue that this thread talks about can be fixed in a much
> simpler way. In fact the VBoxHeadless and VirtualBox binaries do
> not have a RPATH at all - so all we need to do is fix the vbox
> buildsystem to add the RPATH to those binaries too like they
> already do for VBoxSVC and VBoxManage.

Obviously, I do not agree with the "simpler" fix. ;-)

Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (FreeBSD)

iQEcBAEBAgAGBQJSsfFXAAoJEHyflib82/FG3ocH/3r4jRTFDG8OQz9MeCt5ezlq
85Fq5cwTBvCSgAsqviqljbBmiwCnfQz0GcL/prA0A1O9AAWCOK74KwGCF3MkfIpW
FZxnpvqF7T2pBM7Z7wwhBTfzdJEnhtbRCu8TdM4SvmnGGKxsl+SS6sM8ioRjapAK
+SuuRBrOnNxGxCb1e50OGnZ4n1lA1AnP28E8SJrgkp8I1CIdS9sdoOS/weE4bPVR
7Mnkz0WioMYAQDPlLfILwXKaksl1UCI3Xn7IObHH+UVZu0jP3rbWbQ8Xe7f430s9
dQBR5F5d9uxxr2QCs7itXKgA8skViC40gUyerTAQTmGqlYUMF3cbflfeF1MCSZk=
=eplO
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52B1F157.7090009>