Hi Pranab,
These errors indicate that your version of jitterentropy declares jitterentropy_init and jent_entropy_collector_alloc but doesn't implement them. I'd suggest you to lookup the where the other versions (arm, x86) implement the functions and whether the implementations are generic or platform specific. If the latter is the case, you either find an existing riscv implementation in the contrib code (contrib/jitterentropy*) or you have to implement the functions for riscv yourself. If the former is the case, you're probably just missed to add the corresponding compilation unit to your makefile (SRC_C variable).
PS: Please don't re-use the file headers (brief, author, copyright) of Genode Labs.
Cheers, Martin
On 22.02.23 12:27, Pranab Kumar Rout cs21m045 wrote:
Hi Martin, Following your suggestion, I added these 2 files.
*repos/libports/src/lib/jitterentropy/spec/riscv/jitterentropy-base-genode-nstime.h**
Its contents are:
/* * \brief Time backend for jitterentropy library * \author Josef Soentgen * \date 2014-08-18 */ /* * Copyright (C) 2014-2017 Genode Labs GmbH * * This file is part of the Genode OS framework, which is distributed * under the terms of the GNU Affero General Public License version 3. */ #ifndef _JITTERENTROPY_RISCV_BASE_GENODE_NSTIME_H_ #define _JITTERENTROPY_RISCV_BASE_GENODE_NSTIME_H_ static inline void jent_get_nstime(__u64 *out) { uint32_t t; asm volatile("mrc p15, 0, %0, c9, c13, 0" : "=r"(t)); *out = t; } #endif
2. *repos/libports/lib/mk/spec/riscv/jitterentropy.mk http://jitterentropy.mk* Its contents:
INC_DIR += $(REP_DIR)/src/lib/jitterentropy/spec/riscv include $(REP_DIR)/lib/mk/jitterentropy.inc CC_CXX_WARN_STRICT =
And I updated the jitterentropy jitterentropy import file at *repos/libports/lib/import/import-jitterentropy.mk http://import-jitterentropy.mk
Its contents are:
ifeq ($(filter-out $(SPECS),x86_32),) TARGET_CPUARCH=x86_32 else ifeq ($(filter-out $(SPECS),x86_64),) TARGET_CPUARCH=x86_64 else ifeq ($(filter-out $(SPECS),arm_v6),) TARGET_CPUARCH=arm_v6 else ifeq ($(filter-out $(SPECS),arm_v7),) TARGET_CPUARCH=arm_v7 else ifeq ($(filter-out $(SPECS),arm_v8),) TARGET_CPUARCH=arm_v8 else ifeq ($(filter-out $(SPECS),riscv),) TARGET_CPUARCH=riscv endif JITTERENTROPY_DIR := $(call select_from_ports,jitterentropy) ifeq ($(CONTRIB_DIR),) REP_INC_DIR += include/jitterentropy else INC_DIR += $(JITTERENTROPY_DIR)/include/jitterentropy endif INC_DIR += $(call select_from_repositories,src/lib/jitterentropy)these INC_DIR += $(call select_from_repositories,src/lib/jitterentropy/spec/$(TARGET_CPUARCH)) CC_OPT += -DJITTERENTROPY_GENODE
After running
/make run/sculpt KERNEL=hw BOARD=virt_qemu_riscv/
I am getting such error:
checking library dependencies... Library ldso_so_support COMPILE so_support.o MERGE ldso_so_support.lib.a Library ld CONVERT ld.symbols.s ASSEMBLE ld.symbols.o MERGE ld.abi.so <http://ld.abi.so> Library base MERGE base.lib.a Library block_session MERGE block_session.lib.a Library config MERGE config.lib.a Library jitterentropy MERGE jitterentropy.lib.a Library os MERGE os.lib.a Program app/gpt_write/gpt_write COMPILE main.o COMPILE util.o LINK gpt_write /usr/local/genode/tool/21.05/bin/../lib/gcc/riscv64-unknown-elf/10.3.0/../../../../riscv64-unknown-elf/bin/ld: util.o: in function `Util::init_random(Genode::Allocator&)': /home/pranab/MTP/r5/genode/depot/genodelabs/src/gpt_write/2023-02-22-c/src/app/gpt_write/util.cc:39: *undefined reference* to `jitterentropy_init(Genode::Allocator&)' /usr/local/genode/tool/21.05/bin/../lib/gcc/riscv64-unknown-elf/10.3.0/../../../../riscv64-unknown-elf/bin/ld: /home/pranab/MTP/r5/genode/depot/genodelabs/src/gpt_write/2023-02-22-c/src/app/gpt_write/util.cc:41: *undefined reference* to `jent_entropy_init' /usr/local/genode/tool/21.05/bin/../lib/gcc/riscv64-unknown-elf/10.3.0/../../../../riscv64-unknown-elf/bin/ld: /home/pranab/MTP/r5/genode/depot/genodelabs/src/gpt_write/2023-02-22-c/src/app/gpt_write/util.cc:48: *undefined reference* to `jent_entropy_collector_alloc' /usr/local/genode/tool/21.05/bin/../lib/gcc/riscv64-unknown-elf/10.3.0/../../../../riscv64-unknown-elf/bin/ld: util.o: in function `void Genode::Log::output<char const (&) [52]>(Genode::Log::Type, char const (&) [52])': /home/pranab/MTP/r5/genode/depot/genodelabs/api/base/2022-11-28/include/base/log.h:70: *undefined reference* to `jent_read_entropy' collect2: error: ld returned 1 exit status make[7]: *** [/home/pranab/MTP/r5/genode/repos/base/mk/prg.mk:218 <http://prg.mk:218>: gpt_write] Error 1 make[6]: *** [var/libdeps:151: gpt_write.prg] Error 2 make[5]: *** [Makefile:336: gen_deps_and_build_targets] Error 2 make[4]: *** [/home/pranab/MTP/r5/genode/tool/depot/mk/build_bin_archive:208: /home/pranab/MTP/r5/genode/depot/genodelabs/bin/riscv/gpt_write/2023-02-22-c.build/bin] Error 1 make[3]: *** [/home/pranab/MTP/r5/genode/depot/var/build.mk:264 <http://build.mk:264>: genodelabs/bin/riscv/gpt_write/2023-02-22-c] Error 2 make[2]: *** [/home/pranab/MTP/r5/genode/tool/depot/build:136: execute_generated_build_mk_file] Error 2 make[1]: *** [/home/pranab/MTP/r5/genode/tool/depot/create:59: build] Error 2 make[1]: Leaving directory '/home/pranab/MTP/r5/genode/build/riscv'
I am not able to fix this. Please help me understand the issues.
Thanks & Regards, Pranab