drorgl / esp32-tinyemu

A fork to Fabrice Bellard's TinyEmu ported to ESP32
MIT License
51 stars 14 forks source link

Hi, i got an error while compiling please help me solve it #4

Closed Shreyas-ITB closed 2 years ago

Shreyas-ITB commented 2 years ago

the full build log was


Processing native (platform: native)
--------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- tinyemu @ 1.0.0
|   |-- VMM
|   |   |-- direct_cache
|   |   |-- log_c
|   |   |-- lru_cache
|   |   |   |-- list @ 0.2.0
|   |   |   |-- memory_indexer
|   |   |   |   |-- avltree @ 1
|   |   |-- page_cache
|   |   |   |-- direct_cache
|   |   |   |-- HimemAllocator
|   |   |   |-- lru_cache
|   |   |   |   |-- list @ 0.2.0
|   |   |   |   |-- memory_indexer
|   |   |   |   |   |-- avltree @ 1
|   |   |-- list @ 0.2.0
|   |-- virtual_directory
|-- sdmount
|   |-- virtual_directory
|-- log_c
|-- simpleconsole
|   |-- tinyemu @ 1.0.0
|   |   |-- VMM
|   |   |   |-- direct_cache
|   |   |   |-- log_c
|   |   |   |-- lru_cache
|   |   |   |   |-- list @ 0.2.0
|   |   |   |   |-- memory_indexer
|   |   |   |   |   |-- avltree @ 1
|   |   |   |-- page_cache
|   |   |   |   |-- direct_cache
|   |   |   |   |-- HimemAllocator
|   |   |   |   |-- lru_cache
|   |   |   |   |   |-- list @ 0.2.0
|   |   |   |   |   |-- memory_indexer
|   |   |   |   |   |   |-- avltree @ 1
|   |   |   |-- list @ 0.2.0
|   |   |-- virtual_directory
|-- uartconsole
|   |-- tinyemu @ 1.0.0
|   |   |-- VMM
|   |   |   |-- direct_cache
|   |   |   |-- log_c
|   |   |   |-- lru_cache
|   |   |   |   |-- list @ 0.2.0
|   |   |   |   |-- memory_indexer
|   |   |   |   |   |-- avltree @ 1
|   |   |   |-- page_cache
|   |   |   |   |-- direct_cache
|   |   |   |   |-- HimemAllocator
|   |   |   |   |-- lru_cache
|   |   |   |   |   |-- list @ 0.2.0
|   |   |   |   |   |-- memory_indexer
|   |   |   |   |   |   |-- avltree @ 1
|   |   |   |-- list @ 0.2.0
|   |   |-- virtual_directory
|-- virtual_directory
Building in release mode
Compiling .pio\build\native\src\temu.o
Compiling .pio\build\native\lib22a\direct_cache\direct_cache.o
Compiling .pio\build\native\libce4\log_c\log.o
lib\direct_cache\direct_cache.c: In function 'direct_cache_init':
lib\direct_cache\direct_cache.c:24:29: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         cache->cache[i].key = i + 1;
                             ^
lib\direct_cache\direct_cache.c: In function 'direct_cache_remove':
lib\direct_cache\direct_cache.c:50:28: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     cache->cache[cell].key = cell + 1;
                            ^
Compiling .pio\build\native\libf93\list\llist.o
Archiving .pio\build\native\lib22a\libdirect_cache.a
Indexing .pio\build\native\lib22a\libdirect_cache.a
Archiving .pio\build\native\libce4\liblog_c.a
Compiling .pio\build\native\libf93\list\llist_iterator.o
Indexing .pio\build\native\libce4\liblog_c.a
Compiling .pio\build\native\libf93\list\llist_node.o
In file included from src\temu.c:81:0:
lib\simpleconsole/simpleconsole.h: In function 'simple_console_get_size':
lib\simpleconsole/simpleconsole.h:87:20: warning: unused variable 'ws' [-Wunused-variable]
     struct winsize ws;
                    ^~
src\temu.c: In function 'block_device_init':
src\temu.c:409:17: warning: implicit declaration of function 'ftello' [-Wimplicit-function-declaration]
     file_size = ftello(f);
                 ^~~~~~
src\temu.c: In function 'main':
src\temu.c:768:34: warning: variable 'build_preload_file' set but not used [-Wunused-but-set-variable]
     const char *path, *cmdline, *build_preload_file;
                                  ^~~~~~~~~~~~~~~~~~
