clang 5 vs. building the head's -r323246 kernel for TARGET_ARCH=powerpc : system ld aborts; other notes

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

clang 5 vs. building the head's -r323246 kernel for TARGET_ARCH=powerpc : system ld aborts; other notes

Mark Millard-2
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 |= AHD_39BIT_ADDRESSING;

        /* Allocate a dmatag for our SCB DMA maps */
        error = 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 = &sb.rx_frames, i = 0; reg <= &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 = &sb.rx_frames, i = 0; reg <= &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 = &sb.tx_frames, i = 0; reg <= &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 = &sb.tx_frames, i = 0; reg <= &sb.tx_mcast_bytes; reg++) {
                                                 ^~~~~~~~~~~~~~~~~
. . .


For the build-stopper there is:

make[4]: stopped in /usr/src/sys/modules/agp
.ERROR_TARGET='agp.ko.full'
.ERROR_META_FILE='/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/modules/usr/src/sys/modules/agp/agp.ko.full.meta'
.MAKE.LEVEL='4'
MAKEFILE=''
.MAKE.MODE='meta missing-filemon=yes missing-meta=yes silent=yes verbose'
_ERROR_CMD='ld -m elf32ppc_fbsd -Bshareable -znotext -d -warn-common  -o agp.ko.full agp.kld;'
.CURDIR='/usr/src/sys/modules/agp'
.MAKE='make'
.OBJDIR='/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/modules/usr/src/sys/modules/agp'
.TARGETS='all'
DESTDIR=''
LD_LIBRARY_PATH=''
MACHINE='powerpc'
MACHINE_ARCH='powerpc'
MAKEOBJDIRPREFIX='/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/modules'
MAKESYSPATH='/usr/src/share/mk'
MAKE_VERSION='20170720'
PATH='/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/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/sbin:/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/tmp/usr/bin:/sbin:/bin:/usr/sbin:/usr/bin'
SRCTOP='/usr/src'
OBJTOP='/usr/obj/powerpcvtsc_clang/powerpc.powerpc/usr/src/sys/GENERICvtsc-NODBG/modules/usr/src'
.MAKE.MAKEFILES='/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='. /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-amd64-host.sh
kldload -n filemon && \
script ~/sys_typescripts/typescript_make_powerpcvtsc_nodebug_clang_bootstrap-amd64-host-$(date +%Y-%m-%d:%H:%M:%S) \
env __MAKE_CONF="/root/src.configs/make.conf" SRCCONF="/dev/null" SRC_ENV_CONF="/root/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host" \
WITH_META_MODE=yes \
MAKEOBJDIRPREFIX="/usr/obj/powerpcvtsc_clang" \
make $*


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


# more ~/src.configs/src.conf.powerpc-clang-bootstrap.amd64-host
TO_TYPE=powerpc
#
KERNCONF=GENERICvtsc-NODBG
TARGET=${TO_TYPE}
.if ${.MAKE.LEVEL} == 0
TARGET_ARCH=${TO_TYPE}
.export TARGET_ARCH
.endif
#
WITH_CROSS_COMPILER=
WITHOUT_SYSTEM_COMPILER=
#
WITH_LIBCPLUSPLUS=
WITH_BINUTILS_BOOTSTRAP=
WITH_ELFTOOLCHAIN_BOOTSTRAP=
WITH_CLANG_BOOTSTRAP=
WITH_CLANG=
WITH_CLANG_IS_CC=
WITH_CLANG_FULL=
WITH_CLANG_EXTRAS=
WITHOUT_LLD=
# lldb requires missing atomic 8-byte operations for powerpc (non-64)
WITHOUT_LLDB=
#
WITH_BOOT=
WITHOUT_LIB32=
#
WITHOUT_GCC_BOOTSTRAP=
WITHOUT_GCC=
WITHOUT_GCC_IS_CC=
WITHOUT_GNUCXX=
#
NO_WERROR=
#
# 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=
MALLOC_PRODUCTION=
#
WITH_REPRODUCIBLE_BUILD=
WITH_DEBUG_FILES=


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

include "GENERIC"

ident   GENERICvtsc-NODBG

makeoptions     DEBUG=-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=1
#options        BOOTHOWTO=RB_VERBOSE
#options        KTR
#options        KTR_MASK=KTR_TRAP
##options       KTR_CPUMASK=0xF
#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=cp437


# 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



===
Mark Millard
markmi at dsl-only.net

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-toolchain
To unsubscribe, send any mail to "[hidden email]"