From 3b0d3c2004e97bbbcc1ae17a4053f1913b01991f Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Sun, 9 Jul 2023 22:22:11 -0700 Subject: build: Force inclusion of all symbols from extension.o in spike-main The --extension feature requires that all symbols in extension.o be available when the libraries are dynamically loaded by dlopen. Prepending extension.o to the linker command adds the otherwise omitted symbols to spike's dynamic symbol table. --- spike_main/spike_main.mk.in | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spike_main') diff --git a/spike_main/spike_main.mk.in b/spike_main/spike_main.mk.in index 25a7a6c..c842c4e 100644 --- a/spike_main/spike_main.mk.in +++ b/spike_main/spike_main.mk.in @@ -14,3 +14,7 @@ spike_main_install_prog_srcs = \ spike_main_srcs = \ spike_main_CFLAGS = -fPIC + +# This hack adds all symbols from extension.o to spike's dynamic symbol +# table, which is required for dynamically loaded --extension libraries +spike_main_LDFLAGS = extension.o -- cgit v1.1