Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POSIX Threads/Semaphores implementation #19

Open
vmlemon opened this issue Sep 15, 2019 · 3 comments
Open

POSIX Threads/Semaphores implementation #19

vmlemon opened this issue Sep 15, 2019 · 3 comments
Labels
enhancement New feature or request Linux

Comments

@vmlemon
Copy link
Owner

vmlemon commented Sep 15, 2019

In order to implement POSIX compatibility, for #7, to port things like SQLite, MojoELF, nedmalloc, and V2Lin, we need to implement pthreads, and semaphores, it seems.

For instance, the unbuildable surface required by V2Lin looks like:

tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user/apps/system$ make
===> v2lin_v02/lib/lwdLib.c
gcc-6 -I../../include -I../.. -I/usr/lib/gcc/x86_64-linux-gnu/6/include   -nostdinc -g -O2 -m64 -mno-red-zone   -fno-stack-protector -lssp -O2 -g -Wall -Wshadow   -fno-stack-protector  -Wconversion -std=c99 -c v2lin_v02/lib/lwdLib.c -o v2lin_v02/lib/lwdLib.o
In file included from v2lin_v02/lib/lwdLib.c:28:0:
../../include/stdio.h: In function ‘__sputc’:
../../include/stdio.h:460:23: warning: conversion to ‘unsigned char’ from ‘int’ may alter its value [-Wconversion]
   return (*_p->_p++ = _c);
                       ^~
In file included from ../../include/signal.h:43:0,
                 from v2lin_v02/lib/lwdLib.c:30:
../../include/sys/_ucontext.h: At top level:
../../include/sys/_ucontext.h:46:2: error: unknown type name ‘mcontext_t’
  mcontext_t uc_mcontext;
  ^~~~~~~~~~
In file included from v2lin_v02/lib/internal.h:29:0,
                 from v2lin_v02/lib/lwdLib.c:33:
v2lin_v02/lib/v2lpthread.h:68:2: error: unknown type name ‘pthread_attr_t’
  pthread_attr_t attr;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:69:21: error: field ‘prv_priority’ has incomplete type
  struct sched_param prv_priority;
                     ^~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:80:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t tdelete_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:81:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t t_deletable;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:84:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t dbcst_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:85:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t delete_bcplt;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:95:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t *waiting_m;
  ^~~~~~~~~~~~~~~
In file included from v2lin_v02/lib/vxw_hdrs.h:28:0,
                 from v2lin_v02/lib/internal.h:31,
                 from v2lin_v02/lib/lwdLib.c:33:
../../include/sys/types.h: In function ‘__bitcount16’:
../../include/sys/types.h:327:7: warning: conversion to ‘__uint16_t {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
  _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1);
       ^
../../include/sys/types.h:328:7: warning: conversion to ‘__uint16_t {aka short unsigned int}’ from ‘int’ may alter its value [-Wconversion]
  _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2);
       ^
In file included from ../../include/sys/types.h:376:0,
                 from v2lin_v02/lib/vxw_hdrs.h:28,
                 from v2lin_v02/lib/internal.h:31,
                 from v2lin_v02/lib/lwdLib.c:33:
../../include/sys/select.h: At top level:
../../include/sys/select.h:105:54: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration
 int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
                                                      ^~~~~~~
In file included from v2lin_v02/lib/vxw_hdrs.h:28:0,
                 from v2lin_v02/lib/internal.h:31,
                 from v2lin_v02/lib/lwdLib.c:33:
../../include/sys/types.h: In function ‘__major’:
../../include/sys/types.h:393:36: warning: conversion to ‘int’ from ‘dev_t {aka long unsigned int}’ may alter its value [-Wconversion]
  return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff));
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
../../include/sys/types.h: In function ‘__minor’:
../../include/sys/types.h:399:32: warning: conversion to ‘int’ from ‘dev_t {aka long unsigned int}’ may alter its value [-Wconversion]
  return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff));
         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../include/sys/types.h: In function ‘__makedev’:
../../include/sys/types.h:405:26: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
  return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
                          ^
../../include/sys/types.h:405:47: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
  return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
                                               ^
../../include/sys/types.h:406:49: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
      ((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff));
                                                 ^
In file included from v2lin_v02/lib/lwdLib.c:33:0:
v2lin_v02/lib/internal.h: At top level:
v2lin_v02/lib/internal.h:37:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t wdog_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:47:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t sem_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:48:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t sem_send;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:52:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t smdel_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:53:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t smdel_cplt;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:83:8: error: unknown type name ‘pthread_mutex_t’
 extern pthread_mutex_t task_list_lock;
        ^~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:43:8: error: unknown type name ‘pthread_mutex_t’
 static pthread_mutex_t wdog_list_lock = PTHREAD_MUTEX_INITIALIZER;
        ^~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:43:41: error: ‘PTHREAD_MUTEX_INITIALIZER’ undeclared here (not in a function)
 static pthread_mutex_t wdog_list_lock = PTHREAD_MUTEX_INITIALIZER;
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘wdog_valid’:
v2lin_v02/lib/lwdLib.c:60:2: warning: implicit declaration of function ‘pthread_cleanup_push’ [-Wimplicit-function-declaration]
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:60:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:60:42: note: each undeclared identifier is reported only once for each function it appears in
v2lin_v02/lib/lwdLib.c:61:2: warning: implicit declaration of function ‘pthread_mutex_lock’ [-Wimplicit-function-declaration]
  pthread_mutex_lock(&wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:81:2: warning: implicit declaration of function ‘pthread_cleanup_pop’ [-Wimplicit-function-declaration]
  pthread_cleanup_pop(1);
  ^~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘link_wdog’:
v2lin_v02/lib/lwdLib.c:93:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘unlink_wdog’:
v2lin_v02/lib/lwdLib.c:132:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘process_tick_for’:
v2lin_v02/lib/lwdLib.c:215:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:229:5: warning: implicit declaration of function ‘pthread_mutex_unlock’ [-Wimplicit-function-declaration]
     pthread_mutex_unlock(&wdId->wdog_lock);
     ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:229:5: warning: declaration of ‘pthread_mutex_unlock’ shadows previous non-variable [-Wshadow]
v2lin_v02/lib/lwdLib.c: In function ‘wdCancel’:
v2lin_v02/lib/lwdLib.c:271:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘wdCreate’:
v2lin_v02/lib/lwdLib.c:296:3: warning: implicit declaration of function ‘pthread_mutex_init’ [-Wimplicit-function-declaration]
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
   ^~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:296:47: error: ‘pthread_mutexattr_t’ undeclared (first use in this function)
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
                                               ^~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:296:68: error: expected expression before ‘)’ token
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
                                                                    ^
v2lin_v02/lib/lwdLib.c: In function ‘wdDelete’:
v2lin_v02/lib/lwdLib.c:313:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &(wdId->wdog_lock));
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘wdStart’:
v2lin_v02/lib/lwdLib.c:335:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘self_starter’:
v2lin_v02/lib/lwdLib.c:384:3: warning: implicit declaration of function ‘pthread_create’ [-Wimplicit-function-declaration]
   pthread_create(&(task->pthrid), &(task->attr), task_wrapper, (void *) task);
   ^~~~~~~~~~~~~~
In file included from v2lin_v02/lib/lwdLib.c:33:0:
v2lin_v02/lib/lwdLib.c: In function ‘wdogShow’:
v2lin_v02/lib/internal.h:92:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function)
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, m); \
                                          ^
