11.0-CURRENT -r300770 libc++ update vs. lang/powerpc64-xtoolchain-gcc: no go [self hosted powerpc64 context]

Mark Millard markmi at dsl-only.net
Sat May 28 16:44:25 UTC 2016


I'll update to 11.0 -r300904 to pick up the external toolchain fix for -r300886's problem.



> CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 \
>    __MAKE_CONF=/dev/null SRCCONF=/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=${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=/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.

===
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:
>> 
>> --- 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
> 
> For me, r300886 didn't build at all, when I tried:
> 
> CROSS_TOOLCHAIN=powerpc64-gcc TARGET=powerpc TARGET_ARCH=powerpc64 \
>    __MAKE_CONF=/dev/null SRCCONF=/dev/null make buildworld
> 
> It always errors out at the very first file built for the libraries
> stage:
> 
> --------------------------------------------------------------
>>>> stage 4.2: building libraries
> --------------------------------------------------------------
> cd /usr/src;  CROSS_TOOLCHAIN="powerpc64-gcc" MAKEOBJDIRPREFIX=/usr/obj  MACHINE_ARCH=i386  MACHINE=i386  CPUTYPE= GROFF_BIN_PATH=/usr/obj/usr/src/tmp/legacy/usr/bin  GROFF_FONT_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/groff_font  GROFF_TMAC_PATH=/usr/obj/usr/src/tmp/legacy/usr/share/tmac CC="/usr/local/bin/powerpc64-portbld-freebsd11.0-gcc --sysroot=/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/" CXX="/usr/local/bin/powerpc64-portbld-freebsd11.0-g++  --sysroot=/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/"  CPP="/usr/local/bin/powerpc64-portbld-freebsd11.0-cpp --sysroot=/usr/obj/usr/src/tmp -B/usr/local/powerpc64-freebsd/bin/"  AS="/usr/local/powerpc64-freebsd/bin/as" AR="/usr/local/powerpc64-freebsd/bin/ar" LD="/usr/local/powerpc64-freebsd/bin/ld" NM=/usr/local/powerpc64-freebsd/bin/nm  OBJDUMP=/usr/local/powerpc64-freebsd/bin/objdump OBJCOPY="/usr/local/powerpc64-freebsd/bin/objcopy"  RANLIB=/usr/local/powerpc64-freebsd/bin/ranlib STRINGS=/usr/local/powerpc64-freebsd/bin/  SIZE="/usr/local/powerpc64-freebsd/bin/size"  INSTALL="sh /usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/bin:/usr/obj/usr/src/tmp/usr/sbin:/usr/obj/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin make  -f Makefile.inc1 DESTDIR=/usr/obj/usr/src/tmp -DNO_FSCHG MK_HTML=no -DNO_LINT MK_MAN=no  MK_PROFILE=no MK_TESTS=no MK_TESTS_SUPPORT=yes 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
> ===> gnu/lib/libssp/libssp_nonshared (obj,all,install)
> building static ssp_nonshared library
> /usr/local/powerpc64-freebsd/bin/ar -crD libssp_nonshared.a `NM='/usr/local/powerpc64-freebsd/bin/nm' NMFLAGS='' 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/
> ===> gnu/lib/libgcc (obj,all,install)
> LC_ALL=C 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=/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=gnu99 -Wno-error=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address     -fvisibility=hidden -DHIDE_EXPORTS -fPIC -fexceptions -D__GLIBC__=3 -DElfW=__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
> 
> 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:
> 
> ===> 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=c++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=/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=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address    -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; }
> ^
> 
> 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++.
> 
> -Dimitry
> 



More information about the freebsd-ports mailing list