Hi,I am using Genode with seL4 backend for my research. I am trying to add a new RPC method to RegionMap. It is meant as a simple exercise in understanding how the RPC framework in Genode works. The function name is "print_regions" and for now it does absolutely nothing. It takes in a void and returns a void. Unfortunately, I am running into some issues while adding this new RPC call to RM. I think I am missing something basic.First I ran into an issue where there was a mismatch between the ABI and library(3). I fixed it to the best of my ability and then got an error during library loading(4). Steps to reproduce and details of errors below.
My diff is available here:It is just upstream genode + 1 commit (my changes)My platform is Ubuntu 20.04.1 on x86-64
To reproduce:git clone https://github.com/genodelabs/genode.git genode-questioncd genode-question./tool/ports/prepare_port sel4./tool/ports/prepare_port grub2./tool/create_builddir x86_64git apply 26a79e7f1a77b99fb3b555198a29c638fd510bf4.diffcd build/x86_64make run/thread KERNEL=sel4
Here is what I did in my diff.
1. I started off by adding pure virtual func, GENODE_RPC, and an associated change in GENODE_RPC_INTERFACE to Genode::Region_map.
2. Then I went on to fix the others files as the build errors popped up. This was basically in classes that inherited Region_Map.
3. Then I made a change to repos/base/lib/symbols/ld to work around the following error:Error: size of '_ZTVN6Genode17Region_map_clientE' symbol violates ld ABI (72 bytes in ABI, 80 bytes in library)make[3]: *** [/home/siagraw/genode/repos/base/mk/lib.mk:244: ld-sel4.lib.checked] Error 255make[2]: *** [var/libdeps:200: ld-sel4.lib] Error 2
I am least sure of this change. I am unsure if this is a file I should even be modifying for something as simple as adding a new RPC method. But I did change it to get past the build error.
4. Then my "make run/thread KERNEL=sel4 " failed with the following error:Program lib/ld/sel4/ld-sel4make[1]: Leaving directory '/home/siagraw/genode/build/x86_64'genode build completedusing 'core-sel4.a' as 'core.a'using 'ld-sel4.lib.so' as 'ld.lib.so'/usr/local/genode/tool/21.05/bin/../lib/gcc/x86_64-pc-elf/10.3.0/../../../../x86_64-pc-elf/bin/ld: debug/core-sel4.a(region_map_client.o):(.data.rel.ro._ZTVN6Genode17Region_map_clientE[_ZTVN6Genode17Region_map_clientE]+0x40): u'collect2: error: ld returned 1 exit statuswhile executing"exec [cross_dev_prefix]g++ {*}$arch -nostdlib {*}[core_ld_opts] -Wl,-z -Wl,max-page-size=0x1000 -Wl,-Ttext=$link_address -Wl,-gc-sections -Wl,-nost..."(procedure "build_core" line 18)invoked from within"build_core debug/$core_obj {} [run_dir].core [core_link_address]"(procedure "build_core_image" line 16)invoked from within"build_core_image $binaries"(procedure "run_boot_dir" line 19)invoked from within"run_boot_dir $binaries"(procedure "build_boot_image" line 35)invoked from within"build_boot_image "core ld.lib.so init test-thread""(file "/home/siagraw/genode/repos/base/run/thread.run" line 48)invoked from within"source $include_name"("foreach" body line 6)invoked from within"foreach include_name [get_cmd_arg --include ""] {# first check if the include name is absoluteif {[string first "/" $include_name] == 0} {puts ..."(file "/home/siagraw/genode/tool/run/run" line 1115)make: *** [Makefile:405: run/thread] Error 1
I am at a loss on how to proceed from here and any help would be very useful. Perhaps I have missed another place where I should be adding my new function definition or perhaps the symbols need to be manually updated.As always, thanks for the help.Best,Sidhartha Agrawal