[Bug 227659] [PATCH] src.opts.mk: fix to build WITH_GCC=yes when using an external compiler that supports c++11

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Apr 29 01:24:20 UTC 2018


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=227659

Mark Millard <marklmi26-fbsd at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marklmi26-fbsd at yahoo.com

--- Comment #2 from Mark Millard <marklmi26-fbsd at yahoo.com> ---
[In recent times my FreeBSD activity has been greatly limited
compared to before. My doing the powerpc64 and powerpc (32-bit)
clang/powerpc64-gcc experiments goes back to 10.x and has been
ongoing through 11 as head and now 12 as head. I've not tried
under an 11.x in some time.]

clang historically has had lots of powerpc64 and powerpc code
generation problems. See

https://bugs.llvm.org//show_bug.cgi?id=25780

and its depends-on list. (I'll ignore lld issues here.) There
has been progress in some areas, but not in others. Most of
the fixed items were fixed in 2017 or very late 2016 as
I remember. (FreeBSD picks up fixes from llvm generally.)

Even now, if you are trying to buildworld based on any llvm* 
then the built system libraries' support for handling C++
exceptions will be broken: For example, clang does not implement
__builtin_eh_return for powerpc64 or for powerpc and so there is
missing material in what it builds in the system libraries.

[llvm 26844 is a report of this. But the __builtin_eh_return
part of the discovery is far more recent than the original
submittal of lower level details about the bad exception code
generation for the ABI.]

I build for and run old powermacs via system-clang based on
as part of giving evidence of what is needed for FreeBSD to be
able to use clang as the system compiler. kyua can not be used
for this context because of its dependence on C++ exceptions,
for example.

[For powerpc (32-bit) clang6-being-involved can not build the
kernel currently. Some older vintages of system-clang could.
So currently I tend to build a gcc 4.2.1 based kernel and mix
it with a system-clang6 based world for 32-bit experiments.]

I also build via powerpc64-gcc and for it C++ exceptions support
built fine in the system. Where I've had problems is bad code
generation for support of lib32: crtbeginS.o ended up with code
that presumes R30 has content that it does not actually have in
the ABI and so ends up using it for a garbage-valued pointer
dereference.

[So unless I'm experimenting with the crtbeginS.o issue, I build
without lib32 support when I build via powerpc64-gcc.]

I use powerpc64-binutils for both clang-based and powerpc64
based buildworld and buildkernel targeting.

[Historically I've mostly done self-hosted builds but in recent
times I've done more amd64 -> powerpc64 (or powerpc) cross
builds. They take far less time for buildworld and buildkernel.]

My powerpc64 build/install experiments normally do not have
gcc 4.2.1 built, used, or installed at all. When I build
with powerpc64-gcc I also have the system-clang compiler
built and installed in the target powerpc64 environment.

[I have not completed building world and/or kernel using the
ports /head/base/{binutils,gcc} and testing the results. But
I've done enough to know that it has progressed since when I
first tried and submitted reports for what I found back then.]

In all cases that I could build and test, I did build various
ports, including pkg. But I'd need to do another update and
try again to know the current status for sure. The most recent
powerpc64 context that I've installed and used is:

# uname -apKU
FreeBSD FBSDG5L 12.0-CURRENT FreeBSD 12.0-CURRENT  r327364M  powerpc powerpc64
1200054 1200054

# dmesg -a | more
Copyright (c) 1992-2017 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 12.0-CURRENT  r327364M powerpc
gcc version 6.3.0 (FreeBSD Ports Collection for powerpc64) 
. . .

(So, apparently, I wanted C++ exception support in the system
to be working at the time: powerpc64-gcc based, not based on
some clang variant.)

# cc --version
FreeBSD clang version 5.0.1 (tags/RELEASE_501/final 320880) (based on LLVM
5.0.1)
Target: powerpc64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

# pkg info pkg
pkg-1.10.3_1
Name           : pkg
Version        : 1.10.3_1
Installed on   : Sun Dec 24 12:47:25 2017 PST
Origin         : ports-mgmt/pkg
Architecture   : FreeBSD:12:powerpc64
. . .

So system-clang5 built pkg back then (in a head context).

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list