Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jun 2018 06:37:31 -0700
From:      Mark Millard <marklmi@yahoo.com>
To:        freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   system clang based head -r334932 amd64 -> powerpc64 cross build: fatal error: 'altivec.h' file not found in stage 4.2 "building libraries"
Message-ID:  <2DEAB250-1D93-4009-82F4-BB55CD4E406D@yahoo.com>

next in thread | raw e-mail | index | archive | help
[Note: I sometimes build for powerpc families via clang
as part of identifying what is not yet working. Currently
I do not have access to any powerpc system so I only build.
This involves using devel/powerpc-binutils currently.]

Despite for head -r334932:

# find /usr/src/* -name altivec.h -print=20
/usr/src/contrib/llvm/tools/clang/lib/Headers/altivec.h
/usr/src/contrib/gcc/config/rs6000/altivec.h
/usr/src/sys/powerpc/include/altivec.h

and:

# find /usr/obj/powerpc64vtsc_clang_altbinutils -name altivec.h -print
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/tmp/usr/include/machine/altivec.h
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/tmp/usr/lib/clang/6.0.0/include/altivec.h
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/obj-lib32/tmp/usr/include/machine/altivec.h

and:

# find /usr/local -name altivec.h -print
/usr/local/lib/gcc/powerpc64-unknown-freebsd12.0/6.4.0/include/altivec.h
/usr/local/llvm50/lib/clang/5.0.0/include/altivec.h
/usr/local/llvm60/lib/clang/6.0.0/include/altivec.h

and use of clang/clang++:

# c++ --version
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on =
LLVM 6.0.0)
Target: x86_64-unknown-freebsd12.0
Thread model: posix
InstalledDir: /usr/bin

my attempt to amd64 -> powerpc64 cross build (-j4) got:

. . .
Building =
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/lib/clang/libclang/Lex/Lexer.o
Building =
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/lib/clang/libclang/Lex/LiteralSupport.o
--- Lex/Lexer.o ---
/usr/src/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp:2401:10: fatal =
error: 'altivec.h' file not found
#include <altivec.h>
         ^~~~~~~~~~~
1 error generated.
*** [Lex/Lexer.o] Error code 1

make[6]: stopped in /usr/src/lib/clang/libclang
.ERROR_TARGET=3D'Lex/Lexer.o'
=
.ERROR_META_FILE=3D'/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.power=
pc64/usr/src/powerpc.powerpc64/lib/clang/libclang/Lex_Lexer.o.meta'
.MAKE.LEVEL=3D'6'
MAKEFILE=3D''
.MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes =
verbose'
_ERROR_CMD=3D'c++  -target powerpc64-unknown-freebsd12.0 =
--sysroot=3D/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr=
/src/powerpc.powerpc64/tmp =
-B/usr/local/powerpc64-unknown-freebsd12.0/bin/  -O2 -pipe =
-I/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/power=
pc.powerpc64/lib/clang/libclang =
-I/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/power=
pc.powerpc64/lib/clang/libllvm =
-I/usr/src/contrib/llvm/tools/clang/lib/Basic =
-I/usr/src/contrib/llvm/tools/clang/lib/Driver =
-I/usr/src/contrib/llvm/tools/clang/include -DCLANG_ENABLE_ARCMT =
-DCLANG_ENABLE_STATIC_ANALYZER -I/usr/src/lib/clang/include =
-I/usr/src/contrib/llvm/include -DLLVM_BUILD_GLOBAL_ISEL =
-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS =
-DLLVM_DEFAULT_TARGET_TRIPLE=3D\"powerpc64-unknown-freebsd12.0\" =
-DLLVM_HOST_TRIPLE=3D\"powerpc64-unknown-freebsd12.0\" =
-DDEFAULT_SYSROOT=3D\"\" -ffunction-sections -fdata-sections =
-gline-tables-only -fstack-protector-strong -Qunused-arguments  =
-std=3Dc++11 -fno-exceptions -fno-rtti -gline-tables-only -stdlib=3Dlibc++=
 -Wno-c++11-extensions  -c =
