[Skiboot] [PATCH 2/2] Always build a skiboot-nofsp.lid

Stewart Smith stewart at linux.ibm.com
Mon Jul 15 12:07:14 AEST 2019


This means that we never re-introduce FSP dependencies that would cause
a link failure. Due to building in parallel, this should be about a zero
cost to build time too.

Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
 Makefile.main          | 32 ++++++++++++++++++++++++++++++--
 asm/real_map-nofsp.S   | 20 ++++++++++++++++++++
 platforms/Makefile.inc |  3 +++
 3 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 asm/real_map-nofsp.S

diff --git a/Makefile.main b/Makefile.main
index 2a8b48986957..bffe6209ecaf 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -215,6 +215,7 @@ include/asm-offsets.h: asm/asm-offsets.s
 	$(call Q,GN, $(SRC)/make_offsets.sh $< >$@, $@)
 
 TARGET = skiboot
+TARGET_NOFSP = skiboot-nofsp
 
 include $(SRC)/asm/Makefile.inc
 include $(SRC)/core/Makefile.inc
@@ -249,12 +250,20 @@ pflash-coverity:
 
 all: $(SUBDIRS) $(TARGET).lid $(TARGET).lid.xz $(TARGET).map extract-gcov
 all: $(TARGET).lid.stb $(TARGET).lid.xz.stb
+all: $(TARGET_NOFSP).lid $(TARGET_NOFSP).lid.xz $(TARGET_NOFSP).map $(TARGET_NOFSP).lid.xz.stb
+
+BASE_OBJS := $(ASM) $(CORE) $(HW) $(LIBFDT) $(LIBXZ) $(LIBFLASH) $(LIBSTB)
+BASE_OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) $(LIBPORE)
+OBJS += $(BASE_OBJS) $(PLATFORMS)
+NO_FSP_OBJS += $(BASE_OBJS) $(NO_FSP_PLATFORMS)
 
-OBJS := $(ASM) $(CORE) $(HW) $(PLATFORMS) $(LIBFDT) $(LIBXZ) $(LIBFLASH) $(LIBSTB)
-OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) $(LIBPORE)
 OBJS_NO_VER = $(OBJS)
 ALL_OBJS = $(OBJS) version.o
 
+NO_FSP_ALL_OBJS = $(NO_FSP_OBJS) version.o
+NO_FSP_ALL_OBJS_1 = $(TARGET_NOFSP).tmp.a asm/dummy_map.o
+NO_FSP_ALL_OBJS_2 = $(TARGET_NOFSP).tmp.a asm/real_map-nofsp.o
+
 ALL_OBJS_1 = $(TARGET).tmp.a asm/dummy_map.o
 ALL_OBJS_2 = $(TARGET).tmp.a asm/real_map.o
 
@@ -270,18 +279,37 @@ $(TARGET).lid.stb: $(TARGET).lid libstb/create-container
 $(TARGET).lid.xz.stb: $(TARGET).lid.xz libstb/create-container
 	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
 
+$(TARGET_NOFSP).lid.stb: $(TARGET_NOFSP).lid libstb/create-container
+	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
+
+$(TARGET_NOFSP).lid.xz.stb: $(TARGET_NOFSP).lid.xz libstb/create-container
+	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
+
 $(TARGET).tmp.a: $(ALL_OBJS)
 	@rm -f $(TARGET).tmp.a
 	$(call Q,AR, $(AR) rcsTPD $@ $(ALL_OBJS), $@)
 
+$(TARGET_NOFSP).tmp.a: $(NO_FSP_ALL_OBJS)
+	@rm -f $(TARGET_NOFSP).tmp.a
+	$(call Q,AR, $(AR) rcsTPD $@ $(NO_FSP_ALL_OBJS), $@)
+
 $(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL)
 	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_1), $@)
 
+$(TARGET_NOFSP).tmp.elf: $(NO_FSP_ALL_OBJS_1) $(TARGET).lds $(KERNEL)
+	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(NO_FSP_ALL_OBJS_1), $@)
+
 asm/real_map.o : $(TARGET).tmp.map
 
+asm/real_map-nofsp.o : $(TARGET_NOFSP).tmp.map
+
 $(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL)
 	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_2), $@)
 
+$(TARGET_NOFSP).elf: $(NO_FSP_ALL_OBJS_2) $(TARGET).lds $(KERNEL)
+	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(NO_FSP_ALL_OBJS_2), $@)
+
+
 $(SUBDIRS):
 	$(call Q,MKDIR,mkdir -p $@, $@)
 
diff --git a/asm/real_map-nofsp.S b/asm/real_map-nofsp.S
new file mode 100644
index 000000000000..4ab9c229fa69
--- /dev/null
+++ b/asm/real_map-nofsp.S
@@ -0,0 +1,20 @@
+/* Copyright 2013-2014 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+	.section ".sym_map","a"
+	.incbin "skiboot-nofsp.tmp.map"
+ 
diff --git a/platforms/Makefile.inc b/platforms/Makefile.inc
index 3269532a3bdc..85c9f1899ac0 100644
--- a/platforms/Makefile.inc
+++ b/platforms/Makefile.inc
@@ -2,6 +2,7 @@ PLATDIR = platforms
 
 SUBDIRS += $(PLATDIR)
 PLATFORMS = $(PLATDIR)/built-in.a
+NO_FSP_PLATFORMS = $(PLATDIR)/nofsp-built-in.a
 
 include $(SRC)/$(PLATDIR)/ibm-fsp/Makefile.inc
 include $(SRC)/$(PLATDIR)/rhesus/Makefile.inc
@@ -10,3 +11,5 @@ include $(SRC)/$(PLATDIR)/mambo/Makefile.inc
 include $(SRC)/$(PLATDIR)/qemu/Makefile.inc
 
 $(PLATFORMS): $(IBM_FSP) $(RHESUS) $(ASTBMC) $(MAMBO) $(QEMU)
+
+$(NO_FSP_PLATFORMS): $(RHESUS) $(ASTBMC) $(MAMBO) $(QEMU)
-- 
2.21.0



More information about the Skiboot mailing list