v2lin_v02/lib/lwdLib.c:413:2: note: in expansion of macro ‘pthread_mutex_clean_lock’
  pthread_mutex_clean_lock(&wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:415:17: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void (*)(int)’ [-Wformat=]
   fprintf(out,"%x %i %i\n", wd->timeout_func, wd->ticks_remaining, wd->timeout_parm);
                 ^
make: *** [../../Mk/l4.build.mk:62: v2lin_v02/lib/lwdLib.o] Error 1

For NEDMalloc:

tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user/lib/linux$ cat NMB1 | grep error
malloc.c.h:2055:3: error: unknown type name ‘pthread_t’
malloc.c.h:2069:3: error: unknown type name ‘pthread_t’
malloc.c.h:2117:3: error: unknown type name ‘pthread_t’
nedmalloc.c:299:28: error: ‘malloc’ undeclared here (not in a function)
nedmalloc.c:300:36: error: ‘calloc’ undeclared here (not in a function)
nedmalloc.c:301:37: error: ‘realloc’ undeclared here (not in a function)
nedmalloc.c:302:25: error: ‘free’ undeclared here (not in a function)
nedmalloc.c:252:19: error: unknown type name ‘pthread_key_t’
@vmlemon vmlemon added enhancement New feature or request Linux labels Sep 15, 2019
This was referenced Sep 15, 2019
@vmlemon
Copy link
Owner Author

vmlemon commented Oct 3, 2019

We now have at least the FreeBSD implementation of mcontext_t, which at least gets MegaHAL further, but I haven't retested v2lin_v02, yet.

@vmlemon
Copy link
Owner Author

vmlemon commented Oct 3, 2019

Seems to get MegaHAL to the following stage:

===> Linking ./syslaunch
ld -e_start -N -L../../lib -L/usr/lib/gcc/x86_64-linux-gnu/8 -nostdlib  -melf_x86_64  -Ttext=01000000 crt0-amd64.o syslaunch.o megahal.o    -ll4 -lio  -llinux  -lgcc -o syslaunch
ld: megahal.o: in function `print_header':
/home/tyson/Orion/user/apps/system/megahal.c:881: undefined reference to `time'
ld: /home/tyson/Orion/user/apps/system/megahal.c:882: undefined reference to `localtime'
ld: /home/tyson/Orion/user/apps/system/megahal.c:883: undefined reference to `strftime'
ld: /home/tyson/Orion/user/apps/system/megahal.c:885: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:886: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:887: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:888: undefined reference to `fflush'
ld: megahal.o: in function `warn':
/home/tyson/Orion/user/apps/system/megahal.c:818: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:820: undefined reference to `vfprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:822: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:823: undefined reference to `fflush'
ld: /home/tyson/Orion/user/apps/system/megahal.c:825: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:825: undefined reference to `fwrite'
ld: megahal.o: in function `status':
/home/tyson/Orion/user/apps/system/megahal.c:861: undefined reference to `vfprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:863: undefined reference to `fflush'
ld: megahal.o: in function `error':
/home/tyson/Orion/user/apps/system/megahal.c:800: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:802: undefined reference to `vfprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:804: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:805: undefined reference to `fflush'
ld: /home/tyson/Orion/user/apps/system/megahal.c:807: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:807: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:809: undefined reference to `exit'
ld: megahal.o: in function `free_dictionary':
/home/tyson/Orion/user/apps/system/megahal.c:1250: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1254: undefined reference to `free'
ld: megahal.o: in function `progress':
/home/tyson/Orion/user/apps/system/megahal.c:3197: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3198: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3197: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3197: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3186: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3186: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3206: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3206: undefined reference to `fputc'
ld: megahal.o: in function `free_tree':
/home/tyson/Orion/user/apps/system/megahal.c:1299: undefined reference to `free'
ld: megahal.o: in function `upper':
/home/tyson/Orion/user/apps/system/megahal.c:956: undefined reference to `toupper'
ld: /home/tyson/Orion/user/apps/system/megahal.c:956: undefined reference to `strlen'
ld: megahal.o: in function `new_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2710: undefined reference to `malloc'
ld: megahal.o: in function `initialize_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2789: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2791: undefined reference to `fgets'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2793: undefined reference to `strtok'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2794: undefined reference to `strtok'
ld: megahal.o: in function `add_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2749: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2755: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2761: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2762: undefined reference to `strdup'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2763: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2764: undefined reference to `strdup'
ld: megahal.o: in function `initialize_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2789: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2789: undefined reference to `feof'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2799: undefined reference to `fclose'
ld: megahal.o: in function `add_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2742: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2734: undefined reference to `malloc'
ld: megahal.o: in function `format_output':
/home/tyson/Orion/user/apps/system/megahal.c:1003: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1003: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1017: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1012: undefined reference to `isspace'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1018: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1022: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:996: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1014: undefined reference to `strlen'
ld: megahal.o: in function `write_input':
/home/tyson/Orion/user/apps/system/megahal.c:974: undefined reference to `strtok'
ld: /home/tyson/Orion/user/apps/system/megahal.c:978: undefined reference to `strtok'
ld: megahal.o: in function `rnd':
/home/tyson/Orion/user/apps/system/megahal.c:2964: undefined reference to `drand48'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2957: undefined reference to `time'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2957: undefined reference to `srand48'
ld: megahal.o: in function `capitalize':
/home/tyson/Orion/user/apps/system/megahal.c:930: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:937: undefined reference to `tolower'
ld: /home/tyson/Orion/user/apps/system/megahal.c:937: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:940: undefined reference to `strchr'
ld: /home/tyson/Orion/user/apps/system/megahal.c:940: undefined reference to `isspace'
ld: /home/tyson/Orion/user/apps/system/megahal.c:935: undefined reference to `isalpha'
ld: /home/tyson/Orion/user/apps/system/megahal.c:936: undefined reference to `toupper'
ld: /home/tyson/Orion/user/apps/system/megahal.c:936: undefined reference to `strlen'
ld: megahal.o: in function `save_tree':
/home/tyson/Orion/user/apps/system/megahal.c:1924: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1925: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1926: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1927: undefined reference to `fwrite'
ld: megahal.o: in function `new_dictionary':
/home/tyson/Orion/user/apps/system/megahal.c:1331: undefined reference to `malloc'
ld: megahal.o: in function `make_output':
/home/tyson/Orion/user/apps/system/megahal.c:2567: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2548: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2551: undefined reference to `malloc'
ld: megahal.o: in function `free_word':
/home/tyson/Orion/user/apps/system/megahal.c:3351: undefined reference to `free'
ld: megahal.o: in function `new_node':
/home/tyson/Orion/user/apps/system/megahal.c:1440: undefined reference to `malloc'
ld: megahal.o: in function `wordcmp':
/home/tyson/Orion/user/apps/system/megahal.c:1230: undefined reference to `toupper'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1230: undefined reference to `toupper'
ld: megahal.o: in function `add_word':
/home/tyson/Orion/user/apps/system/megahal.c:1068: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1082: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1094: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1065: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1080: undefined reference to `malloc'
ld: megahal.o: in function `initialize_list':
/home/tyson/Orion/user/apps/system/megahal.c:2842: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2844: undefined reference to `fgets'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2846: undefined reference to `strtok'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2849: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2850: undefined reference to `strdup'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2842: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2842: undefined reference to `feof'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2855: undefined reference to `fclose'
ld: megahal.o: in function `make_greeting':
/home/tyson/Orion/user/apps/system/megahal.c:2158: undefined reference to `free'
ld: megahal.o: in function `load_tree':
/home/tyson/Orion/user/apps/system/megahal.c:1951: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1952: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1953: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1954: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1958: undefined reference to `malloc'
ld: megahal.o: in function `add_key':
/home/tyson/Orion/user/apps/system/megahal.c:2309: undefined reference to `isalnum'
ld: megahal.o: in function `add_aux':
/home/tyson/Orion/user/apps/system/megahal.c:2331: undefined reference to `isalnum'
ld: megahal.o: in function `make_words':
/home/tyson/Orion/user/apps/system/megahal.c:2035: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2054: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2065: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2067: undefined reference to `strlen'
ld: megahal.o: in function `boundary':
/home/tyson/Orion/user/apps/system/megahal.c:2121: undefined reference to `isalpha'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2129: undefined reference to `isalpha'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2116: undefined reference to `isalpha'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2117: undefined reference to `isalpha'
ld: megahal.o: in function `make_words':
/home/tyson/Orion/user/apps/system/megahal.c:2052: undefined reference to `malloc'
ld: megahal.o: in function `boundary':
/home/tyson/Orion/user/apps/system/megahal.c:2124: undefined reference to `isalpha'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2124: undefined reference to `isalpha'
ld: megahal.o: in function `make_words':
/home/tyson/Orion/user/apps/system/megahal.c:2077: undefined reference to `isalnum'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2081: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2091: undefined reference to `strchr'
ld: megahal.o: in function `typein':
/home/tyson/Orion/user/apps/system/megahal.c:2898: undefined reference to `usleep'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2899: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2899: undefined reference to `fputc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2900: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2900: undefined reference to `fflush'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2905: undefined reference to `isalnum'
ld: megahal.o: in function `delay':
/home/tyson/Orion/user/apps/system/megahal.c:2881: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2882: undefined reference to `usleep'
ld: megahal.o: in function `write_output':
/home/tyson/Orion/user/apps/system/megahal.c:914: undefined reference to `strtok'
ld: /home/tyson/Orion/user/apps/system/megahal.c:918: undefined reference to `strtok'
ld: megahal.o: in function `delay':
/home/tyson/Orion/user/apps/system/megahal.c:2874: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2874: undefined reference to `fprintf'
ld: megahal.o: in function `read_input':
/home/tyson/Orion/user/apps/system/megahal.c:710: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:710: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:711: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:711: undefined reference to `fflush'
ld: /home/tyson/Orion/user/apps/system/megahal.c:733: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:733: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:734: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:734: undefined reference to `fflush'
ld: /home/tyson/Orion/user/apps/system/megahal.c:746: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:722: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:722: undefined reference to `__stdinp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:722: undefined reference to `__srget'
ld: /home/tyson/Orion/user/apps/system/megahal.c:759: undefined reference to `isspace'
ld: /home/tyson/Orion/user/apps/system/megahal.c:700: undefined reference to `malloc'
ld: megahal.o: in function `save_model':
/home/tyson/Orion/user/apps/system/megahal.c:1890: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1889: undefined reference to `realloc'
ld: megahal.o: in function `show_dictionary':
/home/tyson/Orion/user/apps/system/megahal.c:1865: undefined reference to `fputc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1866: undefined reference to `fputc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1869: undefined reference to `fclose'
ld: megahal.o: in function `save_model':
/home/tyson/Orion/user/apps/system/megahal.c:1896: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1903: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1904: undefined reference to `fwrite'
ld: megahal.o: in function `save_dictionary':
/home/tyson/Orion/user/apps/system/megahal.c:1355: undefined reference to `fwrite'
ld: megahal.o: in function `save_word':
/home/tyson/Orion/user/apps/system/megahal.c:1396: undefined reference to `fwrite'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1398: undefined reference to `fwrite'
ld: megahal.o: in function `save_model':
/home/tyson/Orion/user/apps/system/megahal.c:1909: undefined reference to `fclose'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1884: undefined reference to `malloc'
ld: megahal.o: in function `free_word':
/home/tyson/Orion/user/apps/system/megahal.c:3351: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3351: undefined reference to `free'
ld: megahal.o: in function `free_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2815: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2816: undefined reference to `free'
ld: megahal.o: in function `add_node':
/home/tyson/Orion/user/apps/system/megahal.c:1638: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1636: undefined reference to `malloc'
ld: megahal.o: in function `train':
/home/tyson/Orion/user/apps/system/megahal.c:1817: undefined reference to `fseek'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1818: undefined reference to `ftell'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1819: undefined reference to `rewind'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1824: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1826: undefined reference to `fgets'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1835: undefined reference to `ftell'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1824: undefined reference to `__isthreaded'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1824: undefined reference to `feof'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1841: undefined reference to `fclose'
ld: megahal.o: in function `load_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3236: undefined reference to `strlen'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3235: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3244: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3257: undefined reference to `fclose'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3258: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3258: undefined reference to `fprintf'
ld: megahal.o: in function `free_model':
/home/tyson/Orion/user/apps/system/megahal.c:1272: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1276: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1278: undefined reference to `free'
ld: megahal.o: in function `new_model':
/home/tyson/Orion/user/apps/system/megahal.c:1473: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1482: undefined reference to `malloc'
ld: megahal.o: in function `load_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3282: undefined reference to `sprintf'
ld: megahal.o: in function `load_model':
/home/tyson/Orion/user/apps/system/megahal.c:1998: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2004: undefined reference to `fread'
ld: megahal.o: in function `load_dictionary':
/home/tyson/Orion/user/apps/system/megahal.c:1376: undefined reference to `fread'
ld: megahal.o: in function `load_word':
/home/tyson/Orion/user/apps/system/megahal.c:1413: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1414: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1420: undefined reference to `fread'
ld: /home/tyson/Orion/user/apps/system/megahal.c:1422: undefined reference to `free'
ld: megahal.o: in function `load_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3292: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3294: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3296: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3298: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3284: undefined reference to `sprintf'
ld: megahal.o: in function `change_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3323: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3327: undefined reference to `strncpy'
ld: megahal.o: in function `load_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3230: undefined reference to `malloc'
ld: megahal.o: in function `load_model':
/home/tyson/Orion/user/apps/system/megahal.c:2011: undefined reference to `fclose'
ld: megahal.o: in function `change_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3308: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3317: undefined reference to `strdup'
ld: megahal.o: in function `load_personality':
/home/tyson/Orion/user/apps/system/megahal.c:3247: undefined reference to `sprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3250: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3250: undefined reference to `fprintf'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3252: undefined reference to `free'
ld: /home/tyson/Orion/user/apps/system/megahal.c:3253: undefined reference to `strdup'
ld: megahal.o: in function `reply':
/home/tyson/Orion/user/apps/system/megahal.c:2431: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2429: undefined reference to `malloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2381: undefined reference to `realloc'
ld: /home/tyson/Orion/user/apps/system/megahal.c:2379: undefined reference to `malloc'
ld: megahal.o: in function `make_keywords':
/home/tyson/Orion/user/apps/system/megahal.c:2263: undefined reference to `free'
ld: megahal.o: in function `generate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2208: undefined reference to `time'
ld: megahal.o: in function `evaluate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2497: undefined reference to `log'
ld: megahal.o: in function `generate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2219: undefined reference to `time'
ld: megahal.o: in function `evaluate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2521: undefined reference to `log'
ld: megahal.o: in function `generate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2193: undefined reference to `malloc'
ld: megahal.o: in function `evaluate_reply':
/home/tyson/Orion/user/apps/system/megahal.c:2527: undefined reference to `sqrt'
ld: megahal.o: in function `megahal_initialize':
/home/tyson/Orion/user/apps/system/megahal.c:411: undefined reference to `__stderrp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:412: undefined reference to `__stdoutp'
ld: megahal.o: in function `initialize_status':
/home/tyson/Orion/user/apps/system/megahal.c:839: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:839: undefined reference to `fclose'
ld: megahal.o: in function `initialize_error':
/home/tyson/Orion/user/apps/system/megahal.c:783: undefined reference to `__stderrp'
ld: megahal.o: in function `megahal_initialize':
/home/tyson/Orion/user/apps/system/megahal.c:425: undefined reference to `__stdoutp'
ld: /home/tyson/Orion/user/apps/system/megahal.c:425: undefined reference to `fwrite'
ld: megahal.o: in function `initialize_status':
/home/tyson/Orion/user/apps/system/megahal.c:843: undefined reference to `__stdoutp'
ld: megahal.o: in function `exithal':
/home/tyson/Orion/user/apps/system/megahal.c:675: undefined reference to `exit'
ld: megahal.o: in function `free_tree':
/home/tyson/Orion/user/apps/system/megahal.c:1301: undefined reference to `free'
ld: megahal.o: in function `typein':
/home/tyson/Orion/user/apps/system/megahal.c:2906: undefined reference to `usleep'
ld: megahal.o: in function `free_swap':
/home/tyson/Orion/user/apps/system/megahal.c:2817: undefined reference to `free'
ld: ../../lib/liblinux.a(fopen.o): in function `fopen':
/home/tyson/Orion/user/lib/linux/fopen.c:62: undefined reference to `__sfp'
ld: /home/tyson/Orion/user/lib/linux/fopen.c:64: undefined reference to `_open'
ld: /home/tyson/Orion/user/lib/linux/fopen.c:77: undefined reference to `_close'
ld: /home/tyson/Orion/user/lib/linux/fopen.c:78: undefined reference to `__error'
ld: ../../lib/liblinux.a(flags.o): in function `__sflags':
/home/tyson/Orion/user/lib/linux/flags.c:113: undefined reference to `__error'
make: *** [../../Mk/l4.prog.mk:54: syslaunch] Error 1
tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user/apps/system$ 

@vmlemon
Copy link
Owner Author

vmlemon commented Oct 3, 2019

V2Lin now gets to:

===> Making dependencies in .
===> crt0-amd64.S
gcc -I../../include -I../.. -I/usr/lib/gcc/x86_64-linux-gnu/8/include   -nostdinc -g -O2 -m64 -mno-red-zone   -fno-stack-protector -lssp -O2 -g -Wall -Wshadow   -fno-stack-protector  -Wconversion -c crt0-amd64.S -o crt0-amd64.o
===> syslaunch.cc
gcc -x c++ -I../../include -I../.. -I/usr/lib/gcc/x86_64-linux-gnu/8/include   -nostdinc -g -O2 -m64 -mno-red-zone   -fno-stack-protector -lssp -O2 -g -Wall -Wshadow   -fno-stack-protector  -Wconversion -fno-exceptions -c syslaunch.cc -o syslaunch.o
In file included from syslaunch.h:7,
                 from syslaunch.cc:1:
../../include/l4io.h:46:6: warning: declaration of ‘void putc(int)’ conflicts with built-in declaration ‘int putc(int, void*)’ [-Wbuiltin-declaration-mismatch]
 void putc(int c);
      ^~~~
syslaunch.cc: In function ‘int main()’:
syslaunch.cc:98:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘L4_Word64_t’ {aka ‘long unsigned int’} [-Wformat=]
     printf("The clock says: %d\n", L4_SystemClock().raw);
            ^~~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~~~~~~
In file included from ../../include/l4/kip.h:36,
                 from ../../include/l4/sigma0.h:36,
                 from syslaunch.h:8,
                 from syslaunch.cc:1:
../../include/l4/amd64/syscalls.h: In function ‘L4_Clock_t L4_SystemClock()’:
../../include/l4/amd64/syscalls.h:197:19: warning: ‘ret.L4_Clock_t::raw’ is used uninitialized in this function [-Wuninitialized]
  [dest]  "0" (ret.raw)  /* %1 RAX */
               ~~~~^~~
../../include/l4/amd64/syscalls.h: In function ‘int main()’:
../../include/l4/amd64/syscalls.h:201:3: warning: ‘ret.L4_Clock_t::raw’ is used uninitialized in this function [-Wuninitialized]
  );
   ^
