Remove linux features in build process that we do not support
Lots of code that is not being used by Zephyr but makes debugging and find issues related to zephyr very difficult. Change-Id: If8f6515d68f64b03cc881a9c3cde48c0451fe3b5 Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
0c39517251
commit
c0078cfb9b
2 changed files with 6 additions and 104 deletions
|
@ -2,22 +2,14 @@
|
|||
#
|
||||
# link the kernel
|
||||
#
|
||||
# The kernel is linked from the objects selected by $(KBUILD_ZEPHYR_INIT) and
|
||||
# $(KBUILD_ZEPHYR_MAIN). Most are built-in.o files from top-level directories
|
||||
# The kernel is linked from the objects selected by $(KBUILD_ZEPHYR_MAIN).
|
||||
# Most are built-in.o files from top-level directories
|
||||
# in the kernel tree, others are specified in arch/$(ARCH)/Makefile.
|
||||
# Ordering when linking is important, and $(KBUILD_ZEPHYR_INIT) must be first.
|
||||
#
|
||||
# microkernel/nanokernel
|
||||
# ^
|
||||
# |
|
||||
# +-< $(KBUILD_ZEPHYR_INIT)
|
||||
# | +--< init/version.o + more
|
||||
# |
|
||||
# +--< $(KBUILD_ZEPHYR_MAIN)
|
||||
# | +--< drivers/built-in.o mm/built-in.o + more
|
||||
# |
|
||||
# +-< ${kallsymso} (see description in KALLSYMS section)
|
||||
#
|
||||
# +--< drivers/built-in.o + more
|
||||
|
||||
# Error out on error
|
||||
set -e
|
||||
|
@ -121,36 +113,6 @@ zephyr_bin_strip()
|
|||
}
|
||||
|
||||
|
||||
# Create ${2} .o file with all symbols from the ${1} object file
|
||||
kallsyms()
|
||||
{
|
||||
info KSYM ${2}
|
||||
local kallsymopt;
|
||||
|
||||
if [ -n "${CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX}" ]; then
|
||||
kallsymopt="${kallsymopt} --symbol-prefix=_"
|
||||
fi
|
||||
|
||||
if [ -n "${CONFIG_KALLSYMS_ALL}" ]; then
|
||||
kallsymopt="${kallsymopt} --all-symbols"
|
||||
fi
|
||||
|
||||
if [ -n "${CONFIG_ARM}" ] && [ -n "${CONFIG_PAGE_OFFSET}" ]; then
|
||||
kallsymopt="${kallsymopt} --page-offset=$CONFIG_PAGE_OFFSET"
|
||||
fi
|
||||
|
||||
if [ -n "${CONFIG_X86_64}" ]; then
|
||||
kallsymopt="${kallsymopt} --absolute-percpu"
|
||||
fi
|
||||
|
||||
local aflags="${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} \
|
||||
${NOSTDINC_FLAGS} ${ZEPHYRINCLUDE} ${KBUILD_CPPFLAGS}"
|
||||
|
||||
${NM} -n ${1} | \
|
||||
scripts/kallsyms ${kallsymopt} | \
|
||||
${CC} ${aflags} -c -o ${2} -x assembler-with-cpp -
|
||||
}
|
||||
|
||||
# Create map file with all symbols from ${1}
|
||||
# See mksymap for additional details
|
||||
mksysmap()
|
||||
|
@ -169,7 +131,6 @@ cleanup()
|
|||
{
|
||||
rm -f .old_version
|
||||
rm -f .tmp_System.map
|
||||
rm -f .tmp_kallsyms*
|
||||
rm -f .tmp_version
|
||||
rm -f .tmp_*
|
||||
rm -f System.map
|
||||
|
@ -224,51 +185,6 @@ else
|
|||
expr 0$(cat .old_version) + 1 >.version;
|
||||
fi;
|
||||
|
||||
kallsymso=""
|
||||
kallsyms_zephyr=""
|
||||
if [ -n "${CONFIG_KALLSYMS}" ]; then
|
||||
|
||||
# kallsyms support
|
||||
# Generate section listing all symbols and add it into the kernel
|
||||
# It's a three step process:
|
||||
# 1) Link .tmp_${KERNEL_NAME} so it has all symbols and sections,
|
||||
# but __kallsyms is empty.
|
||||
# Running kallsyms on that gives us .tmp_kallsyms1.o with
|
||||
# the right size
|
||||
# 2) Link .tmp_${KERNEL_NAME}2 so it now has a __kallsyms section of
|
||||
# the right size, but due to the added section, some
|
||||
# addresses have shifted.
|
||||
# From here, we generate a correct .tmp_kallsyms2.o
|
||||
# 2a) We may use an extra pass as this has been necessary to
|
||||
# woraround some alignment related bugs.
|
||||
# KALLSYMS_EXTRA_PASS=1 is used to trigger this.
|
||||
# 3) The correct ${kallsymso} is linked into the final kernel.
|
||||
#
|
||||
# a) Verify that the System.map matches the map from
|
||||
# ${kallsymso}.
|
||||
|
||||
kallsymso=.tmp_kallsyms2.o
|
||||
kallsyms_zephyr=.tmp_${KERNEL_NAME}2
|
||||
|
||||
# step 1
|
||||
zephyr_link "" .tmp_${KERNEL_NAME}1
|
||||
kallsyms .tmp_${KERNEL_NAME}1 .tmp_kallsyms1.o
|
||||
|
||||
# step 2
|
||||
zephyr_link .tmp_kallsyms1.o .tmp_${KERNEL_NAME}2
|
||||
kallsyms .tmp_${KERNEL_NAME}2 .tmp_kallsyms2.o
|
||||
|
||||
# step 2a
|
||||
if [ -n "${KALLSYMS_EXTRA_PASS}" ]; then
|
||||
kallsymso=.tmp_kallsyms3.o
|
||||
kallsyms_zephyr=.tmp_${KERNEL_NAME}3
|
||||
|
||||
zephyr_link .tmp_kallsyms2.o .tmp_${KERNEL_NAME}3
|
||||
|
||||
kallsyms .tmp_${KERNEL_NAME}3 .tmp_kallsyms3.o
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "${SRCARCH}" = "x86" ]; then
|
||||
info SIDT ${KERNEL_NAME}.elf
|
||||
gen_idt ${KERNEL_NAME}.elf staticIdt.o int_vector_alloc irq_int_vector_map
|
||||
|
@ -288,17 +204,5 @@ fi
|
|||
info SYSMAP System.map
|
||||
mksysmap ${KERNEL_NAME}.elf System.map
|
||||
|
||||
# step a (see comment above)
|
||||
if [ -n "${CONFIG_KALLSYMS}" ]; then
|
||||
mksysmap ${kallsyms_zephyr} .tmp_System.map
|
||||
|
||||
if ! cmp -s System.map .tmp_System.map; then
|
||||
echo >&2 Inconsistent kallsyms data
|
||||
echo >&2 Try "make KALLSYMS_EXTRA_PASS=1" as a workaround
|
||||
cleanup
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# We made a new kernel - delete old version file
|
||||
rm -f .old_version
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue