Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kirkstone mitigations #52

Open
wants to merge 5 commits into
base: kirkstone-next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ Signed-off-by: David Holsgrove <[email protected]>
3 files changed, 32 insertions(+), 2 deletions(-)
create mode 100644 libgloss/config/microblaze.mt

diff --git a/libgloss/config/microblaze.mt b/libgloss/config/microblaze.mt
new file mode 100644
index 000000000..e8fb922dd
Index: newlib-4.2.0.20211231/libgloss/config/microblaze.mt
===================================================================
--- /dev/null
+++ b/libgloss/config/microblaze.mt
+++ newlib-4.2.0.20211231/libgloss/config/microblaze.mt
@@ -0,0 +1,30 @@
+#
+# Match default.mt to compile generic objects but continue building
Expand Down Expand Up @@ -60,11 +59,11 @@ index 000000000..e8fb922dd
+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $?
+write.o: ${srcdir}/../write.c
+ $(CC) $(CFLAGS_FOR_TARGET) -O2 $(INCLUDES) -c $(CFLAGS) $?
diff --git a/libgloss/microblaze/configure b/libgloss/microblaze/configure
index 9b2bc7ab4..01f0fb29d 100644
--- a/libgloss/microblaze/configure
+++ b/libgloss/microblaze/configure
@@ -2020,7 +2020,7 @@ LIB_AM_PROG_AS
Index: newlib-4.2.0.20211231/libgloss/microblaze/configure
===================================================================
--- newlib-4.2.0.20211231.orig/libgloss/microblaze/configure
+++ newlib-4.2.0.20211231/libgloss/microblaze/configure
@@ -2550,7 +2550,7 @@ test "${CCASFLAGS+set}" = set || CCASFLA


host_makefile_frag=${srcdir}/../config/default.mh
Expand All @@ -73,10 +72,10 @@ index 9b2bc7ab4..01f0fb29d 100644

host_makefile_frag_path=$host_makefile_frag

diff --git a/libgloss/microblaze/configure.in b/libgloss/microblaze/configure.in
index 77aa769d4..5d179fdfc 100644
--- a/libgloss/microblaze/configure.in
+++ b/libgloss/microblaze/configure.in
Index: newlib-4.2.0.20211231/libgloss/microblaze/configure.ac
===================================================================
--- newlib-4.2.0.20211231.orig/libgloss/microblaze/configure.ac
+++ newlib-4.2.0.20211231/libgloss/microblaze/configure.ac
@@ -35,7 +35,7 @@ LIB_AM_PROG_AS
AC_SUBST(bsp_prefix)

Expand All @@ -86,6 +85,3 @@ index 77aa769d4..5d179fdfc 100644