../../include/l4/amd64/syscalls.h:187:16: note: ‘ret.L4_Clock_t::raw’ was declared here
     L4_Clock_t ret;
                ^~~
===> v2lin_v02/lib/lwdLib.c
gcc -I../../include -I../.. -I/usr/lib/gcc/x86_64-linux-gnu/8/include   -nostdinc -g -O2 -m64 -mno-red-zone   -fno-stack-protector -lssp -O2 -g -Wall -Wshadow   -fno-stack-protector  -Wconversion -std=c99 -c v2lin_v02/lib/lwdLib.c -o v2lin_v02/lib/lwdLib.o
In file included from v2lin_v02/lib/lwdLib.c:28:
../../include/stdio.h: In function ‘__sputc’:
../../include/stdio.h:460:23: warning: conversion from ‘int’ to ‘unsigned char’ may change value [-Wconversion]
   return (*_p->_p++ = _c);
                       ^~
In file included from ../../include/string.h:2,
                 from v2lin_v02/lib/lwdLib.c:29:
../../include/sys/types.h: In function ‘__bitcount16’:
../../include/sys/types.h:327:7: warning: conversion from ‘int’ to ‘__uint16_t’ {aka ‘short unsigned int’} may change value [-Wconversion]
  _x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1);
       ^
../../include/sys/types.h:328:7: warning: conversion from ‘int’ to ‘__uint16_t’ {aka ‘short unsigned int’} may change value [-Wconversion]
  _x = (_x & 0x3333) + ((_x & 0xcccc) >> 2);
       ^
