Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Mar 2016 14:23:30 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD Current <freebsd-current@freebsd.org>, FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Cc:        Bryan Drewery <bdrewery@freebsd.org>
Subject:   svn commit: r297435 - head: still problems for stage 3 when gcc 4.2.1 is avoided (powerpc64 self-hosted build)
Message-ID:  <5A0ACA76-6F1D-4975-9E59-2A64BB8EFC77@dsl-only.net>

next in thread | raw e-mail | index | archive | help
Recent changes have been trying to make things like =
powerpc64-xtoolchain-gcc/powerpc64-gcc work better for =
buildworld/buildkernel.

I happen to do this on a powerpc64 context so the "cross build" is =
actually self-hosted. No gcc 4.2.1 is present and clang 3.8.0 and before =
have code generation problems for powerpc64 and powerpc so I avoid it =
for system builds, including for stage 3. (Also, clang for powerpc64 =
does not support building libstand: no soft-float support.)

As of my last test (-r297465) buildworld's stage 3 failed from implicit =
use of /usr/local/include materials unless I renamed various files =
there. In part this is because of my using gcc49 tools for CC and for =
CXX while using the powerpc64-gcc tools only for XCC and XCXX.

Is there a standard or recommended way to configure things to avoid such =
issues? Should powerpc64-gcc use be forced for CC and CXX as well as XCC =
and XCXX?

Should there be xtoolchain usage notes about avoiding /usr/local/include =
name conflicts and/or about how to assign CC/CXX/XCC/XCXX?

As long as I use gcc49 tools for CC and CXX I still must do things like =
renaming files in /usr/local/include to avoid them interfering with =
system headers:

> # find /usr/local/include/ -name 'renamed*' -print
> /usr/local/include/renamed_dwarf.h
> /usr/local/include/atf-c/renamed_defs.h
> /usr/local/include/renamed_iconv.h
> /usr/local/include/renamed_libdwarf.h
> /usr/local/include/renamed_histedit.h

I use the likes of:

> # diff -rq /usr/include /usr/local/include | grep "^Files "

to find what to rename for the duration of the system builds.

An example of what happens without the renames is below but I first note =
the use of the name dwarf_errmsg in /usr/include vs. in =
/usr/local/include (shown after the .h file rename but the build was =
with the normal file name):

> # find /usr/include/ -exec grep dwarf_errmsg {} \; -print
> #define	dwarf_errmsg(error)	dwarf_errmsg_(&error)
> const char	*dwarf_errmsg_(Dwarf_Error *);
> /usr/include/libdwarf.h
> # find /usr/local/include/ -exec grep dwarf_errmsg {} \; -print

> char* dwarf_errmsg(Dwarf_Error    /*error*/);
> /usr/local/include/renamed_libdwarf.h
> #

So dwarf_errmsg is from /usr/local/include and dwarf_errmsg_ is from =
/usr/include .

The failure shows references to dwarf_errmsg instead of dwarf_errmsg_ =
--and dwarf_errmsg being undefined (dwarf_errno has similar issues):