dnl We have to assign the same value to other variables because autoconf
dnl doesn't provide a mechanism to substitute a replacement keyword with
--
2.17.1

Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,17 @@ Signed-off-by: David Holsgrove <[email protected]>
newlib/libc/include/stdio.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index ab18806e3..8240dd8ab 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -245,6 +245,9 @@ int sprintf (char *__restrict, const char *__restrict, ...)
Index: newlib-4.2.0.20211231/newlib/libc/include/stdio.h
===================================================================
--- newlib-4.2.0.20211231.orig/newlib/libc/include/stdio.h
+++ newlib-4.2.0.20211231/newlib/libc/include/stdio.h
@@ -245,6 +245,9 @@ int sprintf (char *__restrict, const cha
_ATTRIBUTE ((__format__ (__printf__, 2, 3)));
int remove (const char *);
int rename (const char *, const char *);
+void xil_printf (const char*, ...);
+void putnum (unsigned int );
+void print (const char* );
#ifdef _COMPILING_NEWLIB
#ifdef _LIBC
int _rename (const char *, const char *);
#endif
--
2.17.1

6 changes: 6 additions & 0 deletions meta-xilinx-core/conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ PREFERRED_VERSION_arm-trusted-firmware ?= "2.6-xilinx-${XILINX_RELEASE_VERSION}%
PREFERRED_VERSION_u-boot-xlnx ?= "v2021.01-xilinx-${XILINX_RELEASE_VERSION}%"
PREFERRED_VERSION_pmu-rom-native ?= "${@d.getVar("XILINX_RELEASE_VERSION").replace('v','')}"
PREFERRED_VERSION_linux-xlnx ?= "${@'5.15.19' if d.getVar("XILINX_RELEASE_VERSION") == 'v2022.1' else '5.15.36'}%"

# Weak defaults to avoid seeing redundant multiple provider notices
PREFERRED_PROVIDER_nativesdk-qemu ??= "nativesdk-qemu"
PREFERRED_PROVIDER_qemu-helper-native ??= "qemu-helper-native"
PREFERRED_PROVIDER_qemu-native ??= "qemu-native"
PREFERRED_PROVIDER_qemu-system-native ??= "qemu-system-native"
3 changes: 3 additions & 0 deletions meta-xilinx-standalone/classes/xlnx-embeddedsw.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ REPO ??= "git://github.com/Xilinx/embeddedsw.git;protocol=https"

ESW_BRANCH[2022.1] = "xlnx_rel_v2022.1_update"
ESW_BRANCH[2022.2] = "xlnx_rel_v2022.2"
ESW_BRANCH[git] = "master-next"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? Shouldn't this be just "master"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I merely restore the line verbatim which was removed in 1243552 causing breakage described in the commit message. I did not want to introduce further modifications as my motivation was to just mitigate the bitbake parse error.

BRANCH ??= "${@d.getVarFlag('ESW_BRANCH', d.getVar('ESW_VER')) or '${ESW_VER}'}"

ESW_REV[2022.1] = "56d94a506fd9f80949f4cff08e13015928603f01"
ESW_REV[2022.2] = "5330a64c8efd14f0eef09befdbb8d3d738c33ec2"
ESW_REV[git] = "7ec60e1c0e25bfa9c5e8c77d6d063876f6670770"
SRCREV ??= "${@d.getVarFlag('ESW_REV', d.getVar('ESW_VER')) or '${AUTOREV}'}"

EMBEDDEDSW_BRANCHARG ?= "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH') != '']}"
Expand All @@ -17,6 +19,7 @@ EMBEDDEDSW_SRCURI ?= "${REPO};${EMBEDDEDSW_BRANCHARG}"
LICENSE = "MIT"
LIC_FILES_CHKSUM[xlnx_rel_v2022.1_update] = 'e62cb7a722c4430999e0a55a7234035d'
LIC_FILES_CHKSUM[xlnx_rel_v2022.2] = 'ce611484168a6000bd35df68fc4f4290'
LIC_FILES_CHKSUM[master-next] = '7b5fc0b2a22e2882e1506436b3293e5d'
LIC_FILES_CHKSUM ??= "file://license.txt;md5=${@d.getVarFlag('LIC_FILES_CHKSUM', d.getVar('BRANCH')) or '0'}"

SRC_URI = "${EMBEDDEDSW_SRCURI}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From 81b137e9b313d828cba8212d17c4d6a3265f565e Mon Sep 17 00:00:00 2001
From: Niko Mauno <[email protected]>
Date: Mon, 24 Apr 2023 05:00:00 +0000
Subject: [PATCH] Avoid race induced build failure

Limit number of concurrent jobs to one in order to mitigate the
non-propagation of -j1 option from PARALLEL_MAKE directive which
helps us to avoid the following kind of build failure:

| .../pmu-firmware/2022.2+gitAUTOINC+5330a64c8e-r0/recipe-sysroot-native/usr/bin/microblazeel-xilinx-elf/../../libexec/microblazeel-xilinx-elf/gcc/microblazeel-xilinx-elf/11.3.0/ar: xdppsu_edid.o: No such file or directory
| make[3]: *** [Makefile:31: dppsu_libs] Error 1
| make[2]: *** [Makefile:48: psu_pmu_0/libsrc/dppsu/src/make.libs] Error 2

Upstream-Status: Pending

Signed-off-by: Niko Mauno <[email protected]>
---

diff --git a/lib/sw_apps/zynqmp_pmufw/misc/Makefile b/lib/sw_apps/zynqmp_pmufw/misc/Makefile
index a773498512..4528600745 100644
--- a/lib/sw_apps/zynqmp_pmufw/misc/Makefile
+++ b/lib/sw_apps/zynqmp_pmufw/misc/Makefile
@@ -17,7 +19,7 @@ endif

all:
$(MAKE) --no-print-directory seq_libs
- $(MAKE) -j --no-print-directory par_libs
+ $(MAKE) -j1 --no-print-directory par_libs
$(MAKE) --no-print-directory archive
@echo 'Finished building libraries'

--
2.20.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Prevent makefile from calling copy_bsp.sh

If we call copy_bsp.sh we will undo any manual compliation steps we
have already done. Avoid this.

YP integration specific

Signed-off-by: Mark Hatle <[email protected]>

diff --git a/lib/sw_apps/versal_plm/src/versal/Makefile b/lib/sw_apps/versal_plm/src/versal/Makefile
index d65e4c1ae5..7c05e54b43 100644
--- a/lib/sw_apps/versal_plm/src/versal/Makefile
+++ b/lib/sw_apps/versal_plm/src/versal/Makefile
@@ -32,8 +32,8 @@ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)