In file included from ../../include/sys/types.h:376,
                 from ../../include/string.h:2,
                 from v2lin_v02/lib/lwdLib.c:29:
../../include/sys/select.h: At top level:
../../include/sys/select.h:105:54: warning: ‘struct timeval’ declared inside parameter list will not be visible outside of this definition or declaration
 int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
                                                      ^~~~~~~
In file included from ../../include/string.h:2,
                 from v2lin_v02/lib/lwdLib.c:29:
../../include/sys/types.h: In function ‘__major’:
../../include/sys/types.h:393:36: warning: conversion from ‘dev_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff));
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
../../include/sys/types.h: In function ‘__minor’:
../../include/sys/types.h:399:32: warning: conversion from ‘dev_t’ {aka ‘long unsigned int’} to ‘int’ may change value [-Wconversion]
  return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff));
         ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
../../include/sys/types.h: In function ‘__makedev’:
../../include/sys/types.h:405:26: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
  return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
                          ^
../../include/sys/types.h:405:47: warning: conversion to ‘long unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
  return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
                                               ^
../../include/sys/types.h:406:49: warning: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Wsign-conversion]
      ((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff));
                                                 ^
In file included from v2lin_v02/lib/internal.h:29,
                 from v2lin_v02/lib/lwdLib.c:33:
v2lin_v02/lib/v2lpthread.h: At top level:
v2lin_v02/lib/v2lpthread.h:68:2: error: unknown type name ‘pthread_attr_t’
  pthread_attr_t attr;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:69:21: error: field ‘prv_priority’ has incomplete type
  struct sched_param prv_priority;
                     ^~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:80:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t tdelete_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:81:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t t_deletable;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:84:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t dbcst_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:85:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t delete_bcplt;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/v2lpthread.h:95:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t *waiting_m;
  ^~~~~~~~~~~~~~~
In file included from v2lin_v02/lib/lwdLib.c:33:
v2lin_v02/lib/internal.h:37:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t wdog_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:47:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t sem_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:48:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t sem_send;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:52:2: error: unknown type name ‘pthread_mutex_t’
  pthread_mutex_t smdel_lock;
  ^~~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:53:2: error: unknown type name ‘pthread_cond_t’
  pthread_cond_t smdel_cplt;
  ^~~~~~~~~~~~~~
v2lin_v02/lib/internal.h:83:8: error: unknown type name ‘pthread_mutex_t’
 extern pthread_mutex_t task_list_lock;
        ^~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:43:8: error: unknown type name ‘pthread_mutex_t’
 static pthread_mutex_t wdog_list_lock = PTHREAD_MUTEX_INITIALIZER;
        ^~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:43:41: error: ‘PTHREAD_MUTEX_INITIALIZER’ undeclared here (not in a function)
 static pthread_mutex_t wdog_list_lock = PTHREAD_MUTEX_INITIALIZER;
                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘wdog_valid’:
v2lin_v02/lib/lwdLib.c:60:2: warning: implicit declaration of function ‘pthread_cleanup_push’ [-Wimplicit-function-declaration]
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:60:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c:60:42: note: each undeclared identifier is reported only once for each function it appears in
v2lin_v02/lib/lwdLib.c:61:2: warning: implicit declaration of function ‘pthread_mutex_lock’; did you mean ‘pthread_mutex_clean_lock’? [-Wimplicit-function-declaration]
  pthread_mutex_lock(&wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~
  pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c:81:2: warning: implicit declaration of function ‘pthread_cleanup_pop’ [-Wimplicit-function-declaration]
  pthread_cleanup_pop(1);
  ^~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c: In function ‘link_wdog’:
v2lin_v02/lib/lwdLib.c:93:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c: In function ‘unlink_wdog’:
v2lin_v02/lib/lwdLib.c:132:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &wdog_list_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c: In function ‘process_tick_for’:
v2lin_v02/lib/lwdLib.c:215:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c:229:5: warning: implicit declaration of function ‘pthread_mutex_unlock’; did you mean ‘pthread_mutex_clean_lock’? [-Wimplicit-function-declaration]
     pthread_mutex_unlock(&wdId->wdog_lock);
     ^~~~~~~~~~~~~~~~~~~~
     pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c:229:5: warning: declaration of ‘pthread_mutex_unlock’ shadows previous non-variable [-Wshadow]
v2lin_v02/lib/lwdLib.c: In function ‘wdCancel’:
v2lin_v02/lib/lwdLib.c:271:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c: In function ‘wdCreate’:
v2lin_v02/lib/lwdLib.c:296:3: warning: implicit declaration of function ‘pthread_mutex_init’; did you mean ‘pthread_kill’? [-Wimplicit-function-declaration]
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
   ^~~~~~~~~~~~~~~~~~
   pthread_kill
v2lin_v02/lib/lwdLib.c:296:47: error: ‘pthread_mutexattr_t’ undeclared (first use in this function); did you mean ‘pthread_mutex’?
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
                                               ^~~~~~~~~~~~~~~~~~~
                                               pthread_mutex
v2lin_v02/lib/lwdLib.c:296:68: error: expected expression before ‘)’ token
   pthread_mutex_init(&(new_wdog->wdog_lock), (pthread_mutexattr_t *) NULL);
                                                                    ^
