Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 May 2016 19:20:54 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Bryan Drewery <bdrewery@FreeBSD.org>, FreeBSD Current <freebsd-current@freebsd.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, freebsd-arm <freebsd-arm@freebsd.org>
Subject:   11.0 -r300944 buildworld amd64 -> armv6/armv7a cross build: Some XCPP and XCC use without -target specified so it rejects -march=armv7a
Message-ID:  <80DF38BA-CC08-4E58-9B19-CFBE72CF7262@dsl-only.net>

next in thread | raw e-mail | index | archive | help
[Warning: The following report is already based on trying to work around =
prior problems already noted elsewhere. That makes these somewhat more =
suspect. The -march=3Darmv7a that is rejected below is from =
XCC/XCXX/XCPP content in my src.conf. I later list the src.conf content =
used.]

[WITH_META_MODE=3Dyes is in use. cleanworld had been done before hand.]

Example failure:

> # more =
/usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/include/rpcsvc/key_prot=
.h.meta
> # Meta data file =
/usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/include/rpcsvc/key_prot=
.h.meta
> CMD RPCGEN_CPP=3D/usr/bin/clang-cpp\ -march=3Darmv7a\ -mcpu=3Dcortex-a7\=
 -B/usr/local/arm-gnueabi-freebsd/bin\ -DCOMPAT_SOFTFP\ =
-mfloat-abi=3Dsoftfp\ \ =
-L/usr/obj/clang/arm.armv6/usr/src/libsoft/usr/libsoft\ \ =
--sysroot=3D/usr/obj/clang/arm.armv6/usr/src/libsoft\ \ =
-B/usr/obj/clang/arm.armv6/usr/src/tmp/usr/bin\ =
-B/usr/obj/clang/arm.armv6/usr/src/libsoft/usr/libsoft rpcgen -C -h =
-DWANT_NFS3 /usr/src/include/rpcsvc/key_prot.x -o key_prot.h
> CWD /usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/include/rpcsvc
> TARGET key_prot.h
> -- command output --
> clang-cpp: warning: argument unused during compilation: =
'-mcpu=3Dcortex-a7'
> clang-cpp: warning: argument unused during compilation: =
'-mfloat-abi=3Dsoftfp'
> clang-cpp: warning: argument unused during compilation: =
'-L/usr/obj/clang/arm.armv6/usr/src/libsoft/usr/libsoft'
> error: unknown target CPU 'armv7a'
> *** Error code 1
. . .

rpcb_prot.h was similar.

These appear to be because -target armv6-???-freebsd11.0 was not =
supplied to clang-cpp (given that -march=3Darmv7a was supplied to =
clang-cpp via src.conf material but armv7a is not a variation of the =
host (amd64) context).

(I try to be sure that clang-cpp is always told the specific -march that =
I=E2=80=99m targeting in case clang-cpp provides macro definitions on =
that basis that might be used.)


Adding a -target in XCPP and retrying got farther but failed for XCC not =
getting a -target and so another rejection of -march=3Darmv7a happened:

> # more =
/usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/gnu/lib/libssp/libssp_n=
onshared/ssp-local.o*
> # Meta data file =
/usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/gnu/lib/libssp/libssp_n=
onshared/ssp-local.o.meta
> CMD /usr/bin/clang -march=3Darmv7a -mcpu=3Dcortex-a7 =
-B/usr/local/arm-gnueabi-freebsd/bin -DCOMPAT_SOFTFP -mfloat-abi=3Dsoftfp =
 -L/usr/obj/clang/arm.armv6/usr/src/libsoft/usr/libsoft  =