/usr/src/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp -o Lex/Lexer.o;'
.CURDIR=3D'/usr/src/lib/clang/libclang'
.MAKE=3D'make'
=
.OBJDIR=3D'/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/=
src/powerpc.powerpc64/lib/clang/libclang'
.TARGETS=3D'all'
=
DESTDIR=3D'/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/=
src/powerpc.powerpc64/tmp'
LD_LIBRARY_PATH=3D''
MACHINE=3D'powerpc'
MACHINE_ARCH=3D'powerpc64'
MAKEOBJDIRPREFIX=3D''
MAKESYSPATH=3D'/usr/src/share/mk'
MAKE_VERSION=3D'20180512'
=
PATH=3D'/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src=
/powerpc.powerpc64/tmp/legacy/usr/sbin:/usr/obj/powerpc64vtsc_clang_altbin=
utils/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/legacy/usr/bin:/usr/=
obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc.powe=
rpc64/tmp/legacy/bin:/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powe=
rpc64/usr/src/powerpc.powerpc64/tmp/usr/sbin:/usr/obj/powerpc64vtsc_clang_=
altbinutils/powerpc.powerpc64/usr/src/powerpc.powerpc64/tmp/usr/bin:/sbin:=
/bin:/usr/sbin:/usr/bin'
SRCTOP=3D'/usr/src'
=
OBJTOP=3D'/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/s=
rc/powerpc.powerpc64'
.MAKE.MAKEFILES=3D'/usr/src/share/mk/sys.mk =
/usr/src/share/mk/local.sys.env.mk /usr/src/share/mk/src.sys.env.mk =
/root/src.configs/src.conf.powerpc64-clang_altbinutils-bootstrap.amd64-hos=
t /usr/src/share/mk/bsd.mkopt.mk /usr/src/share/mk/src.sys.obj.mk =
/usr/src/share/mk/auto.obj.mk /usr/src/share/mk/bsd.suffixes.mk =
/root/src.configs/make.conf /usr/src/share/mk/local.sys.mk =
/usr/src/share/mk/src.sys.mk /dev/null =
/usr/src/lib/clang/libclang/Makefile /usr/src/share/mk/src.opts.mk =
/usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.opts.mk =
/usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/bsd.compiler.mk =
/usr/src/share/mk/bsd.linker.mk /usr/src/lib/clang/clang.pre.mk =
/usr/src/lib/clang/llvm.pre.mk /usr/src/lib/clang/clang.build.mk =
/usr/src/lib/clang/llvm.build.mk /usr/src/share/mk/bsd.lib.mk =
/usr/src/share/mk/bsd.init.mk /usr/src/share/mk/local.init.mk =
/usr/src/share/mk/src.init.mk =
/usr/src/lib/clang/libclang/../Makefile.inc =
/usr/src/share/mk/bsd.libnames.mk /usr/src/share/mk/src.libnames.mk =
/usr/src/share/mk/bsd.symver.mk /usr/src/share/mk/bsd.nls.mk =
/usr/src/share/mk/bsd.files.mk /usr/src/share/mk/bsd.incs.mk =
/usr/src/share/mk/bsd.confs.mk /usr/src/share/mk/bsd.links.mk =
/usr/src/share/mk/bsd.dep.mk /usr/src/share/mk/bsd.clang-analyze.mk =
/usr/src/share/mk/bsd.obj.mk /usr/src/share/mk/bsd.subdir.mk =
/usr/src/share/mk/bsd.sys.mk'
.PATH=3D'. /usr/src/lib/clang/libclang =
/usr/src/contrib/llvm/tools/clang/lib'
1 error


I'll note that the -I's for include/'s:

-I/usr/src/contrib/llvm/tools/clang/include
-I/usr/src/lib/clang/include
-I/usr/src/contrib/llvm/include

do not seem to match up with any of:

/usr/src/contrib/llvm/tools/clang/lib/Headers/
/usr/src/sys/powerpc/include/
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/tmp/usr/include/machine/altivec.h
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/tmp/usr/lib/clang/6.0.0/include/altivec.h
=
/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/obj-lib32/tmp/usr/include/machine/altivec.h


For reference:

# more =
~/src.configs/src.conf.powerpc64-clang_altbinutils-bootstrap.amd64-host=20=

