Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Sep 2017 12:54:26 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-arm <freebsd-arm@freebsd.org>, x11@FreeBSD.org, FreeBSD Ports <freebsd-ports@freebsd.org>
Cc:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>
Subject:   x11/pixman vs. clang 5 arm assembler handling: "error: unknown directive" and the like
Message-ID:  <5CAB42C9-984A-4BC9-A4CC-4BDD74932084@dsl-only.net>

next in thread | raw e-mail | index | archive | help
In an experiment with building some arm ports via poudriere
cross building on amd64 I got the following. It appears that
clang does not handle all the assembler notation and a
different assembler might need to be used for x11/pixman .
(The x11/pixman usage is indirect from having specified
x11/lumina and x11/xscreensaver ).

--- pixman-arm-simd-asm.lo ---
/bin/sh ../libtool     --mode=3Dcompile /nxb-bin/usr/bin/cc =
-DHAVE_CONFIG_H  -I. -I..   -mcpu=3Dcortex-a7   -O2 -pipe =
-mcpu=3Dcortex-a7  -g -fno-strict-aliasing -MT pixman-arm-simd-asm.lo =
-MD -MP -MF .deps/pixman-arm-simd-asm.Tpo -c -o pixman-arm-simd-asm.lo =
pixman-arm-simd-asm.S
libtool: compile:  /nxb-bin/usr/bin/cc -DHAVE_CONFIG_H -I. -I.. =
-mcpu=3Dcortex-a7 -O2 -pipe -mcpu=3Dcortex-a7 -g -fno-strict-aliasing =
-MT pixman-arm-simd-asm.lo -MD -MP -MF .deps/pixman-arm-simd-asm.Tpo -c =
pixman-arm-simd-asm.S  -fPIC -DPIC -o .libs/pixman-arm-simd-asm.o
<instantiation>:1:1: error: unknown directive
. . .
--- pixman-arm-simd-asm.lo ---
.func fname
^
./pixman-arm-simd-asm.h:599:5: note: while in macro instantiation
    pixman_asm_function fname
    ^
/tmp/pixman-arm-simd-asm-b59328.s:910:1: note: while in macro =
instantiation
generate_composite_function pixman_composite_src_8888_8888_asm_armv6, =
32, 0, 32, FLAG_DST_WRITEONLY | FLAG_COND_EXEC | =
FLAG_SPILL_LINE_VARS_WIDE | FLAG_PROCESS_PRESERVES_SCRATCH, 4, =
blit_init, nop_macro, nop_macro, blit_process_head, nop_macro, =
blit_inner_loop
^
./pixman-arm-simd-asm.h:614:6: error: expected absolute expression
 .if prefetch_distance =3D=3D 0
     ^
/tmp/pixman-arm-simd-asm-b59328.s:910:1: note: while in macro =
instantiation
generate_composite_function pixman_composite_src_8888_8888_asm_armv6, =
32, 0, 32, FLAG_DST_WRITEONLY | FLAG_COND_EXEC | =
FLAG_SPILL_LINE_VARS_WIDE | FLAG_PROCESS_PRESERVES_SCRATCH, 4, =
blit_init, nop_macro, nop_macro, blit_process_head, nop_macro, =
blit_inner_loop
^
./pixman-arm-simd-asm.h:620:6: error: expected absolute expression
 .if src_bpp =3D=3D 32
     ^
. . .

(I've omitted much later material continuing to reject notation.)
(A variant build without the -mcpu=3Dcortex-a7 usage got the same.)


The context for the above is from a
poudriere/qemu-user-static/native_xtools based cross build from
amd64:

poudriere jail -c -j zrFBSDx64CjailArmV7 -a arm.armv6 -x -m null -M =
/usr/obj/DESTDIRs/clang-armv7-installworld-poud -S /usr/src -v =
12.0-CURRENT

poudriere bulk -j zrFBSDx64CjailArmV7 -w -f /root/armv7-origins.txt

The -x use was enabled for -m null via:

/usr/local/share/poudriere/jail.sh having a "build_native_xtools"
added:

       null)
               JAILFS=3Dnone
               FCT=3Dbuild_native_xtools
               ;;


# uname -apKU
FreeBSD FreeBSDx64OPC 12.0-CURRENT FreeBSD 12.0-CURRENT  r323147M  amd64 =
amd64 1200043 1200043

/usr/obj/DESTDIRs/clang-armv7-installworld-poud is from an arm/armv6
build of the same sources using -mcpu=3Dcortex-a7 , installed via
installworld distrib-dirs distribution DB_FROM_SRC=3D1 DESTDIR=3D. . . :