Compiling .pio\build\native\lib979\avltree\avltree.o
Compiling .pio\build\native\lib1f2\memory_indexer\memory_indexer.o
Archiving .pio\build\native\libf93\liblist.a
Compiling .pio\build\native\lib43b\lru_cache\lru_cache.o
lib\memory_indexer\memory_indexer.c: In function 'memory_indexer_init':
lib\memory_indexer\memory_indexer.c:34:53: warning: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
     memory_indexer_t *indexer = (memory_indexer_t *)malloc(sizeof(memory_indexer_t));
                                                     ^~~~~~
lib\memory_indexer\memory_indexer.c:34:53: warning: incompatible implicit declaration of built-in function 'malloc'
lib\memory_indexer\memory_indexer.c:34:53: note: include '<stdlib.h>' or provide a declaration of 'malloc'
lib\memory_indexer\memory_indexer.c: In function 'memory_indexer_set':
lib\memory_indexer\memory_indexer.c:44:67: warning: incompatible implicit declaration of built-in function 'malloc'
     struct memory_wrapper *memory_item = (struct memory_wrapper *)malloc(sizeof(struct memory_wrapper));
                                                                   ^~~~~~
lib\memory_indexer\memory_indexer.c:44:67: note: include '<stdlib.h>' or provide a declaration of 'malloc'
lib\memory_indexer\memory_indexer.c: In function 'memory_indexer_search':
lib\memory_indexer\memory_indexer.c:60:35: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]     struct avl_node_t *avl_node = avl_search(&indexer->avl_tree, &query.avl, cmp_func);
                                   ^~~~~~~~~~
lib\memory_indexer\memory_indexer.c: In function 'memory_indexer_remove':
lib\memory_indexer\memory_indexer.c:72:35: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]     struct avl_node_t *avl_node = avl_search(&indexer->avl_tree, &query.avl, cmp_func);
                                   ^~~~~~~~~~
lib\memory_indexer\memory_indexer.c:76:40: warning: passing argument 2 of 'avl_remove' from incompatible pointer type [-Wincompatible-pointer-types]
         avl_remove(&indexer->avl_tree, avl_node);
                                        ^~~~~~~~
In file included from lib\memory_indexer\memory_indexer.c:3:0:
lib\avltree/avltree.h:88:6: note: expected 'struct avl_node *' but argument is of type 'struct avl_node_t *'
 void avl_remove(struct avl_tree *tree,
      ^~~~~~~~~~
lib\memory_indexer\memory_indexer.c:77:9: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]    
         free(wrapper);
         ^~~~
lib\memory_indexer\memory_indexer.c:77:9: warning: incompatible implicit declaration of built-in function 'free'
lib\memory_indexer\memory_indexer.c:77:9: note: include '<stdlib.h>' or provide a declaration of 'free'
lib\memory_indexer\memory_indexer.c:79:12: warning: 'return' with a value, in function returning void
     return NULL;
            ^~~~
lib\memory_indexer\memory_indexer.c:68:6: note: declared here
 void memory_indexer_remove(memory_indexer_t *indexer, uint64_t key)
      ^~~~~~~~~~~~~~~~~~~~~
lib\memory_indexer\memory_indexer.c: In function 'memory_indexer_free':
lib\memory_indexer\memory_indexer.c:85:35: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]     struct avl_node_t *avl_node = avl_first(&indexer->avl_tree);
                                   ^~~~Indexing .pio\build\native\libf93\liblist.a
~~~~~
lib\memory_indexer\memory_indexer.c:89:29: warning: passing argument 1 of 'avl_next' from incompatible pointer type [-Wincompatible-pointer-types]
         avl_node = avl_next(avl_node);
                             ^~~~~~~~
In file included from lib\memory_indexer\memory_indexer.c:3:0:
lib\avltree/avltree.h:92:18: note: expected 'struct avl_node *' but argument is of type 'struct avl_node_t *'
 struct avl_node* avl_next(struct avl_node *node);
                  ^~~~Compiling .pio\build\native\lib6f5\HimemAllocator\himem_access\emulated_himem.o
~~~~
Archiving .pio\build\native\lib1f2\libmemory_indexer.a
lib\memory_indexer\memory_indexer.c:89:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
         avl_node = avl_next(avl_node);
                  ^
lib\lru_cache\lru_cache.c: In function 'lru_cache_flush_items':
lib\lru_cache\lru_cache.c:104:54: warning: passing argument 2 of 'memory_indexer_remove' makes integer from pointer without a cast [-Wint-conversion]
         memory_indexer_remove(cache->memory_indexer, cache_item->key);
                                                      ^~~~~~~~~Indexing .pio\build\native\lib1f2\libmemory_indexer.a
~
Archiving .pio\build\native\lib43b\liblru_cache.a
In file included from lib\lru_cache\lru_cache.c:5:0:
lib\memory_indexer/memory_indexer.h:12:6: note: expected 'uint64_t {aka long long unsigned int}' but argument is of type 'void *'
 void memory_indexer_remove(memory_indexer_t *indexer, uint64_t key);
      ^~~~~~~~~~Indexing .pio\build\native\lib43b\liblru_cache.a
~~~~~~~~~~~
Compiling .pio\build\native\lib6f5\HimemAllocator\himem_access\esp32_himem.o
Archiving .pio\build\native\lib979\libavltree.a
Compiling .pio\build\native\lib6f5\HimemAllocator\himem_allocator.o
Indexing .pio\build\native\lib979\libavltree.a
Compiling .pio\build\native\libf1b\page_cache\page_cache.o
Compiling .pio\build\native\lib6c6\VMM\vmm.o
lib\page_cache\page_cache.c:28:1: warning: no semicolon at end of struct or union
 };
 ^
lib\page_cache\page_cache.c: In function 'on_page_flush':
lib\page_cache\page_cache.c:46:26: warning: passing argument 1 of 'page_cache->on_flush' makes integer from pointer without a cast [-Wint-conversion]
     page_cache->on_flush(key,page_cache->flush_buffer, page_cache->flush_context);
                          ^~~
lib\page_cache\page_cache.c:46:26: note: expected 'uint64_t {aka long long unsigned int}' but argument is of type 'void *'      
lib\page_cache\page_cache.c: In function 'page_cache_get':
lib\page_cache\page_cache.c:73:86: warning: passing argument 2 of 'direct_cache_get' makes pointer from integer without a cast [-Wint-conversion]
     struct page_cache_item_t *page_item = direct_cache_get(page_cache->direct_cache, page_number);
                                                                                      ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:10:0:
lib\direct_cache/direct_cache.h:10:7: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
 void *direct_cache_get(direct_cache_t *cache, void *key);
       ^~~~~~~~~~~~~~~~
lib\page_cache\page_cache.c:75:58: warning: passing argument 2 of 'lru_cache_get' makes pointer from integer without a cast [-Wint-conversion]
         page_item = lru_cache_get(page_cache->lru_cache, page_number);
                                                          ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:9:0:
lib\lru_cache/lru_cache.h:12:7: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
 void *lru_cache_get(cache_t *cache, void *key);
       ^~~~~~~~~~~~~
lib\page_cache\page_cache.c: In function 'page_cache_set':
lib\page_cache\page_cache.c:91:86: warning: passing argument 2 of 'direct_cache_get' makes pointer from integer without a cast [-Wint-conversion]
     struct page_cache_item_t *page_item = direct_cache_get(page_cache->direct_cache, page_number);
                                                                                      ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:10:0:
lib\direct_cache/direct_cache.h:10:7: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'   
 void *direct_cache_get(direct_cache_t *cache, void *key);
       ^~~~~~~~~~~~~~~~
lib\page_cache\page_cache.c:93:58: warning: passing argument 2 of 'lru_cache_get' makes pointer from integer without a cast [-Wint-conversion]
         page_item = lru_cache_get(page_cache->lru_cache, page_number);
                                                          ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:9:0:
lib\lru_cache/lru_cache.h:12:7: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
 void *lru_cache_get(cache_t *cache, void *key);
       ^~~~~~~~~~~~~
lib\page_cache\page_cache.c:116:53: warning: passing argument 2 of 'lru_cache_remove' makes pointer from integer without a cast 
[-Wint-conversion]
             lru_cache_remove(page_cache->lru_cache, page_item->page_number);
                                                     ^~~~~~~~~Compiling .pio\build\native\lib49c\virtual_directory\virtual_directory.o

In file included from lib\page_cache\page_cache.c:9:0:
lib\lru_cache/lru_cache.h:16:6: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
Archiving .pio\build\native\lib6f5\libHimemAllocator.a
 void lru_cache_remove(cache_t * cache, void* key);
      ^~~~~~~~~~~~~~~~Indexing .pio\build\native\lib6f5\libHimemAllocator.a

lib\page_cache\page_cache.c:117:59: warning: passing argument 2 of 'direct_cache_remove' makes pointer from integer without a cast [-Wint-conversion]
Archiving .pio\build\native\libf1b\libpage_cache.a
             direct_cache_remove(page_cache->direct_cache, page_item->page_number);
                                                           ^~~~~~~~~
In file included from lib\page_cache\page_cache.c:10:0:
lib\direct_cache/direct_cache.h:13:6: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
Indexing .pio\build\native\libf1b\libpage_cache.a
 void direct_cache_remove(direct_cache_t *cache, void *key);
      ^~~~~~~~~~~~~~~~~~~
Compiling .pio\build\native\lib99c\tinyemu\aes.o
lib\page_cache\page_cache.c:127:46: warning: passing argument 2 of 'lru_cache_add' makes pointer from integer without a cast [-Wint-conversion]
         lru_cache_add(page_cache->lru_cache, page_number, page_item);
                                              ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:9:0:
lib\lru_cache/lru_cache.h:21:6: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'
 void lru_cache_add(cache_t *cache, void *key, void *value);
      ^~~~~~~~~~~~~
lib\page_cache\page_cache.c:128:51: warning: passing argument 2 of 'direct_cache_set' makes pointer from integer without a cast 
[-Wint-conversion]
         direct_cache_set(page_cache->direct_cache,page_number, page_item);
                                                   ^~~~~~~~~~~
In file included from lib\page_cache\page_cache.c:10:0:
lib\direct_cache/direct_cache.h:12:6: note: expected 'void *' but argument is of type 'uint64_t {aka long long unsigned int}'   
 void direct_cache_set(direct_cache_t *cache, void *key, void *value);
      ^~~~~~~~~~~~~~~~
Archiving .pio\build\native\lib49c\libvirtual_directory.a
lib\VMM\vmm.c: In function 'get_TLB':
lib\VMM\vmm.c:70:60: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     vmTable_t *value = direct_cache_get(vmm->direct_cache, (void *)page_number);
                                                            ^
lib\VMM\vmm.c:76:43: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     value = lru_cache_get(vmm->lru_cache, (void *)page_number);
                                           ^
lib\VMM\vmm.c: In function 'backing_store_write':
lib\VMM\vmm.c:115:49: warning: passing argument 3 of 'page_cache_set' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     page_cache_set(vmm->page_cache,page_number, buf);
                                                 ^~~
In file included from lib\VMM\vmm.h:9:0,
                 from lib\VMM\vmm.c:1:
lib\page_cache/page_cache.h:17:6: note: expected 'void *' but argument is of type 'const uint8_t * {aka const unsigned char *}' 
 void page_cache_set(page_cache_t *page_cache, uint64_t page_number, void *buff);
      ^~~~~~~~~~~~~~
lib\VMM\vmm.c: In function 'free_vmtable':
lib\VMM\vmm.c:164:38: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     lru_cache_remove(vmm->lru_cache, (void *)entry->page_number);
                                      ^
lib\VMM\vmm.c:165:44: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     direct_cache_remove(vmm->direct_cache, (void *)entry->page_number);
                                            ^
Compiling .pio\build\native\lib99c\tinyemu\cutils.o
lib\VMM\vmm.c: In function 'get_page':
lib\VMM\vmm.c:424:39: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         lru_cache_add(vmm->lru_cache, (void *)page_number, page);
                                       ^
lib\VMM\vmm.c:425:45: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         direct_cache_set(vmm->direct_cache, (void *)page_number, page);
                                             ^
Indexing .pio\build\native\lib49c\libvirtual_directory.a
Compiling .pio\build\native\lib99c\tinyemu\fs.o
Archiving .pio\build\native\lib6c6\libVMM.a
Compiling .pio\build\native\lib99c\tinyemu\fs_utils.o
Indexing .pio\build\native\lib6c6\libVMM.a
Compiling .pio\build\native\lib99c\tinyemu\ide.o
Compiling .pio\build\native\lib99c\tinyemu\iomem.o
Compiling .pio\build\native\lib99c\tinyemu\json.o
lib\tinyemu\iomem.c: In function 'phys_mem_get_ram_ptr':
lib\tinyemu\iomem.c:289:20: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
     uint64_t ptr = pr->phys_mem + /*(uintptr_t)*/offset;
                    ^~
lib\tinyemu\iomem.c:290:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     return (uint8_t*)ptr;
            ^
