Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 May 2016 09:44:17 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>, freebsd-ports@freebsd.org, Bryan Drewery <bdrewery@FreeBSD.org>
Subject:   Re: 11.0-CURRENT -r300770 libc++ update vs. lang/powerpc64-xtoolchain-gcc: no go [self hosted powerpc64 context]
Message-ID:  <AF7F57DA-4571-40B7-A2FF-A15D9203409A@dsl-only.net>
In-Reply-To: <B291643F-B423-48FE-9A45-B25F1495C879@FreeBSD.org>
References:  <95E2A9D6-8E1A-46FB-84FF-60927A6F1CE4@dsl-only.net> <8FAD594D-4349-4EA7-A712-D3792537FB1D@FreeBSD.org> <C5678741-F12B-4234-A194-AC2F0B0CDAB4@dsl-only.net> <42773110-C392-4168-9B94-6902807DB530@dsl-only.net> <3BAE82F4-3BF4-4F02-9BFF-3F2290D3C82D@dsl-only.net> <0C88C11C-154A-459B-98EB-2A80A166DBCE@dsl-only.net> <B291643F-B423-48FE-9A45-B25F1495C879@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <dim at FreeBSD.org> wrote:

> On 28 May 2016, at 06:18, Mark Millard <markmi at dsl-only.net> 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<x>
> ^
> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AF7F57DA-4571-40B7-A2FF-A15D9203409A>