From owner-freebsd-ppc@freebsd.org Sat May 28 16:44:19 2016 Return-Path: Delivered-To: freebsd-ppc@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA73B4E5DD for ; Sat, 28 May 2016 16:44:19 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-211-174.reflexion.net [208.70.211.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B30FF1AB7 for ; Sat, 28 May 2016 16:44:19 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 28077 invoked from network); 28 May 2016 16:44:50 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 28 May 2016 16:44:50 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.90.3) with SMTP; Sat, 28 May 2016 12:44:15 -0400 (EDT) Received: (qmail 18883 invoked from network); 28 May 2016 16:44:15 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with SMTP; 28 May 2016 16:44:15 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 9579EB1E001; Sat, 28 May 2016 09:44:14 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: 11.0-CURRENT -r300770 libc++ update vs. lang/powerpc64-xtoolchain-gcc: no go [self hosted powerpc64 context] From: Mark Millard In-Reply-To: Date: Sat, 28 May 2016 09:44:17 -0700 Cc: FreeBSD Toolchain , FreeBSD PowerPC ML , freebsd-ports@freebsd.org, Bryan Drewery Content-Transfer-Encoding: quoted-printable Message-Id: References: <95E2A9D6-8E1A-46FB-84FF-60927A6F1CE4@dsl-only.net> <8FAD594D-4349-4EA7-A712-D3792537FB1D@FreeBSD.org> <42773110-C392-4168-9B94-6902807DB530@dsl-only.net> <3BAE82F4-3BF4-4F02-9BFF-3F2290D3C82D@dsl-only.net> <0C88C11C-154A-459B-98EB-2A80A166DBCE@dsl-only.net> To: Dimitry Andric X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 May 2016 16:44:20 -0000 I'll update to 11.0 -r300904 to pick up the external toolchain fix for = -r300886's problem. > CROSS_TOOLCHAIN=3Dpowerpc64-gcc TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64= \ > __MAKE_CONF=3D/dev/null SRCCONF=3D/dev/null make buildworld The above likely would have problems with finding files in = /usr/local/include when devel/powerpc64-gcc is in use and various ports = have been built. If you use -v for the gcc based compiles the search = list will show /usr/local/include in the list the way that = devel/powerpc64-gcc is normally built. In my context there are some = files from ports there that would conflict with some system headers. Bryan Drewery is having me do experiments with building gcc with = --with-local-prefix assigned to avoid this. (I started these experiments = after my last report to you.) Before this I was using C_INCLUDE_PAPTH = and CPLUS_INCLUDE_PATH to have /usr/include and /usr/include/c++/v1 = searched before /usr/local/include based paths. Actually so far I'm only doing the experiment with devel/powerpc64-gcc = (used as the so-called "cross compiler" in my self-hosted context), not = with the lang/gcc49 that I use as the system compiler: for lang/gcc49 = I'm still using C_INCLUDE_PAPTH and CPLUS_INCLUDE_PATH to avoid = /usr/local/include based paths from finding files. In part this is = because I expect port building problems if I use lang/gcc49 to build = ports without lang/gcc49 having /usr/local/include implicitly. I do not = use devel/powerpc64-gcc to build ports. As stands I will next be trying building devel/powerpc64-gcc based on: --with-local-prefix=3D${LOCALBASE}/lib/gcc/${GCC_TARGET}/${PORTVERSION} which should make the search list entry (when it tacks on /include) a = redundant one with the one that follows what would otherwise be = /usr/local/include in the list. Using --with-local-prefix=3D/usr still = resulted in /usr/local/include being in the search list. No surprise = given that https://gcc.gnu.org/install/configure.html says: > Do not specify /usr as the --with-local-prefix! The directory you use = for --with-local-prefix must not contain any of the system's standard = header files. If it did contain them, certain programs would be = miscompiled (including GNU Emacs, on certain targets), because this = would override and nullify the header file corrections made by the = fixincludes script. It looks like they have code to detect the attempt to use /usr and = prevent it. =3D=3D=3D Mark Millard markmi at dsl-only.net On 2016-May-28, at 6:32 AM, Dimitry Andric wrote: > On 28 May 2016, at 06:18, Mark Millard wrote: > ... >> The -r300886 powerpc64 devel/powerpc64-gcc combination with no clang = build included has failed: >>=20 >> --- all_subdir_usr.bin --- >> endian.h(111): warning: bitwise operation on signed value possibly = nonportable [117] >> endian.h(127): warning: extra bits set to 0 in conversion of = 'unsigned int' to 'unsigned long long', op & [309] >> types.h(316): warning: bitwise operation on signed value possibly = nonportable [117] >> types.h(317): warning: bitwise operation on signed value possibly = nonportable [117] >> types.h(318): warning: bitwise operation on signed value possibly = nonportable [117] >> types.h(319): warning: bitwise operation on signed value possibly = nonportable [117] >> types.h(355): warning: conversion to 'unsigned int' due to prototype, = arg #1 [259] >> types.h(355): warning: conversion from 'unsigned long long' to = 'unsigned int' may lose accuracy, arg #1 [298] >> types.h(355): warning: conversion to 'unsigned int' due to prototype, = arg #1 [259] >> types.h(355): warning: conversion from 'unsigned long long' to = 'unsigned int' may lose accuracy, arg #1 [298] >> stdarg.h(40): syntax error [249] >> stdarg.h(98): syntax error [249] >> llib-lposix(307): syntax error [249] >> llib-lposix(308): syntax error [249] >> llib-lposix(309): syntax error [249] >> llib-lposix(309): cannot recover from previous errors [224] >> *** [llib-lposix.ln] Error code 1 >=20 > For me, r300886 didn't build at all, when I tried: >=20 > CROSS_TOOLCHAIN=3Dpowerpc64-gcc TARGET=3Dpowerpc TARGET_ARCH=3Dpowerpc64= \ > __MAKE_CONF=3D/dev/null SRCCONF=3D/dev/null make buildworld >=20 > It always errors out at the very first file built for the libraries > stage: >=20 > -------------------------------------------------------------- >>>> stage 4.2: building libraries > -------------------------------------------------------------- > cd /usr/src; CROSS_TOOLCHAIN=3D"powerpc64-gcc" = MAKEOBJDIRPREFIX=3D/usr/obj MACHINE_ARCH=3Di386 MACHINE=3Di386 = CPUTYPE=3D GROFF_BIN_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/bin = GROFF_FONT_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/groff_font = GROFF_TMAC_PATH=3D/usr/obj/usr/src/tmp/legacy/usr/share/tmac = CC=3D"/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc = --sysroot=3D/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/" = CXX=3D"/usr/local/bin/powerpc64-portbld-freebsd11.0-g++ = --sysroot=3D/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/" = CPP=3D"/usr/local/bin/powerpc64-portbld-freebsd11.0-cpp = --sysroot=3D/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/" = AS=3D"/usr/local/powerpc64-freebsd/bin/as" = AR=3D"/usr/local/powerpc64-freebsd/bin/ar" = LD=3D"/usr/local/powerpc64-freebsd/bin/ld" = NM=3D/usr/local/powerpc64-freebsd/bin/nm = OBJDUMP=3D/usr/local/powerpc64-freebsd/bin/objdump = OBJCOPY=3D"/usr/local/powerpc64-freebsd/bin/objcopy" = RANLIB=3D/usr/local/powerpc64-freebsd/bin/ranlib = STRINGS=3D/usr/local/powerpc64-freebsd/bin/ = SIZE=3D"/usr/local/powerpc64-freebsd/bin/size" INSTALL=3D"sh = /usr/src/tools/install.sh" = PATH=3D/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/us= r/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/o= bj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make -f = Makefile.inc1 DESTDIR=3D/usr/obj/usr/src/tmp -DNO_FSCHG MK_HTML=3Dno = -DNO_LINT MK_MAN=3Dno MK_PROFILE=3Dno MK_TESTS=3Dno = MK_TESTS_SUPPORT=3Dyes libraries > cd /usr/src; make -f Makefile.inc1 _prereq_libs; make -f = Makefile.inc1 _startup_libs; make -f Makefile.inc1 _prebuild_libs; = make -f Makefile.inc1 _generic_libs > =3D=3D=3D> gnu/lib/libssp/libssp_nonshared (obj,all,install) > building static ssp_nonshared library > /usr/local/powerpc64-freebsd/bin/ar -crD libssp_nonshared.a = `NM=3D'/usr/local/powerpc64-freebsd/bin/nm' NMFLAGS=3D'' lorder = ssp-local.o | tsort -q` > /usr/local/powerpc64-freebsd/bin/ranlib -D libssp_nonshared.a > sh /usr/src/tools/install.sh -C -o root -g wheel -m 444 = libssp_nonshared.a /usr/obj/usr/src/tmp/usr/lib/ > =3D=3D=3D> gnu/lib/libgcc (obj,all,install) > LC_ALL=3DC awk -f = /usr/src/gnu/lib/libgcc/../../../contrib/gcc/opt-functions.awk -f = /usr/src/gnu/lib/libgcc/../../../contrib/gcc/opth-gen.awk < optionlist = > options.h > /usr/local/bin/powerpc64-portbld-freebsd11.0-gcc = --sysroot=3D/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/ -c = -O2 -pipe -DIN_GCC -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED = -DHAVE_GTHR_DEFAULT = -I/usr/src/gnu/lib/libgcc/../../../contrib/gcclibs/include = -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc/config = -I/usr/src/gnu/lib/libgcc/../../../contrib/gcc -I. = -I/usr/src/gnu/lib/libgcc/../../usr.bin/cc/cc_tools -std=3Dgnu99 = -Wno-error=3Dunused-function -Wno-error=3Denum-compare = -Wno-error=3Dlogical-not-parentheses -Wno-error=3Dbool-compare = -Wno-error=3Duninitialized -Wno-error=3Darray-bounds = -Wno-error=3Dclobbered -Wno-error=3Dcast-align -Wno-error=3Dextra = -Wno-error=3Dattributes -Wno-error=3Dinline = -Wno-error=3Dunused-but-set-variable -Wno-error=3Dunused-value = -Wno-error=3Dstrict-aliasing -Wno-error=3Daddress = -fvisibility=3Dhidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3D3 = -DElfW=3D__ElfN -o unwind-dw2.o = /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c > In file included from = /usr/src/gnu/lib/libgcc/../../../contrib/gcc/tsystem.h:47:0, > from = /usr/src/gnu/lib/libgcc/../../../contrib/gcc/unwind-dw2.c:32: > = /usr/local/lib/gcc/powerpc64-portbld-freebsd11.0/5.3.0/include/stddef.h:56= :24: fatal error: sys/_types.h: No such file or directory > compilation terminated. > *** Error code 1 >=20 > This is because r300886 filters out the -isystem options that point to > ${WORLDTMP}/usr/include. When I build using r300885, it errors out > while building the atf-c++ libraries: >=20 > =3D=3D=3D> lib/atf/libatf-c++ (all) > /usr/local/bin/powerpc64-portbld-freebsd11.0-g++ -isystem = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1 -std=3Dc++11 = -nostdinc++ -L/usr/obj/powerpc.powerpc64/usr/src/tmp/../lib/libc++ = -isystem /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include = -L/usr/obj/powerpc.powerpc64/usr/src/tmp/usr/lib = --sysroot=3D/usr/obj/powerpc.powerpc64/usr/src/tmp = -B/usr/local/powerpc64-freebsd/bin/ -O2 -pipe -DHAVE_CONFIG_H = -I/usr/src/contrib/atf -I/usr/src/lib/atf/libatf-c++/../libatf-c -I. = -DHAVE_CONFIG_H -MD -MF.depend.application.o -MTapplication.o = -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k = -W -Wno-unused-parameter -Wpointer-arith -Wno-uninitialized = -Wno-error=3Dunused-function -Wno-error=3Denum-compare = -Wno-error=3Dlogical-not-parentheses -Wno-error=3Dbool-compare = -Wno-error=3Duninitialized -Wno-error=3Darray-bounds = -Wno-error=3Dclobbered -Wno-error=3Dcast-align -Wno-error=3Dextra = -Wno-error=3Dattributes -Wno-error=3Dinline = -Wno-error=3Dunused-but-set-variable -Wno-error=3Dunused-value = -Wno-error=3Dstrict-aliasing -Wno-error=3Daddress -c = /usr/src/contrib/atf/atf-c++/detail/application.cpp -o application.o > In file included from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/memory:616:0, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/algorithm:628, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/string:439, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/__locale:15, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/ios:216, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/ostream:138, > from = /usr/src/contrib/atf/atf-c++/detail/application.hpp:29, > from = /usr/src/contrib/atf/atf-c++/detail/application.cpp:26: > = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/atomic:571:0: = error: "_Atomic" redefined [-Werror] > #define _Atomic(x) __gcc_atomic::__gcc_atomic_t > ^ > In file included from /usr/src/sys/sys/endian.h:32:0, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/__config:96, > from = /usr/obj/powerpc.powerpc64/usr/src/tmp/usr/include/c++/v1/ostream:137, > from = /usr/src/contrib/atf/atf-c++/detail/application.hpp:29, > from = /usr/src/contrib/atf/atf-c++/detail/application.cpp:26: > /usr/src/sys/sys/cdefs.h:283:0: note: this is the location of the = previous definition > #define _Atomic(T) struct { T volatile __val; } > ^ >=20 > It appears that there is a conflict between how sys/cdefs.h defines > _Atomic() and how the libc++ headers define it. It looks like the > definition in the libc++ headers is more suitable for gcc, so maybe we > should disable our custom definition in sys/defs.h when an external = gcc > is used? Or at least, disable it when compiling for C++. >=20 > -Dimitry >=20