mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 06:29:19 +00:00
use genld.sh to generate link_ram.ld
Use genld.sh instead of config.h to generate link_ram.ld. It can avoid the conflicts of the syntax between ld script and C. V1->V2: change the deps name to config, Tracked-On: #861 Signed-off-by: Huihuang Shi <huihuang.shi@intel.com> reviewed-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
parent
203016b406
commit
8ccaf3c3e8
@ -34,6 +34,9 @@ include $(BASEDIR)/../scripts/deps.mk
|
|||||||
|
|
||||||
include scripts/kconfig/kconfig.mk
|
include scripts/kconfig/kconfig.mk
|
||||||
|
|
||||||
|
LD_IN_TOOL = scripts/genld.sh
|
||||||
|
BASH = $(shell which bash)
|
||||||
|
|
||||||
CFLAGS += -Wall -W
|
CFLAGS += -Wall -W
|
||||||
CFLAGS += -ffunction-sections -fdata-sections
|
CFLAGS += -ffunction-sections -fdata-sections
|
||||||
CFLAGS += -fshort-wchar -ffreestanding
|
CFLAGS += -fshort-wchar -ffreestanding
|
||||||
@ -248,7 +251,7 @@ $(HV_OBJDIR)/$(HV_FILE).bin: $(HV_OBJDIR)/$(HV_FILE).out
|
|||||||
$(OBJCOPY) -O binary $< $(HV_OBJDIR)/$(HV_FILE).bin
|
$(OBJCOPY) -O binary $< $(HV_OBJDIR)/$(HV_FILE).bin
|
||||||
|
|
||||||
$(HV_OBJDIR)/$(HV_FILE).out: $(C_OBJS) $(S_OBJS)
|
$(HV_OBJDIR)/$(HV_FILE).out: $(C_OBJS) $(S_OBJS)
|
||||||
$(CC) -E -x c $(patsubst %, -I%, $(INCLUDE_PATH)) $(ARCH_LDSCRIPT_IN) | grep -v '^#' > $(ARCH_LDSCRIPT)
|
${BASH} ${LD_IN_TOOL} $(ARCH_LDSCRIPT_IN) $(ARCH_LDSCRIPT) ${HV_OBJDIR}/.config
|
||||||
$(CC) -Wl,-Map=$(HV_OBJDIR)/$(HV_FILE).map -o $@ $(LDFLAGS) $(ARCH_LDFLAGS) -T$(ARCH_LDSCRIPT) $^
|
$(CC) -Wl,-Map=$(HV_OBJDIR)/$(HV_FILE).map -o $@ $(LDFLAGS) $(ARCH_LDFLAGS) -T$(ARCH_LDSCRIPT) $^
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
#include "config.h"
|
|
||||||
|
|
||||||
ENTRY(cpu_primary_start_32)
|
ENTRY(cpu_primary_start_32)
|
||||||
|
|
||||||
MEMORY
|
MEMORY
|
||||||
|
13
hypervisor/scripts/genld.sh
Executable file
13
hypervisor/scripts/genld.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
in=$1
|
||||||
|
out=$2
|
||||||
|
config=$3
|
||||||
|
|
||||||
|
cp $in $out
|
||||||
|
grep -v "^#" ${config} | while read line; do
|
||||||
|
IFS='=' read -ra arr <<<"$line"
|
||||||
|
field=${arr[0]}
|
||||||
|
value=${arr[1]}
|
||||||
|
sed -i "s/\b$field\b/$value/g" $out
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user