Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Sep 2017 11:24:04 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        FreeBSD Toolchain <freebsd-toolchain@freebsd.org>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   clang 5 vs. building the head's -r323246 kernel for TARGET_ARCH=powerpc : system ld aborts; other notes
Message-ID:  <0F28DDCB-1B8C-465E-99C9-EB1BBD7A520F@dsl-only.net>

next in thread | raw e-mail | index | archive | help
The attempt to build head -r323246 via the system clang 5
stops for the likes of:

--- agp.ko.full ---
ld: agp.kld(.text+0x2e08): R_PPC_PLTREL24 reloc against local symbol
agp.kld: could not read symbols: Bad value
*** [agp.ko.full] Error code 1

There is a build-race and other instance of "R_PPC_PLTREL24 reloc =
against
local symbol" sometimes occurs instead. Also not much of the kernel =
builds
before this happens.

The problem is not new with -r323246 .

Back in clang 4 days I did not have this problem.

I give the build details later below.


There is a report of:

--- ahd_pci.o ---
/usr/src/sys/dev/aic7xxx/ahd_pci.c:113:10: warning: implicit conversion =
from 'long long' to 'bus_addr_t' (aka 'unsigned int') changes value from =
549755813887 to 4294967295 [-Wconstant-conversion]
                                   ? 0x7FFFFFFFFF
                                   ~~^~~~~~~~~~~~
/usr/src/sys/dev/aic7xxx/aic_osm_lib.h:149:7: note: expanded from macro =
'aic_dma_tag_create'
                           lowaddr, highaddr, filter, filterarg,        =
\
                           ^~~~~~~

before it stops. The code in question is:

        if (sizeof(bus_addr_t) > 4)
                ahd->flags |=3D AHD_39BIT_ADDRESSING;

        /* Allocate a dmatag for our SCB DMA maps */
        error =3D aic_dma_tag_create(ahd, =
/*parent*/bus_get_dma_tag(dev),
                                   /*alignment*/1, /*boundary*/0,
                                   (ahd->flags & AHD_39BIT_ADDRESSING)
                                   ? 0x7FFFFFFFFF
                                   : BUS_SPACE_MAXADDR_32BIT,
                                   /*highaddr*/BUS_SPACE_MAXADDR,
                                   /*filter*/NULL, /*filterarg*/NULL,
                                   /*maxsize*/BUS_SPACE_MAXSIZE_32BIT,
                                   /*nsegments*/AHD_NSEG,
                                   /*maxsegsz*/AHD_MAXTRANSFER_SIZE,
                                   /*flags*/0,
                                   &ahd->parent_dmat);

So it is actually using BUS_SPACE_MAXADDR_32BIT
but it still complains about the extra bits in
the other case. So

(bus_addr_t) 0x7FFFFFFFFF

might be appropriate to avoid such warnings.



For completeness: there are also reports of . . .