$(LIBS):
- echo "Copying BSP files"
- ../../misc/versal/copy_bsp.sh
+ #echo "Copying BSP files"
+ #../../misc/versal/copy_bsp.sh
echo "Compiling bsp"
$(MAKE) -C ../../misc/versal/versal_plm_bsp

diff --git a/lib/sw_apps/versal_psmfw/src/versal/Makefile b/lib/sw_apps/versal_psmfw/src/versal/Makefile
index 1572bbbca9..ce182acaa7 100644
--- a/lib/sw_apps/versal_psmfw/src/versal/Makefile
+++ b/lib/sw_apps/versal_psmfw/src/versal/Makefile
@@ -34,8 +34,8 @@ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)

$(LIBS):
- echo "Copying BSP files"
- ../../misc/copy_bsp.sh
+ #echo "Copying BSP files"
+ #../../misc/copy_bsp.sh
echo "Compiling bsp"
$(MAKE) -C ../../misc/versal_psmfw_bsp

diff --git a/lib/sw_apps/zynqmp_pmufw/src/Makefile b/lib/sw_apps/zynqmp_pmufw/src/Makefile
index 1750c0a329..17f6a545ea 100644
--- a/lib/sw_apps/zynqmp_pmufw/src/Makefile
+++ b/lib/sw_apps/zynqmp_pmufw/src/Makefile
@@ -28,8 +28,8 @@ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)

$(LIBS):
- echo "Copying BSP files"
- ../misc/copy_bsp.sh
+ #echo "Copying BSP files"
+ #../misc/copy_bsp.sh
echo "Compiling bsp"
$(MAKE) -C ../misc/zynqmp_pmufw_bsp

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require fsbl-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://fsbl-fixups.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require fsbl-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://fsbl-fixups.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require plm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-versal_fw-Fixup-core-makefiles.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require plm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-versal_fw-Fixup-core-makefiles.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require plm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
"

do_configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require pmu-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-zynqmp_pmufw-Fixup-core-makefiles.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ require pmu-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-zynqmp_pmufw-Fixup-core-makefiles.patch \
file://0002-Avoid-race-induced-build-failure.patch \
"

EXTRA_COMPILER_FLAGS = "-ffunction-sections -fdata-sections -Wall -Wextra -Os -flto -ffat-lto-objects"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require pmu-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
"

do_configure() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require psm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-versal_fw-Fixup-core-makefiles.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ require psm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
file://0001-versal_fw-Fixup-core-makefiles.patch \
"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require psm-firmware.inc
FILESPATH .= ":${FILE_DIRNAME}/embeddedsw"

SRC_URI += " \
file://makefile-skip-copy_bsp.sh.patch \
file://${ESW_VER}/makefile-skip-copy_bsp.sh.patch \
"

do_configure() {
Expand Down