David Chisnall wrote (Mon Oct 12 08:21:28 UTC 2015):
> On 12 Oct 2015, at 03:17, Mark Millard <markmi at dsl-only.net> wrote:
> >
> > /usr/src/lib/libcxxrt/../../contrib/libcxxrt/guard.cc:104:15: error:
> > expected constructor, destructor, or type conversion before '(' token
> > _Static_assert(sizeof(guard_t) == sizeof(uint64_t), "");
>
> I think that this is the error that you get with old gcc when a static assert
> fails. What is the type of guard_t on PPC64? It may simply be that gcc
> isn’t providing the correct #defines to let the file know that it’s a 64-bit
> target.
>
> David
and I had replied about _Static_assert not being a C++ keyword and not being
created for C++ by FreeBSD’s current. But C++11's static_assert "may appear at
block scope (as a block declration) and inside a class body (as a member
declaration" (cppreference.com). It is not valid at file scope. And unless the
compile is explicitly or implicitly specified as a c++11 or later style of
compile static_assert is then not part of the C++ vintage in use.
/usr/local/bin/powerpc64-portbld-freebsd11.0-g++ -m32 -mcpu=powerpc
-DCOMPAT_32BIT -isystem /usr/obj/powerpc.powerpc64/usr/src/lib32/usr/include/
-L/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32
-B/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32
--sysroot=/usr/obj/powerpc.powerpc64/usr/src/tmp -O2 -pipe
-I/usr/src/lib/libcxxrt/../../contrib/libcxxrt -fstack-protector -c
/usr/src/lib/libcxxrt/../../contrib/libcxxrt/guard.cc -o guard.o
does not specify -std=c++11 or -std=gnu++11 or the like so static_assert is not
enabled as part of the language vintage used. So moving into block scope would
not be sufficient of itself.
So I tried simply removing the _Static_assert line that was in guard.cc:
Index: /usr/src/contrib/libcxxrt/guard.cc
===================================================================
--- /usr/src/contrib/libcxxrt/guard.cc (revision 288459)
+++ /usr/src/contrib/libcxxrt/guard.cc (working copy)
@@ -101,7 +101,6 @@
uint32_t init_half;
uint32_t lock_half;
} guard_t;
-_Static_assert(sizeof(guard_t) == sizeof(uint64_t), "");
static const uint32_t LOCKED = 1;
static const uint32_t INITIALISED = static_cast<guard_lock_t>(1) << 24;
This allowed the guard.cc compile in question to complete and more. (I’m not
claiming FreeBSD should skip having a check for a size mismatch someplace.)
But eventually the build eventually got:
--- lib/libcrypt__L ---
CC='/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc -m32 -mcpu=powerpc
-DCOMPAT_32BIT -isystem /usr/obj/powerpc.powerpc64/usr/src/lib32/usr/include/
-L/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32
-B/usr/obj/powerpc.powerpc64/usr/src/lib32/usr/lib32
--sysroot=/usr/obj/powerpc.powerpc64/usr/src/tmp ' mkdep -f .depend -a
-I/usr/src/lib/libcrypt/../libmd -I/usr/src/lib/libcrypt/../libutil
-I/usr/src/lib/libcrypt -DHAS_DES -DHAS_BLOWFISH -DMD4Init=__MD4Init
-DMD4Final=__MD4Final -DMD4Update=__MD4Update -DMD4Pad=__MD4Pad
-DMD5Init=__MD5Init -DMD5Final=__MD5Final -DMD5Update=__MD5Update
-DMD5Pad=__MD5Pad -DSHA256_Init=__SHA256_Init -DSHA256_Final=__SHA256_Final
-DSHA256_Update=__SHA256_Update -DSHA512_Init=__SHA512_Init
-DSHA512_Final=__SHA512_Final -DSHA512_Update=__SHA512_Update -std=gnu99
/usr/src/lib/libcrypt/crypt.c /usr/src/lib/libcrypt/misc.c
/usr/src/lib/libcrypt/crypt-md5.c /usr/src/lib/libcrypt/../libmd/md5c.c
/usr/src/lib/libcrypt/crypt-nthash.c /usr/src/lib/libcrypt/../libmd/md4c.c
/usr/src/lib/libcrypt/crypt-sha256.c
/usr/src/lib/libcrypt/../../sys/crypto/sha2/sha256c.c
/usr/src/lib/libcrypt/crypt-sha512.c /usr/src/lib/libcrypt/../libmd/sha512c.c
/usr/src/lib/libcrypt/../../secure/lib/libcrypt/crypt-des.c
/usr/src/lib/libcrypt/../../secure/lib/libcrypt/crypt-blowfish.c
/usr/src/lib/libcrypt/../../secure/lib/libcrypt/blowfish.c
. . .
--- lib/libcrypt__L ---
/usr/src/lib/libcrypt/crypt-sha256.c:38:20: fatal error: sha256.h: No such file
or directory
. . .
--- lib/libcrypt__L ---
mkdep: compile failed
*** [.depend] Error code 1
make[4]: stopped in /usr/src/lib/libcrypt
1 error
Note. . .
root@FreeBSDx64:/usr/src # find / -name sha256.h -print | more
/usr/obj/powerpc.powerpc64/usr/src/tmp/legacy/usr/include/sha256.h
/usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/sha256.h
/usr/obj/usr/src/tmp/legacy/usr/include/sha256.h
/usr/obj/usr/src/tmp/usr/include/sha256.h
/usr/include/sha256.h
/usr/src/contrib/wpa/src/crypto/sha256.h
/usr/src/sys/crypto/sha2/sha256.h
and the lack of a /usr/obj/powerpc.powerpc64/usr/src/lib32/usr/include/sha256.h
for the -isystem to find.
To be explicit about no amd64 to powerpc64 cross compling gcc being present for
the build to execute . . .
For an amd64 11.0 context doing
root@FreeBSDx64:/usr/src # yes|make -j 6 CROSS_TOOLCHAIN=powerpc64-gcc \
-DWITHOUT_GCC -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_GNUCXX \
-DWITHOUT_CLANG -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_CLANG_FULL
-DWITHOUT_CLANG_IS_CC \
-DWITHOUT_CLANG_EXTRAS -DWITHOUT_LLDB \
-DWITHOUT_BOOT -DWITHOUT_LIB32 \
delete-old KERNCONF=GENERIC64-NODBG \
TARGET=powerpc TARGET_ARCH=powerpc64
. . .
root@FreeBSDx64:/usr/src # make -j 6 CROSS_TOOLCHAIN=powerpc64-gcc \
-DWITHOUT_GCC -DWITHOUT_GCC_BOOTSTRAP -DWITHOUT_GNUCXX \
-DWITHOUT_CLANG -DWITHOUT_CLANG_BOOTSTRAP -DWITHOUT_CLANG_FULL
-DWITHOUT_CLANG_IS_CC \
-DWITHOUT_CLANG_EXTRAS -DWITHOUT_LLDB \
-DWITHOUT_BOOT -DWITH_LIB32 \
buildworld buildkernel KERNCONF=GENERIC64-NODBG \
TARGET=powerpc TARGET_ARCH=powerpc64
The context details follow.
Mac OS X 10.10.5 using a VirtualBox V5.0.4 VM with. . .
root@FreeBSDx64:/usr/src # freebsd-version -ku; uname -aKU
11.0-CURRENT
11.0-CURRENT
FreeBSD FreeBSDx64 11.0-CURRENT FreeBSD 11.0-CURRENT #0 r288459: Sat Oct 3
03:42:08 PDT 2015 root@FreeBSDx64:/usr/obj/usr/src/sys/GENERIC-NODEBUG
amd64 1100079 1100079
root@FreeBSDx64:/usr/src # svnlite info /usr/src
Path: .
Working Copy Root Path: /usr/src
URL: https://svn.freebsd.org/base/head
Relative URL: ^/head
Repository Root: https://svn.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 288459
Node Kind: directory
Schedule: normal
Last Changed Author: gjb
Last Changed Rev: 288459
Last Changed Date: 2015-10-01 12:48:10 -0700 (Thu, 01 Oct 2015)
root@FreeBSDx64:/usr/src # more /etc/src.conf
# World:
NO_WERROR=
# Kernel:
WERROR=
root@FreeBSDx64:/usr/src # more /etc/make.conf
/etc/make.conf: No such file or directory
root@FreeBSDx64:/usr/src # svnlite info /usr/ports
Path: /usr/ports
Working Copy Root Path: /usr/ports
URL: https://svn.freebsd.org/ports/head
Relative URL: ^/head
Repository Root: https://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 398559
Node Kind: directory
Schedule: normal
Last Changed Author: jbeich
Last Changed Rev: 398559
Last Changed Date: 2015-10-03 17:42:55 -0700 (Sat, 03 Oct 2015)
root@FreeBSDx64:/usr/src # portmaster --list-origins
net/avahi
devel/boost-all
lang/clang37
ports-mgmt/dialog4ports
lang/gcc5
devel/git-lite
x11/lumina
sysutils/lxterminal
www/midori
net/netatalk3
ports-mgmt/pkg
ports-mgmt/portmaster
devel/powerpc64-xtoolchain-gcc
devel/qtcreator
security/sudo
mail/thunderbird
emulators/virtualbox-ose-additions
Very little is non-default source code. . .
root@FreeBSDx64:/usr/src # svnlite status
M lib/csu/powerpc64/Makefile
? sys/arm/conf/RPI2-NODBG
M sys/boot/powerpc/Makefile.inc
? sys/powerpc/conf/GENERIC64-NODBG
root@FreeBSDx64:/usr/src # svnlite status /usr/ports
? /usr/ports/ion
root@FreeBSDx64:/usr/src # more /usr/src/sys/powerpc/conf/GENERIC64-NODBG
. . . (comments omitted) . . .
include GENERIC64
ident GENERIC-NODBG
nooptions INVARIANTS
nooptions INVARIANT_SUPPORT
nooptions WITNESS
nooptions WITNESS_SKIPSPIN
nooptions DEADLKRES
(The copy->paste sequence for the below diffs likely turned tabs into spaces.)
root@FreeBSDx64:/usr/src # svnlite diff sys/boot/powerpc/Makefile.inc
Index: sys/boot/powerpc/Makefile.inc
===================================================================
--- sys/boot/powerpc/Makefile.inc (revision 288459)
+++ sys/boot/powerpc/Makefile.inc (working copy)
@@ -2,7 +2,7 @@
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+= -m32 -mcpu=powerpc
-LDFLAGS+= -m elf32ppc_fbsd
+LDFLAGS+= -Wl,-m -Wl,elf32ppc_fbsd -Wl,-M,--verbose
.endif
.include "../Makefile.inc"
The following is my personal, local workaround for
/usr/src/lib/csu/powerpc64/Makefile forcing use of the gcc command even when
the context does not have one.
root@FreeBSDx64:/usr/src # svnlite diff /usr/src
Index: /usr/src/lib/csu/powerpc64/Makefile
===================================================================
--- /usr/src/lib/csu/powerpc64/Makefile (revision 288459)
+++ /usr/src/lib/csu/powerpc64/Makefile (working copy)
@@ -13,8 +13,8 @@
# clang doesn't support -mlongcall, and testing shows a clang linked with a
# clang-built csu segfaults, this must currently be compiled with gcc. Once
# clang supports -mlongcall, or we get a fixed ld, this can be revisited.
-CC:= gcc
-COMPILER_TYPE:= gcc
+#CC:= gcc
+#COMPILER_TYPE:= gcc
FILES= ${OBJS}
FILESMODE= ${LIBMODE}
===
Mark Millard
[email protected]
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "[email protected]"