From 84a57f8fa0357436574aca0c2ac06bbf1dfdb5fb Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 3 Jun 2019 13:06:58 -0600 Subject: [PATCH] Fix several ZNeo compile issues. There are more. Pthreads: Fix a could of places where FAR was added when it is not appropriate. This matters to ZNeo which depends on definitions of NEAR and FAR points. --- configs/ez80f910200zco/README.txt | 29 +++++++++++++++---- configs/z16f2800100zcog/scripts/Make.defs | 21 +++++++------- include/nuttx/signal.h | 9 +++--- include/pthread.h | 4 +-- libs/libc/pthread/pthread_attr_getstacksize.c | 3 +- sched/pthread/pthread_get_stackaddr_np.c | 2 +- sched/pthread/pthread_get_stacksize_np.c | 2 +- 7 files changed, 46 insertions(+), 24 deletions(-) diff --git a/configs/ez80f910200zco/README.txt b/configs/ez80f910200zco/README.txt index c2f26007db..0840e84b5a 100644 --- a/configs/ez80f910200zco/README.txt +++ b/configs/ez80f910200zco/README.txt @@ -62,11 +62,30 @@ Version 5.2.1 Version 5.3.0 - I started verification using 5.30 on June 2, 2019. There are lots of - compile issues; most look like compiler problems (but only a single - internal error). Other errors are the consequence of commits to the - OS that did not follow C89. It will take some time to get a clean - compile again. + I started verification using 5.30 on June 2, 2019. To you this toolchain, I had to suppress the gmtime() and gmtimer() because these were causing an internal compiler error: + + time\lib_gmtimer.c + P2: Internal Error(0xB47E59): + Please contact Technical Support + + This is the change to suppress building these files: + + diff --git a/libs/libc/time/Make.defs b/libs/libc/time/Make.defs + index 5c9b746778..8327e287f4 100644 + --- a/libs/libc/time/Make.defs + +++ b/libs/libc/time/Make.defs + @@ -44,7 +44,7 @@ ifdef CONFIG_LIBC_LOCALTIME + CSRCS += lib_localtime.c lib_asctime.c lib_asctimer.c lib_ctime.c + CSRCS += lib_ctimer.c + else + -CSRCS += lib_mktime.c lib_gmtime.c lib_gmtimer.c + +CSRCS += lib_mktime.c # lib_gmtime.c lib_gmtimer.c + ifdef CONFIG_TIME_EXTENDED + CSRCS += lib_dayofweek.c lib_asctime.c lib_asctimer.c lib_ctime.c + CSRCS += lib_ctimer.c + + The consequence is, of course, that these interfaces will not be available + to applications. Other Versions If you use any version of ZDS-II other than 5.1.1, 5.2.1, or 5.3.0 or diff --git a/configs/z16f2800100zcog/scripts/Make.defs b/configs/z16f2800100zcog/scripts/Make.defs index fd896c438c..c9ae6a14d2 100644 --- a/configs/z16f2800100zcog/scripts/Make.defs +++ b/configs/z16f2800100zcog/scripts/Make.defs @@ -57,7 +57,7 @@ ZDSVERSION := 5.2.1 endif ifeq ($(CONFIG_WINDOWS_NATIVE),y) - ZDSINSTALLDIR = $(INSTALLROOT)/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) + ZDSINSTALLDIR = $(INSTALLROOT)/ZDSII_ZNEO_$(ZDSVERSION) INSTALLDIR = ${shell echo $(ZDSINSTALLDIR)| sed -e "s/\//\\/g"} ZDSBINDIR = $(INSTALLDIR)\bin ZDSSTDINCDIR = $(INSTALLDIR)\include\std @@ -73,7 +73,7 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) ARCHUSRINCLUDES = -usrinc:. else WINTOOL = y - ZDSINSTALLDIR = $(INSTALLROOT)/ZiLOG/ZDSII_ZNEO_$(ZDSVERSION) + ZDSINSTALLDIR = $(INSTALLROOT)/ZDSII_ZNEO_$(ZDSVERSION) INSTALLDIR = ${shell cygpath -u "$(ZDSINSTALLDIR)"} ZDSBINDIR = $(INSTALLDIR)/bin ZDSSTDINCDIR = $(INSTALLDIR)/include/std @@ -156,11 +156,11 @@ LINKCMDTEMPLATE = $(TOPDIR)$(DELIM)configs$(DELIM)z16f2800100zcog$(DELIM)scripts # Tool names/pathes CROSSDEV = -CC = zneocc.exe +CC = $(ZDSBINDIR)$(DELIM)zneocc.exe CPP = gcc -E -LD = zneolink.exe -AS = zneoasm.exe -AR = zneolib.exe +LD = $(ZDSBINDIR)$(DELIM)zneolink.exe +AS = $(ZDSBINDIR)$(DELIM)zneoasm.exe +AR = $(ZDSBINDIR)$(DELIM)zneolib.exe # File extensions @@ -216,11 +216,11 @@ define PREPROCESS endef define COMPILE - $(Q) (wfile=`cygpath -w "$1"`; "$(CC)" $(CFLAGS) $$wfile) + $(Q) "$(CC)" $(CFLAGS) `cygpath -w "$1"` endef define ASSEMBLE - $(Q) (wfile=`cygpath -w "$1"`; "$(AS)" $(AFLAGS) $$wfile) + $(Q) "$(AS)" $(AFLAGS) `cygpath -w "$1"` endef define MOVEOBJ @@ -252,7 +252,8 @@ ifeq ($(CONFIG_WINDOWS_NATIVE),y) # Windows-native host tools - MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + #MKDEP = $(TOPDIR)\tools\mkdeps.exe --winnative + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh else # Linux/Cygwin host tool definitions @@ -264,7 +265,7 @@ else # This is the tool to use for dependencies (i.e., none) - MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mkwindeps.sh + MKDEP = $(TOPDIR)$(DELIM)tools$(DELIM)mknulldeps.sh # ZDS-II cannot follow Cygwin soft links, so we will have to use directory copies diff --git a/include/nuttx/signal.h b/include/nuttx/signal.h index d3cfcd337c..5e22064b08 100644 --- a/include/nuttx/signal.h +++ b/include/nuttx/signal.h @@ -41,12 +41,13 @@ ****************************************************************************/ #include -#include #include #include #include +#include + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -281,7 +282,7 @@ int nxsig_kill(pid_t pid, int signo); * This is an internal OS interface. It is functionally equivalent to * sigwaitinfo() except that: * - * - It is not a cancellaction point, and + * - It is not a cancellation point, and * - It does not modify the errno value. * * Input Parameters: @@ -403,7 +404,7 @@ int nxsig_nanosleep(FAR const struct timespec *rqtp, * This is an internal OS interface. It is functionally equivalent to * the standard sleep() application interface except that: * - * - It is not a cancellaction point, and + * - It is not a cancellation point, and * - There is no check that the action of the signal is to invoke a * signal-catching function or to terminate the process. * @@ -437,7 +438,7 @@ unsigned int nxsig_sleep(unsigned int seconds); * This is an internal OS interface. It is functionally equivalent to * the standard nxsig_usleep() application interface except that: * - * - It is not a cancellaction point, and + * - It is not a cancellation point, and * - It does not modify the errno value. * * See the description of usleep() for additional information that is not diff --git a/include/pthread.h b/include/pthread.h index 11866ae584..679cdd0ede 100644 --- a/include/pthread.h +++ b/include/pthread.h @@ -475,8 +475,8 @@ int pthread_attr_getstack(FAR pthread_attr_t *attr, /* Get run-time stack address and size */ -FAR void *pthread_get_stackaddr_np(FAR pthread_t thread); -ssize_t pthread_get_stacksize_np(FAR pthread_t thread); +FAR void *pthread_get_stackaddr_np(pthread_t thread); +ssize_t pthread_get_stacksize_np(pthread_t thread); /* To create a thread object and runnable thread, a routine must be specified * as the new thread's start routine. An argument may be passed to this diff --git a/libs/libc/pthread/pthread_attr_getstacksize.c b/libs/libc/pthread/pthread_attr_getstacksize.c index 22b1915d1a..56dddb5830 100644 --- a/libs/libc/pthread/pthread_attr_getstacksize.c +++ b/libs/libc/pthread/pthread_attr_getstacksize.c @@ -63,7 +63,8 @@ * ****************************************************************************/ -int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, FAR size_t *stacksize) +int pthread_attr_getstacksize(FAR const pthread_attr_t *attr, + FAR size_t *stacksize) { int ret; diff --git a/sched/pthread/pthread_get_stackaddr_np.c b/sched/pthread/pthread_get_stackaddr_np.c index a22a7f7659..7a160667b0 100644 --- a/sched/pthread/pthread_get_stackaddr_np.c +++ b/sched/pthread/pthread_get_stackaddr_np.c @@ -63,7 +63,7 @@ * ****************************************************************************/ -void *pthread_get_stackaddr_np(FAR pthread_t thread) +void *pthread_get_stackaddr_np(pthread_t thread) { FAR struct pthread_tcb_s *tcb = (FAR struct pthread_tcb_s *)sched_gettcb((pid_t)thread); diff --git a/sched/pthread/pthread_get_stacksize_np.c b/sched/pthread/pthread_get_stacksize_np.c index 08e597cae4..74c2162238 100644 --- a/sched/pthread/pthread_get_stacksize_np.c +++ b/sched/pthread/pthread_get_stacksize_np.c @@ -65,7 +65,7 @@ * ****************************************************************************/ -ssize_t pthread_get_stacksize_np(FAR pthread_t thread) +ssize_t pthread_get_stacksize_np(pthread_t thread) { FAR struct pthread_tcb_s *tcb = (FAR struct pthread_tcb_s *)sched_gettcb((pid_t)thread);