TO_TYPE=3Dpowerpc64
TOOLS_TO_TYPE=3D${TO_TYPE}
VERSION_CONTEXT=3D12.0
#
KERNCONF=3DGENERIC64vtsc-NODBG
TARGET=3Dpowerpc
.if ${.MAKE.LEVEL} =3D=3D 0
TARGET_ARCH=3D${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_CROSS_COMPILER=3D
WITHOUT_SYSTEM_COMPILER=3D
#
WITH_LIBCPLUSPLUS=3D
WITHOUT_BINUTILS_BOOTSTRAP=3D
WITH_ELFTOOLCHAIN_BOOTSTRAP=3D
WITH_CLANG_BOOTSTRAP=3D
WITH_CLANG=3D
#WITH_CLANG_IS_CC=3D
WITH_CLANG_FULL=3D
WITH_CLANG_EXTRAS=3D
WITHOUT_LLD_BOOTSTRAP=3D
WITH_LLD=3D
WITHOUT_LLD_IS_LD=3D
WITH_LLDB=3D
#
WITH_BOOT=3D
# avoid lang/gcc7 and the like attempting
# lib32 (-m32) support that does not work.
# (Register usage mismatch?)
WITHOUT_LIB32=3D
#
WITHOUT_CLANG_IS_CC=3D
WITHOUT_BINUTILS=3D
WITHOUT_GCC_BOOTSTRAP=3D
WITHOUT_GCC=3D
WITHOUT_GCC_IS_CC=3D
WITHOUT_GNUCXX=3D
#
NO_WERROR=3D
MALLOC_PRODUCTION=3D
#
# Avoid converts between pointers to integer types with different sign =
[-Werror,-Wpointer-sign]
# and such from blocking the build.
WERROR=3D
#
WITH_REPRODUCIBLE_BUILD=3D
WITH_DEBUG_FILES=3D
#
#
# For TO (so-called "cross") stages . . .
# So-called-cross via ${TO_TYPE}-xtoolchain-gcc/${TO_TYPE}-gcc. . .
# TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related binutils. . .
#
=
CROSS_BINUTILS_PREFIX=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSI=
ON_CONTEXT}/bin/
.if ${.MAKE.LEVEL} =3D=3D 0
#
# Note: The WITH_CROSS_COMPILER picks up the CROSS_BINUTILS_PREFIX
#       binding automatically.
#
XAS=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bin/as=

XAR=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bin/ar=

XNM=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bin/nm=

=
XOBJCOPY=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/b=
in/objcopy
=
XOBJDUMP=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/b=
in/objdump
=
XRANLIB=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bi=
n/ranlib
=
XSIZE=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bin/=
size
#NO-SUCH: =
XSTRINGS=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/b=
in/strings
=
XSTRINGS=3D/usr/local/bin/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEX=
T}-strings
.export XAS
.export XAR
.export XNM
.export XOBJCOPY
.export XOBJDUMP
.export XRANLIB
.export XSIZE
.export XSTRINGS
XLD=3D/usr/local/${TOOLS_TO_TYPE}-unknown-freebsd${VERSION_CONTEXT}/bin/ld=

.export XLD
.endif

# more ~/src.configs/make.conf=20
CFLAGS.gcc+=3D -v

# more =
~/sys_build_scripts.amd64-host/make_powerpc64vtsc_nodebug_clang_altbinutil=
s-amd64-host.sh=20
kldload -n filemon && \
script =
~/sys_typescripts/typescript_make_powerpc64vtsc_nodebug_clang_altbinutils-=
amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
env __MAKE_CONF=3D"/root/src.configs/make.conf" SRCCONF=3D"/dev/null" =
SRC_ENV_CONF=3D"/root/src.configs/src.conf.powerpc64-clang_altbinutils-boo=
tstrap.amd64-host" \
WITH_META_MODE=3Dyes \
=
MAKEOBJDIRPREFIX=3D"/usr/obj/powerpc64vtsc_clang_altbinutils/powerpc.power=
pc64" \
make $*


Stage 3 "cross tools" built clang just fine.

My amd64 -> aarch64 cross build finished without reporting an error.


=3D=3D=3D
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2DEAB250-1D93-4009-82F4-BB55CD4E406D>