# more ~/src.configs/src.conf.armv7-clang-bootstrap.amd64-host=20
TO_TYPE=3Darmv6
#
KERNCONF=3DGENERIC-NODBG
TARGET=3Darm
.if ${.MAKE.LEVEL} =3D=3D 0
TARGET_ARCH=3D${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_CROSS_COMPILER=3D
WITHOUT_SYSTEM_COMPILER=3D
#
#CPUTYPE=3Dsoft
WITH_LIBCPLUSPLUS=3D
WITH_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
WITH_LLD=3D
#
# Linking lldb fails for armv6(/v7)
WITHOUT_LLDB=3D
#
WITH_BOOT=3D
WITHOUT_LIB32=3D
WITHOUT_LIBSOFT=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_REPRODUCIBLE_BUILD=3D
WITH_DEBUG_FILES=3D
#
XCFLAGS+=3D -mcpu=3Dcortex-a7
XCXXFLAGS+=3D -mcpu=3Dcortex-a7
# There is no XCPPFLAGS but XCPP gets XCFLAGS content.


The source variations are almost all for powerpc family
explorations:

# svnlite status /usr/src/ | sort
?       /usr/src/sys/amd64/conf/GENERIC-DBG
?       /usr/src/sys/amd64/conf/GENERIC-NODBG
?       /usr/src/sys/arm/conf/GENERIC-DBG
?       /usr/src/sys/arm/conf/GENERIC-NODBG
?       /usr/src/sys/arm64/conf/GENERIC-DBG
?       /usr/src/sys/arm64/conf/GENERIC-NODBG
?       /usr/src/sys/powerpc/conf/GENERIC64vtsc-DBG
?       /usr/src/sys/powerpc/conf/GENERIC64vtsc-NODBG
?       /usr/src/sys/powerpc/conf/GENERICvtsc-DBG
?       /usr/src/sys/powerpc/conf/GENERICvtsc-NODBG
M       /usr/src/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp
M       /usr/src/contrib/llvm/tools/lld/ELF/Arch/PPC64.cpp
M       /usr/src/crypto/openssl/crypto/armcap.c
M       /usr/src/lib/Makefile
M       /usr/src/lib/libkvm/kvm_powerpc.c
M       /usr/src/lib/libkvm/kvm_private.c
M       /usr/src/sys/boot/ofw/Makefile.inc
M       /usr/src/sys/boot/powerpc/Makefile.inc
M       /usr/src/sys/boot/powerpc/boot1.chrp/Makefile
M       /usr/src/sys/boot/powerpc/kboot/Makefile
M       /usr/src/sys/boot/uboot/Makefile.inc
M       /usr/src/sys/conf/kmod.mk
M       /usr/src/sys/conf/ldscript.powerpc
M       /usr/src/sys/kern/subr_pcpu.c
M       /usr/src/sys/powerpc/aim/mmu_oea64.c
M       /usr/src/sys/powerpc/ofw/ofw_machdep.c
M       /usr/src/sys/powerpc/powerpc/interrupt.c
M       /usr/src/sys/powerpc/powerpc/mp_machdep.c
M       /usr/src/sys/powerpc/powerpc/trap.c


# svnlite info /usr/ports/ | grep "Re[plv]"
Relative URL: ^/head
Repository Root: svn://svn.freebsd.org/ports
Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5
Revision: 449165
Last Changed Rev: 449165


# svnlite status /usr/ports/ | sort
M       /usr/ports/Mk/bsd.port.mk
M       /usr/ports/base/gcc/Makefile
M       /usr/ports/base/gcc/distinfo
M       /usr/ports/base/gcc/pkg-plist
M       /usr/ports/devel/libunwind/Makefile
M       /usr/ports/sysutils/cdrdao/Makefile


# more /usr/local/etc/poudriere.d/make.conf
WANT_QT_VERBOSE_CONFIGURE=3D1
#
DEFAULT_VERSIONS+=3Dperl5=3D5.24 gcc=3D7
#
# =46rom a local /usr/ports/Mk/bsd.port.mk extension:
ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG=3D
#
.if ${.CURDIR:M*/devel/llvm*}
#WITH_DEBUG=3D
.elif ${.CURDIR:M*/www/webkit-qt5*}
#WITH_DEBUG=3D
.else
WITH_DEBUG=3D
.endif
MALLOC_PRODUCTION=3D


# more /usr/local/etc/poudriere.d/zrFBSDx64CjailArmV7-make.conf          =
                                                                         =
                                     =20
CFLAGS+=3D -mcpu=3Dcortex-a7
CXXFLAGS+=3D -mcpu=3Dcortex-a7
CPPFLAGS+=3D -mcpu=3Dcortex-a7


As for that "ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG" I have
in /usr/ports/Mk/bsd.port.mk :

 STRIP_CMD=3D	${TRUE}
 .endif
 DEBUG_FLAGS?=3D	-g
+.if defined(ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG)
+CFLAGS:=3D		${CFLAGS} ${DEBUG_FLAGS}
+.else
 CFLAGS:=3D		${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
+.endif
 .if defined(INSTALL_TARGET)
 INSTALL_TARGET:=3D	${INSTALL_TARGET:S/^install-strip$/install/g}
 .endif


I've also had trouble in some contexts with where bad.port.mk
uses ${UNAME} (empty string results) and so have forced the
expected content to match the context that this is in:

 # Get the architecture
 .if !defined(ARCH)
-ARCH!=3D	${UNAME} -p
+ARCH!=3D	echo amd64
 .endif
 _EXPORTED_VARS+=3D	ARCH
=20
 # Get the operating system type
 .if !defined(OPSYS)
-OPSYS!=3D	${UNAME} -s
+OPSYS!=3D	echo FreeBSD
 .endif
 _EXPORTED_VARS+=3D	OPSYS
=20
 .if !defined(_OSRELEASE)
-_OSRELEASE!=3D	${UNAME} -r
+_OSRELEASE!=3D	echo 12.0-CURRENT
 .endif
 _EXPORTED_VARS+=3D	_OSRELEASE
=20


=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?5CAB42C9-984A-4BC9-A4CC-4BDD74932084>