Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 May 2018 22:07:38 -0700
From:      Mark Millard <marklmi26-fbsd@yahoo.com>
To:        freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: What fails when devel/xtoolchain-llvm60 attempts to build powerpc64's lib32 in buildworld cross builds (from amd64 here)
Message-ID:  <0AAA00A2-5C78-44FF-AFFE-5D796A22EBC7@yahoo.com>
In-Reply-To: <E7B0A9B4-51FE-4B23-ACF1-A5ACA01B89FE@yahoo.com>
References:  <81EA8FB2-101B-4D31-A2D4-91CCB78AF695@yahoo.com> <E7B0A9B4-51FE-4B23-ACF1-A5ACA01B89FE@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-May-11, at 4:09 PM, Mark Millard <marklmi26-fbsd@yahoo.com> =
wrote:

> [I experiment with targeting powerpc family members with
> modern tool chains. In this case trying to use
> devel/xtoolchain-llvm60 . This was indirectly reached via
> commenting on a bugzilla entry for something else powerpc
> family related.]
>=20
> BEGIN setup notes:
>=20
> Because of (at least) lld problems for targeting powerpc family =
members,
> the following is based on an alternate toolchains/*.mk :
>=20
> # diff /usr/local/share/toolchains/llvm60.mk =
/usr/local/share/toolchains/llvm60_altbinutils.mk
> 4,5c4,5
> < XLD=3D/usr/local/llvm60/bin/ld.lld
> < CROSS_BINUTILS_PREFIX=3D/var/empty
> ---
>=20
>> #XLD=3D/usr/local/llvm60/bin/ld.lld
>> #CROSS_BINUTILS_PREFIX=3D/var/empty
>=20
> This is to allow setting up the use of:
>=20
> CROSS_BINUTILS_PREFIX=3D/usr/local/powerpc64-unknown-freebsd12.0/bin/
>=20
> END Setup notes.
>=20
> The below is from adding a -v to what the .meta file showed for the =
failing command.
> Note the "-cc1as -triple i386-portbld-freebsd12.0" and "-target-cpu =
i486" that results
> from buildworld=E2=80=99s lib32 related command that tries to compile =
assembly source for
> powerpc.
>=20
>=20
> # /usr/local/bin/clang60 -v -DCOMPAT_32BIT -mcpu=3Dpowerpc -m32 =
-L/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc=
.powerpc64/obj-lib32/tmp/usr/lib32 =
tosysroot=3D/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/s=
rc/powerpc.powerpc64/obj-lib32/tmp =
-B/usr/local/powerpc64-unknown-freebsd12.0/bin =
-B/usr/obj/powerpc64vtsc_x -Wall -Wno-format-y2k -W =
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes =
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch =
-Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline =
-Wnested-externs -Wredundant-decls -Wold-style-definition =
-Wno-pointer-sign -Wthread-safety -Wno-empty-body -Wno-string-plus-int =
-Wno-unused-const-variable  -Qunused-arguments    -c =
/usr/src/lib/csu/powerpc/crtn.S -o crtn.ole-definition -Wno-pointer-sign =
-Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unus
> clang version 6.0.0 =
(tags/RELEASE_600/final)/usr/src/lib/csu/powerpc/crtn.S -o crtn.o
> Target: i386-portbld-freebsd12.0
> Thread model: posix
> InstalledDir: /usr/local/llvm60/bin
> "/usr/local/llvm60/bin/clang-6.0" -cc1 -triple =
i386-portbld-freebsd12.0 -E -disable-free -main-file-name crtn.S =
-mrelocation-model static -mthread-model posix -mdisable-fp-elim =
-masm-verbose -mconstructor-aliases -target-cpu i486 -dwarf-column-info =
-debug-info-kind=3Dstandalone -dwarf-version=3D2 -debugger-tuning=3Dgdb =
-v -coverage-notes-file /usr/src/crtn.gcno -resource-dir =
/usr/local/llvm60/lib/clang/6.0.0 -D COMPAT_32BIT -I =
/usr/src/lib/csu/common -I /usr/src/lib/libc/include -isysroot =
/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc.p=
owerpc64/obj-lib32/tmp -O2 -Wsystem-headers -Wall -Wno-format-y2k -W =
-Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes =
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch =
-Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline =
-Wnested-externs -Wredundant-decls -Wold-style-definition =
-Wno-pointer-sign -Wthread-safety -Wno-empty-body -Wno-string-plus-int =
-Wno-unused-const-variable -std=3Dgnu99 -fconst-strings =
-fdebug-compilation-dir /usr/src -ferror-limit 19 -fmessage-length 180 =
-fobjc-runtime=3Dgnustep -fdiagnostics-show-option -vectorize-loops =
-vectorize-slp -o /tmp/crtn-d80df9.s -x assembler-with-cpp =
/usr/src/lib/csu/powerpc/crtn.S
> clang -cc1 version 6.0.0 based upon LLVM 6.0.0 default target =
x86_64-portbld-freebsd12.0
> #include "..." search starts here:
> #include <...> search starts here:
> /usr/src/lib/csu/common
> /usr/src/lib/libc/include
> /usr/local/llvm60/lib/clang/6.0.0/include
> =
/usr/obj/powerpc64vtsc_xtoolchain-llvm/powerpc.powerpc64/usr/src/powerpc.p=
owerpc64/obj-lib32/tmp/usr/include
> End of search list.
> "/usr/local/llvm60/bin/clang-6.0" -cc1as -triple =
i386-portbld-freebsd12.0 -filetype obj -main-file-name crtn.S =
-target-cpu i486 -I /usr/src/lib/csu/common -I /usr/src/lib/libc/include =
-fdebug-compilation-dir /usr/src -dwarf-debug-producer clang version =
6.0.0 (tags/RELEASE_600/final) -I /usr/src/lib/csu/common -I =
/usr/src/lib/libc/include -debug-info-kind=3Dlimited -dwarf-version=3D2 =
-mrelocation-model static -o crtn.o /tmp/crtn-d80df9.s
> /usr/src/lib/csu/powerpc/crtn.S:29:2: warning: DWARF2 only supports =
one section per compilation unit
> .section .init,"ax",@progbits
> ^
> /usr/src/lib/csu/powerpc/crtn.S:30:11: error: unexpected token in =
memory operand
> lwz 11,0(1)
>         ^
> /usr/src/lib/csu/powerpc/crtn.S:31:10: error: unexpected token in =
memory operand
> lwz 0,4(11)
>        ^
> /usr/src/lib/csu/powerpc/crtn.S:32:2: error: invalid instruction =
mnemonic 'mtlr'
> mtlr 0
> ^~~~
> . . .
>=20
>=20
>=20
> It would appear that a -triple may be missing in the =
/usr/local/bin/clang60
> command line that would specify the specific ABI to target. It appears =
that
> the -mcpu=3Dpowerpc is not enough to even get the cpu family right as =
far as
> what assembler notation to process.
>=20
> I do not know if an appropriate -triple addition would currently be
> sufficient for things to start working.
>=20
> Something needs to cause the right assembler notation to be processed =
for
> lib32 if WITH_LIB32=3D is to be supported for cross builds.

Kenneth Salerno's =
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227920
is an example patch for 11.1 for this lack of -target use where it can =
be
needed.


=3D=3D=3D
Mark Millard
marklmi26-fbsd 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?0AAA00A2-5C78-44FF-AFFE-5D796A22EBC7>