--sysroot=3D/usr/obj/clang/arm.armv6/usr/src/libsoft  =
-B/usr/obj/clang/arm.armv6/usr/src/tmp/usr/bin =
-B/usr/obj/clang/arm.armv6/usr/src/libsoft/usr/libsoft  -O -pipe =
-DHAVE_CONFIG_H -I/usr/src/gnu/lib/libssp/libssp_nonshared/..  =
-I/usr/src/gnu/lib/libssp/libssp_nonshared/../../../../contrib/gcclibs/lib=
ssp  =
-I/usr/src/gnu/lib/libssp/libssp_nonshared/../../../../contrib/gcclibs/inc=
lude -fPIC -DPIC -fvisibility=3Dhidden -mfloat-abi=3Dsoftfp  -std=3Dgnu99 =
   -Qunused-arguments  -c =
/usr/src/gnu/lib/libssp/libssp_nonshared/../../../../contrib/gcclibs/libss=
p/ssp-local.c -o ssp-local.o
> CMD=20
> CWD =
/usr/obj/clang/arm.armv6/usr/src/worldsoft/usr/src/gnu/lib/libssp/libssp_n=
onshared
> TARGET ssp-local.o
> -- command output --
> error: unknown target CPU 'armv7a'
> *** Error code 1
. . .

Some of the other clang command line arguments (-mcpu and -B) are also =
from my src.conf file. More is missing for a normal compile than just =
-target material.


[Note that having even just a "redundant" -march=3Darmv6 in =
XCC/XCXX/XCPP is a good testing technique for proving that all the usage =
has sufficient context to allow such an explicit specification from the =
right family.]



Supporting details. . .

make.conf empty.

src.conf (before forcing XCPP to have an armv6 family -target):

TO_TYPE=3Darmv6
TOOLS_TO_TYPE=3Darm-gnueabi
#
KERNCONF=3DRPI2-NODBG
TARGET=3Darm
.if ${.MAKE.LEVEL} =3D=3D 0
TARGET_ARCH=3D${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITHOUT_CROSS_COMPILER=3D
WITHOUT_SYSTEM_COMPILER=3D
#
#CPUTYPE=3Dsoft
WITH_LIBSOFT=3D
WITH_LIBCPLUSPLUS=3D
WITHOUT_BINUTILS_BOOTSTRAP=3D
WITHOUT_CLANG_BOOTSTRAP=3D
WITH_CLANG=3D
WITH_CLANG_IS_CC=3D
WITH_CLANG_FULL=3D
WITH_CLANG_EXTRAS=3D
WITH_LLDB=3D
#
WITH_BOOT=3D
WITHOUT_LIB32=3D
#
WITHOUT_ELFTOOLCHAIN_BOOTSTRAP=3D
WITHOUT_GCC_BOOTSTRAP=3D
WITHOUT_GCC=3D
WITHOUT_GCC_IS_CC=3D
WITHOUT_GNUCXX=3D
#
NO_WERROR=3D
#WERROR=3D
MALLOC_PRODUCTION=3D
#
WITH_DEBUG_FILES=3D
#
#
# To based on clang (via system)...
# TOOLS_TO_TYPE based on ${TO_TYPE}-xtoolchain-gcc related binutils...
#
.if ${.MAKE.LEVEL} =3D=3D 0
XCC=3D/usr/bin/clang -march=3Darmv7a -mcpu=3Dcortex-a7 =
-B/usr/local/${TOOLS_TO_TYPE}-freebsd/bin
XCXX=3D/usr/bin/clang++ -march=3Darmv7a -mcpu=3Dcortex-a7 =
-B/usr/local/${TOOLS_TO_TYPE}-freebsd/bin
XCPP=3D/usr/bin/clang-cpp -march=3Darmv7a -mcpu=3Dcortex-a7 =
-B/usr/local/${TOOLS_TO_TYPE}-freebsd/bin
.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 based on clang (via system)...
#
#COMPILER_TYPE=3Dclang
.if ${.MAKE.LEVEL} =3D=3D 0
CC=3D/usr/bin/clang
CXX=3D/usr/bin/clang++
CPP=3D/usr/bin/clang-cpp
.export CC
.export CXX
.export CPP
.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?80DF38BA-CC08-4E58-9B19-CFBE72CF7262>