--- if_ale.o ---
/usr/src/sys/dev/ale/if_ale.c:2115:14: warning: taking address of packed =
member 'rx_frames' of class or structure 'smb' may result in an =
unaligned pointer value [-Waddress-of-packed-member]
        for (reg =3D &sb.rx_frames, i =3D 0; reg <=3D =
&sb.rx_pkts_filtered; reg++) {
                    ^~~~~~~~~~~~
/usr/src/sys/dev/ale/if_ale.c:2115:43: warning: taking address of packed =
member 'rx_pkts_filtered' of class or structure 'smb' may result in an =
unaligned pointer value [-Waddress-of-packed-member]
        for (reg =3D &sb.rx_frames, i =3D 0; reg <=3D =
&sb.rx_pkts_filtered; reg++) {
                                                 ^~~~~~~~~~~~~~~~~~~
/usr/src/sys/dev/ale/if_ale.c:2120:14: warning: taking address of packed =
member 'tx_frames' of class or structure 'smb' may result in an =
unaligned pointer value [-Waddress-of-packed-member]
        for (reg =3D &sb.tx_frames, i =3D 0; reg <=3D =
&sb.tx_mcast_bytes; reg++) {
                    ^~~~~~~~~~~~
/usr/src/sys/dev/ale/if_ale.c:2120:43: warning: taking address of packed =
member 'tx_mcast_bytes' of class or structure 'smb' may result in an =
unaligned pointer value [-Waddress-of-packed-member]
        for (reg =3D &sb.tx_frames, i =3D 0; reg <=3D =
&sb.tx_mcast_bytes; reg++) {
                                                 ^~~~~~~~~~~~~~~~~
. . .


For the build-stopper there is:

make[4]: stopped in /usr/src/sys/modules/agp
.ERROR_TARGET=3D'agp.ko.full'
=
.ERROR_META_FILE=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys=
/GENERICvtsc-NODBG/modules/usr/src/sys/modules/agp/agp.ko.full.meta'
.MAKE.LEVEL=3D'4'
MAKEFILE=3D''
.MAKE.MODE=3D'meta missing-filemon=3Dyes missing-meta=3Dyes silent=3Dyes =
verbose'
_ERROR_CMD=3D'ld -m elf32ppc_fbsd -Bshareable -znotext -d -warn-common  =
-o agp.ko.full agp.kld;'
.CURDIR=3D'/usr/src/sys/modules/agp'
.MAKE=3D'make'
=
.OBJDIR=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICv=
tsc-NODBG/modules/usr/src/sys/modules/agp'
.TARGETS=3D'all'
DESTDIR=3D''
LD_LIBRARY_PATH=3D''
MACHINE=3D'powerpc'
MACHINE_ARCH=3D'powerpc'
=
MAKEOBJDIRPREFIX=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys=
/GENERICvtsc-NODBG/modules'
MAKESYSPATH=3D'/usr/src/share/mk'
MAKE_VERSION=3D'20170720'
=
PATH=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/legacy/usr/=
sbin:/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/legacy/usr/bin=
:/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/legacy/bin:/usr/ob=
j/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/sbin:/usr/obj/powerpcv=
tsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bi=
n'
SRCTOP=3D'/usr/src'
=
OBJTOP=3D'/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvt=
sc-NODBG/modules/usr/src'
.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.powerpc-clang-bootstrap.amd64-host =
/usr/src/share/mk/bsd.mkopt.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/sys/modules/agp/Makefile =
/usr/src/share/mk/bsd.kmod.mk /usr/src/sys/conf/kmod.mk =
/usr/src/share/mk/bsd.init.mk /usr/src/share/mk/bsd.opts.mk =
/usr/src/share/mk/bsd.cpu.mk /usr/src/share/mk/local.init.mk =
/usr/src/share/mk/src.init.mk /usr/src/sys/modules/agp/../Makefile.inc =
/usr/src/share/mk/bsd.own.mk /usr/src/share/mk/bsd.compiler.mk =
/usr/src/share/mk/bsd.linker.mk /usr/src/sys/conf/kern.opts.mk =
/usr/src/sys/conf/config.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/sys/conf/kern.mk'
.PATH=3D'. /usr/src/sys/modules/agp /usr/src/sys/dev/agp =
/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG'
1 error



Build details:

The build was a amd64 -> powerpc cross build:

# more =
~/sys_build_scripts.amd64-host/make_powerpcvtsc_nodebug_clang_bootstrap-am=
d64-host.sh=20
kldload -n filemon && \
script =
~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd6=
4-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.powerpc-clang-bootstrap.amd64-h=
ost" \
WITH_META_MODE=3Dyes \
MAKEOBJDIRPREFIX=3D"/usr/obj/powerpcvtsc_clang" \
make $*


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


# more ~/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host
TO_TYPE=3Dpowerpc
#
KERNCONF=3DGENERICvtsc-NODBG
TARGET=3D${TO_TYPE}
.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
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
WITHOUT_LLD=3D
# lldb requires missing atomic 8-byte operations for powerpc (non-64)
WITHOUT_LLDB=3D
#
WITH_BOOT=3D
WITHOUT_LIB32=3D
#
WITHOUT_GCC_BOOTSTRAP=3D
WITHOUT_GCC=3D
WITHOUT_GCC_IS_CC=3D
WITHOUT_GNUCXX=3D
#
NO_WERROR=3D
#
# Use WERROR to avoid stopping at the likes of:
# error: implicit conversion from 'int' to 'int8_t' (aka 'signed char') =
changes value from 128 to -128 [-Werror,-Wconstant-conversion]
WERROR=3D
MALLOC_PRODUCTION=3D
#
WITH_REPRODUCIBLE_BUILD=3D
WITH_DEBUG_FILES=3D


# more /usr/src/sys/powerpc/conf/GENERICvtsc-NODBG
#
# GENERIC -- Custom configuration for the powerpc/powerpc
#

include "GENERIC"

ident   GENERICvtsc-NODBG

makeoptions     DEBUG=3D-g                # Build kernel with gdb(1) =
debug symbols

nooptions       PS3                     # Sony Playstation 3             =
  HACK!!! to allow sc

options         KDB                     # Enable kernel debugger support

options         ALT_BREAK_TO_DEBUGGER
options         BREAK_TO_DEBUGGER

# For minimum debugger support (stable branch) use:
options         KDB_TRACE               # Print a stack trace for a =
panic
options         DDB                     # Enable the kernel debugger
options         GDB                     # HACK!!! ...

# Extra stuff:
#options        VERBOSE_SYSINIT         # Enable verbose sysinit =
messages
#options        BOOTVERBOSE=3D1
#options        BOOTHOWTO=3DRB_VERBOSE
#options        KTR
#options        KTR_MASK=3DKTR_TRAP
##options       KTR_CPUMASK=3D0xF
#options        KTR_VERBOSE

# HACK!!! to allow sc for 2560x1440 display on Radeon X1950 that vt =
historically mishandled during booting
device          sc
#device                 kbdmux          # HACK: already listed by vt
options         SC_OFWFB        # OFW frame buffer
options         SC_DFLT_FONT    # compile font in
makeoptions     SC_DFLT_FONT=3Dcp437


# Disable any extra checking for. . .
nooptions       DEADLKRES               # Enable the deadlock resolver
nooptions       INVARIANTS              # Enable calls of extra sanity =
checking
nooptions       INVARIANT_SUPPORT       # Extra sanity checks of =
internal structures, required by INVARIANTS
nooptions       WITNESS                 # Enable checks to detect =
deadlocks and cycles
nooptions       WITNESS_SKIPSPIN        # Don't run witness on spinlocks =
for speed
nooptions       DIAGNOSTIC
nooptions       MALLOC_DEBUG_MAXZONES   # Separate malloc(9) zones



=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?0F28DDCB-1B8C-465E-99C9-EB1BBD7A520F>