Hi Martin, Following your suggestion, I added these 2 files. 1. *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) 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 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: 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: 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
On Tue, Feb 21, 2023 at 4:05 PM Martin Stein martin.stein@genode-labs.com wrote:
Hi Pranab,
If you try enforcing your questions that fast, it might demotivate others to answer you.
You're getting a compile error because jitterentropy has not been enabled yet on riscv:
$ find repos/ -name *jitterentropy-base-genode-nstime.h*
repos/libports/src/lib/jitterentropy/spec/arm_v8/jitterentropy-base-genode-nstime.h
repos/libports/src/lib/jitterentropy/spec/x86_64/jitterentropy-base-genode-nstime.h
repos/libports/src/lib/jitterentropy/spec/arm_v6/jitterentropy-base-genode-nstime.h
repos/libports/src/lib/jitterentropy/spec/x86_32/jitterentropy-base-genode-nstime.h
repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h
However, you could try and enabling it yourself. Obviously, you'd need to create this header first:
repos/libports/src/lib/jitterentropy/spec/arm_v7/jitterentropy-base-genode-nstime.h
Then, you'd need to create the corresponding lib makefile...
repos/libports/lib/mk/spec/riscv/jitterentropy.mk
... and adapt the jitterentropy import file in order to consider riscv targets:
repos/libports/lib/import/import-jitterentropy.mk
Then, let see what fails next and let it guide you. If you get stuck, don't hesitate to ask the list.
Cheers, Martin
On 21.02.23 10:44, Pranab Kumar Rout cs21m045 wrote:
Hello, Can anyone explain why this fatal error (jitterentropy-base-genode-nstime.h: *No such file or directory*) is being produced while running:
/make run/sculpt_test KERNEL=hw BOARD=virt_qemu_riscv/
Please provide some solution to deal with this problem. [pls ref to my prev email]
Thanks & regards, Pranab
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users