freebsd-dev/sys/conf/Makefile.powerpc
Brandon Bergren ab3f2a3861 Add support for building Book-E kernels with clang/lld.
This involved several changes:

* Since lld does not like text relocations, replace SMP boot page text relocs
in booke/locore.S with position-independent math, and track the virtual base
in the SMP boot page header.

* As some SPRs are interpreted differently on clang due to the way it handles
platform-specific SPRs, switch m*dear and m*esr mnemonics out for regular
m*spr. Add both forms of SPR_DEAR to spr.h so the correct encoding is selected.

* Change some hardcoded 32 bit things in the boot page to be pointer-sized, and
fix alignment.

* Fix 64-bit build of booke/pmap.c when enabling pmap debugging.

Additionally, I took the opportunity to document how the SMP boot page works.

Approved by: jhibbits (mentor)
Differential Revision: https://reviews.freebsd.org/D21999
2019-11-02 21:15:56 +00:00

82 lines
1.6 KiB
Makefile

# Makefile.powerpc -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
# $FreeBSD$
#
# Makefile for FreeBSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/powerpc/conf/``machineid''
# after which you should do
# config machineid
# Generic makefile changes should be made in
# /sys/conf/Makefile.powerpc
# after which config should be rerun for all machines.
#
# Which version of config(8) is required.
%VERSREQ= 600012
STD8X16FONT?= iso
.if !defined(S)
.if exists(./@/.)
S= ./@
.else
S= ../../..
.endif
.endif
LDSCRIPT_NAME?= ldscript.${MACHINE_ARCH}
.include "$S/conf/kern.pre.mk"
INCLUDES+= -I$S/contrib/libfdt
.if "${MACHINE_ARCH}" == "powerpcspe"
# Force __SPE__, since the builtin will be removed later with -mno-spe
CFLAGS+= -mabi=spe -D__SPE__
.endif
CFLAGS+= -msoft-float
CFLAGS.gcc+= -Wa,-many
# Apply compiler-specific DPAA exceptions.
.if "${COMPILER_TYPE}" == "clang"
DPAAWARNFLAGS += \
-Wno-error=parentheses-equality \
-Wno-error=self-assign \
-Wno-error=incompatible-pointer-types-discards-qualifiers \
-Wno-error=non-literal-null-conversion \
-Wno-error=enum-conversion
.elif "${COMPILER_TYPE}" == "gcc" && ${COMPILER_VERSION} >= 50200
DPAAWARNFLAGS += \
-Wno-error=redundant-decls \
-Wno-error=int-in-bool-context
.endif
# Build position-independent kernel
CFLAGS+= -fPIC
LDFLAGS+= -pie
.if !empty(DDB_ENABLED)
CFLAGS+= -fno-omit-frame-pointer
.endif
%BEFORE_DEPEND
%OBJS
%FILES.c
%FILES.s
%FILES.m
%CLEAN
%RULES
.include "$S/conf/kern.post.mk"