> --------------------------------------------------------------
> >>> stage 3: cross tools
> --------------------------------------------------------------
> . . .
> --- ctfconvert.full ---
> /usr/local/bin/gcc49 -O2 -pipe =
-I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/compat/opensolaris =
-I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/compat/opensolaris/includ=
e -I/usr/src/cddl/usr.b
> in/ctfconvert/../../../cddl/contrib/opensolaris =
-I/usr/src/cddl/usr.bin/ctfconvert/../../../sys/cddl/contrib/opensolaris =
-I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/head =
-I/us
> =
r/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/ctf/=
common =
-I/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools=
/ctf/cvt -I/usr/src/cddl/usr.bin/ctfconvert/.
> ./../../sys/cddl/contrib/opensolaris/uts/common -DNEED_SOLARIS_BOOLEAN =
-g -std=3Dgnu99 =
-I/usr/obj/xtoolchain/powerpc.powerpc64/usr/src/tmp/legacy/usr/include  =
-static -L/usr/obj/xtoolchain/powerpc.power
> pc64/usr/src/tmp/legacy/usr/lib -o ctfconvert.full alist.o ctf.o =
ctfconvert.o dwarf.o fixup_tdescs.o hash.o iidesc.o input.o list.o =
memory.o merge.o output.o st_parse.o stabs.o stack.o strtab.o symbol
> .o tdata.o traverse.o util.o   -ldwarf  -lelf  -lelf  -lz  -lpthread =
-legacy
> dwarf.o: In function `die_off':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:270: undefined reference to `dwarf_errmsg'
> dwarf.o: In function `die_sibling':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:288: undefined reference to `dwarf_errmsg'
> dwarf.o: In function `die_child':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:305: undefined reference to `dwarf_errmsg'
> dwarf.o: In function `die_tag':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:319: undefined reference to `dwarf_errmsg'
> dwarf.o: In function `die_unsigned':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:370: undefined reference to `dwarf_errmsg'
> =
dwarf.o:/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris=
/tools/ctf/cvt/dwarf.c:418: more undefined references to `dwarf_errmsg' =
follow
> dwarf.o: In function `dw_read':
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:1963: undefined reference to `dwarf_errno'
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:1971: undefined reference to `dwarf_errmsg'
> =
/usr/src/cddl/usr.bin/ctfconvert/../../../cddl/contrib/opensolaris/tools/c=
tf/cvt/dwarf.c:1977: undefined reference to `dwarf_errmsg'
> collect2: error: ld returned 1 exit status
> *** [ctfconvert.full] Error code 1



[Note: I have been able to remove some of my local workarounds as things =
have been cleaned up recently. This area is just not one of them. =
Getting powerpc64-gcc installed on a powerpc64 environment is one of =
those things needing work arounds. amd64 building powerpc64-gcc has no =
such issues (true cross compiler context: TARGET_ARCH=3Dpowerpc64 not =
matching the host OS).]



Context details:

> # svnlite info /usr/src/
> Path: /usr/src
> Working Copy Root Path: /usr/src
> URL: https://svn0.us-west.freebsd.org/base/head
> Relative URL: ^/head
> Repository Root: https://svn0.us-west.freebsd.org/base
> Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
> Revision: 297465
> Node Kind: directory
> Schedule: normal
> Last Changed Author: trasz
> Last Changed Rev: 297465
> Last Changed Date: 2016-03-31 10:32:28 -0700 (Thu, 31 Mar 2016)

> # freesd-version -ku; uname -aKU
> su: freesd-version: not found
> FreeBSD FBSDG5C0 11.0-CURRENT FreeBSD 11.0-CURRENT #24 r297048M: Sat =
Mar 19 06:12:57 PDT 2016     =
root@FBSDG5C0:/usr/obj/xtoolchain/powerpc.powerpc64/usr/src/sys/GENERIC64v=
tsc-NODEBUG  powerpc 1100103 1100103


> Script started on Thu Mar 31 11:11:06 2016
> Command: env __MAKE_CONF=3D/root/src.configs/make.conf =
SRC_ENV_CONF=3D/root/src.configs/src.conf.powerpc64-xtoolchain.powerpc64-h=
ost MAKEOBJDIRPREFIX=3D/usr/obj/xtoolchain/powerpc.powerpc64 make -j 5 =
buildworld buildkernel


The make.conf is empty.

The src.conf is:

> TO_TYPE=3Dpowerpc64
> TOOLS_TO_TYPE=3D${TO_TYPE}
> FROM_TYPE=3Dpowerpc64
> TOOLS_FROM_TYPE=3D${FROM_TYPE}
> VERSION_CONTEXT=3D11.0
> #
> KERNCONF=3DGENERIC64vtsc-NODEBUG
> TARGET=3Dpowerpc
> .if ${.MAKE.LEVEL} =3D=3D 0
> TARGET_ARCH=3D${TO_TYPE}
> .export TARGET_ARCH
> .endif
> #
> WITHOUT_CROSS_COMPILER=3D
> #
> WITH_FAST_DEPEND=3D
> WITH_LIBCPLUSPLUS=3D
> WITH_BOOT=3D
> WITH_CLANG=3D
> WITH_CLANG_IS_CC=3D
> WITH_CLANG_FULL=3D
> WITH_LLDB=3D
> #
> # LIB32 builds but does not work via gcc variants last I tried =
(crtbeginS code problem)
> WITHOUT_LIB32=3D
> WITHOUT_GCC=3D
> WITHOUT_GNUCXX=3D
> #
> NO_WERROR=3D
> MALLOC_PRODUCTION=3D
> #
> WITH_DEBUG_FILES=3D
> #
> # TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related =
bintutils...
> #
> CROSS_TOOLCHAIN=3D${TO_TYPE}-gcc
> X_COMPILER_TYPE=3Dgcc
> CROSS_BINUTILS_PREFIX=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/
> #CFLAGS+=3D-v
> .if ${.MAKE.LEVEL} =3D=3D 0
> =
XCC=3D/usr/local/bin/${TOOLS_TO_TYPE}-portbld-freebsd${VERSION_CONTEXT}-gc=
c
> =
XCXX=3D/usr/local/bin/${TOOLS_TO_TYPE}-portbld-freebsd${VERSION_CONTEXT}-g=
++
> =
XCPP=3D/usr/local/bin/${TOOLS_TO_TYPE}-portbld-freebsd${VERSION_CONTEXT}-c=
pp
> .export XCC
> .export XCXX
> .export XCPP
> XAS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/as
> XAR=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ar
> XLD=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ld
> XNM=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/nm
> XOBJCOPY=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objcopy
> XOBJDUMP=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/objdump
> XRANLIB=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/ranlib
> XSIZE=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/size
> #NO-SUCH: XSTRINGS=3D/usr/local/${TOOLS_TO_TYPE}-freebsd/bin/strings
> XSTRINGS=3D/usr/local/bin/${TOOLS_TO_TYPE}-freebsd-strings
> .export XAS
> .export XAR
> .export XLD
> .export XNM
> .export XOBJCOPY
> .export XOBJDUMP
> .export XRANLIB
> .export XSIZE
> .export XSTRINGS
> .endif
> #
> #
> # =46rom gcc49
> #
> .if ${.MAKE.LEVEL} =3D=3D 0
> CC=3D/usr/local/bin/gcc49
> CXX=3D/usr/local/bin/g++49
> CPP=3D/usr/local/bin/cpp49
> .export CC
> .export CXX
> .export CPP
> .endif
> #
> #
> # TOOLS_FROM_TYPE's appropriate binutils...
> #
> .if ${.MAKE.LEVEL} =3D=3D 0
> =
AS=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/bin/a=
s
> =
AR=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/bin/a=
r
> =
LD=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/bin/l=
d
> =
NM=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/bin/n=
m
> =
OBJCOPY=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/=
bin/objcopy
> =
OBJDUMP=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/=
bin/objdump
> =
RANLIB=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/b=
in/ranlib
> =
SIZE=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/bin=
/size
> #NO-SUCH: =
STRINGS=3D/usr/local/${TOOLS_FROM_TYPE}-portbld-freebsd${VERSION_CONTEXT}/=
bin/strings
> STRINGS=3D/usr/local/bin/strings
> .export AS
> .export AR
> .export LD
> .export NM
> .export OBJCOPY
> .export OBJDUMP
> .export RANLIB
> .export SIZE
> .export STRINGS
> .endif



=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5A0ACA76-6F1D-4975-9E59-2A64BB8EFC77>