Compiling .pio\build\native\lib99c\tinyemu\machine.o
Compiling .pio\build\native\lib99c\tinyemu\pci.o
Compiling .pio\build\native\lib99c\tinyemu\pckbd.o
lib\tinyemu\machine.c: In function 'cmdline_subst':
lib\tinyemu\machine.c:157:17: warning: implicit declaration of function 'localtime_r' [-Wimplicit-function-declaration]
                 localtime_r(&ti, &tm);
                 ^~~~~~~~~~~
Compiling .pio\build\native\lib99c\tinyemu\ps2.o
Compiling .pio\build\native\lib99c\tinyemu\riscv_cpu128.o
Compiling .pio\build\native\lib99c\tinyemu\riscv_cpu32.o
Compiling .pio\build\native\lib99c\tinyemu\riscv_cpu64.o
Compiling .pio\build\native\lib99c\tinyemu\riscv_machine.o
Compiling .pio\build\native\lib99c\tinyemu\sha256.o
lib\tinyemu\riscv_machine.c: In function 'rtc_get_real_time':
lib\tinyemu\riscv_machine.c:103:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
     clock_gettime(CLOCK_MONOTONIC, &ts);
                   ^~~~~~~~~~~~~~~
lib\tinyemu\riscv_machine.c:103:19: note: each undeclared identifier is reported only once for each function it appears in      
lib\tinyemu\riscv_machine.c: In function 'copy_bios':
lib\tinyemu\riscv_machine.c:952:73: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     printf("writing jump address ram ptr: 0x%" PRIx64 " phy: 0x%p\r\n", (uint64_t)ram_ptr  - (uint64_t)pr->phys_mem, pr->phys_mem);
                                                                         ^
lib\tinyemu\riscv_machine.c:952:94: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     printf("writing jump address ram ptr: 0x%" PRIx64 " phy: 0x%p\r\n", (uint64_t)ram_ptr  - (uint64_t)pr->phys_mem, pr->phys_mem);
                                                                                              ^
In file included from lib\tinyemu\riscv_cpu.c:51:0,
                 from lib\tinyemu\riscv_cpu32.c:2:
lib\tinyemu\riscv_cpu.c: In function 'riscv32_read_slow':
lib\tinyemu\riscv_cpu_priv.h:291:20: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
         mem_uint_t val;\
                    ^~~
lib\tinyemu\riscv_cpu_priv.h:291:20: note: 'val' was declared here
         mem_uint_t val;\
                    ^
lib\tinyemu\riscv_cpu_priv.h:307:1: note: in expansion of macro 'TARGET_READ_WRITE'
 TARGET_READ_WRITE(8, uint8_t, 0)
 ^~~~~~~~~~~~~~~~~
In file included from lib\tinyemu\riscv_cpu32.c:2:0:
lib\tinyemu\riscv_cpu.c:375:27: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 ret = (v0 >> (al * 8)) | (v1 << (64 - al * 8));
                       ~~~~^~~~~~~~~~~~
*** [.pio\build\native\lib99c\tinyemu\riscv_machine.o] Error 1
In file included from lib\tinyemu\riscv_cpu.c:51:0,
                 from lib\tinyemu\riscv_cpu64.c:2:
lib\tinyemu\riscv_cpu.c: In function 'riscv64_read_slow':
lib\tinyemu\riscv_cpu_priv.h:291:20: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
         mem_uint_t val;\
                    ^~~
lib\tinyemu\riscv_cpu_priv.h:291:20: note: 'val' was declared here
         mem_uint_t val;\
                    ^
lib\tinyemu\riscv_cpu_priv.h:307:1: note: in expansion of macro 'TARGET_READ_WRITE'
 TARGET_READ_WRITE(8, uint8_t, 0)
 ^~~~~~~~~~~~~~~~~
In file included from lib\tinyemu\riscv_cpu64.c:2:0:
lib\tinyemu\riscv_cpu.c:375:27: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
                 ret = (v0 >> (al * 8)) | (v1 << (64 - al * 8));
                       ~~~~^~~~~~~~~~~~
================================================= [FAILED] Took 14.07 seconds =================================================

Environment    Status    Duration
-------------  --------  ------------
native         FAILED    00:00:14.073
============================================ 1 failed, 0 succeeded in 00:00:14.073 ============================================ 

 *  The terminal process "C:\Users\shrey\.platformio\penv\Scripts\platformio.exe 'run', '--target', 'upload'" terminated with exit code: 1. 
 *  Terminal will be reused by tasks, press any key to close it.