v2lin_v02/lib/lwdLib.c: In function ‘wdDelete’:
v2lin_v02/lib/lwdLib.c:313:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, (void *) &(wdId->wdog_lock));
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c: In function ‘wdStart’:
v2lin_v02/lib/lwdLib.c:335:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, &wdId->wdog_lock);
                                          ^~~~~~~~~~~~~~~~~~~~
                                          pthread_mutex_clean_lock
v2lin_v02/lib/lwdLib.c: In function ‘self_starter’:
v2lin_v02/lib/lwdLib.c:384:3: warning: implicit declaration of function ‘pthread_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
   pthread_create(&(task->pthrid), &(task->attr), task_wrapper, (void *) task);
   ^~~~~~~~~~~~~~
   timer_create
In file included from v2lin_v02/lib/lwdLib.c:33:
v2lin_v02/lib/lwdLib.c: In function ‘wdogShow’:
v2lin_v02/lib/internal.h:92:42: error: ‘pthread_mutex_unlock’ undeclared (first use in this function); did you mean ‘pthread_mutex_clean_lock’?
  pthread_cleanup_push((void (*)(void *)) pthread_mutex_unlock, m); \
                                          ^~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:413:2: note: in expansion of macro ‘pthread_mutex_clean_lock’
  pthread_mutex_clean_lock(&wdog_list_lock);
  ^~~~~~~~~~~~~~~~~~~~~~~~
v2lin_v02/lib/lwdLib.c:415:17: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void (*)(int)’ [-Wformat=]
   fprintf(out,"%x %i %i\n", wd->timeout_func, wd->ticks_remaining, wd->timeout_parm);
                ~^           ~~~~~~~~~~~~~~~~
make: *** [../../Mk/l4.build.mk:62: v2lin_v02/lib/lwdLib.o] Error 1
tyson@tyson-Lenovo-ideapad-120S-14IAP:~/Orion/user/apps/system$ 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Linux
Projects
None yet
Development

No branches or pull requests

1 participant