Use fixed symbol rename list
To keep things from changing out from under us as we slowly replace bits of the SDK libs, changing Makefiles to not auto-generate the list of symbols to rename, but always use the same list every time.
This commit is contained in:
parent
2fe1b7a00d
commit
8b8f7c9de4
2 changed files with 842 additions and 19 deletions
22
common.mk
22
common.mk
|
|
@ -280,25 +280,9 @@ $(BUILD_DIR)sdklib/%_stage1.a: $(ROOT)lib/%.a $(BUILD_DIR)sdklib/%.remove | $(BU
|
|||
$(Q) cat $< > $@
|
||||
$(Q) $(AR) d $@ @$(word 2,$^)
|
||||
|
||||
# Generate a regex to match symbols we don't want to rename, listed in
|
||||
# symbols_norename.txt
|
||||
$(BUILD_DIR)sdklib/norename.match: $(ROOT)lib/symbols_norename.txt | $(BUILD_DIR)sdklib
|
||||
cat $< | grep -v "^#" | sed ':begin;$!N;s/\n/\\|/;tbegin' > $@
|
||||
|
||||
# Stage 2: Build a list of defined symbols per library, renamed with sdk_ prefix
|
||||
$(BUILD_DIR)sdklib/%.rename: $(BUILD_DIR)sdklib/%_stage1.a $(BUILD_DIR)sdklib/norename.match
|
||||
@echo "SDK processing stage 2: Building symbol list for $< -> $@"
|
||||
$(Q) $(OBJDUMP) -t $< | grep ' g ' \
|
||||
| sed -r 's/^.+ ([^ ]+)$$/\1 sdk_\1/' \
|
||||
| grep -v `cat $(BUILD_DIR)sdklib/norename.match` > $@
|
||||
|
||||
# Build a master list of all SDK-defined symbols to rename across all libraries
|
||||
$(BUILD_DIR)sdklib/allsymbols.rename: $(patsubst %.a,%.rename,$(SDK_PROCESSED_LIBS))
|
||||
cat $^ > $@
|
||||
|
||||
# Stage 3: Redefine all SDK symbols as sdk_, weaken all symbols.
|
||||
$(BUILD_DIR)sdklib/%.a: $(BUILD_DIR)sdklib/%_stage1.a $(BUILD_DIR)sdklib/allsymbols.rename
|
||||
@echo "SDK processing stage 3: Renaming symbols in SDK library $< -> $@"
|
||||
# Stage 2: Redefine all SDK symbols as sdk_, weaken all symbols.
|
||||
$(BUILD_DIR)sdklib/%.a: $(BUILD_DIR)sdklib/%_stage1.a $(ROOT)lib/allsymbols.rename
|
||||
@echo "SDK processing stage 2: Renaming symbols in SDK library $< -> $@"
|
||||
$(Q) $(OBJCOPY) --redefine-syms $(word 2,$^) --weaken $< $@
|
||||
|
||||
# include "dummy component" for the 'program' object files, defined in the Makefile
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue