Skip to content

Commit

Permalink
mnt_reform2_linux: build initcall table after objects
Browse files Browse the repository at this point in the history
Use 'OBJ_POSTPROC_SRC' hook to generate initcall_table.c

issue genodelabs/genode#5159
  • Loading branch information
ssumpf committed Mar 21, 2024
1 parent 839bf0c commit 6098432
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/drivers/linux_mnt_reform2_drv_target.inc
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,16 @@ endef


# 'module_init' calls should only be in C-sources
WAIT_FOR_OBJECTS = $(addsuffix .o,$(basename $(filter-out initcall_table.c,$(SRC_C))))
INITCALL_OBJECTS = $(addsuffix .o,$(basename $(SRC_C)))

# retrieve 'initptr_*' using nm from object files
INITCALLS = $(sort $(shell $(NM) -U $(WAIT_FOR_OBJECTS) |\
INITCALLS = $(sort $(shell $(NM) --defined-only $(INITCALL_OBJECTS) |\
grep "__initptr" |\
awk '{print $$3}'))

SRC_C += initcall_table.c
OBJ_POSTPROC_SRC += initcall_table.c

initcall_table.c: $(WAIT_FOR_OBJECTS)
initcall_table.c:
$(MSG_CONFIG)$@
@$(call print_file_header,$(shell date +"%F"),$@)
@$(foreach sym,$(INITCALLS),$(call print_declaration,$(sym),$@))
Expand Down

0 comments on commit 6098432

Please sign in to comment.