]> granicus.if.org Git - gc/commitdiff
Fix 'undeclared identifier USRSTACK' compiler error on OpenBSD-6.2
authorPeter Wang <novalazy@gmail.com>
Wed, 24 Jan 2018 14:37:23 +0000 (17:37 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 24 Jan 2018 14:37:23 +0000 (17:37 +0300)
Issue #198 (bdwgc).

USRSTACK macro is defined in <machine/vmparam.h> but that is protected
by "ifdef _KERNEL" in <uvm/uvm_param.h>.

* include/private/gcconfig.h [POWERPC && OPENBSD && !GC_OPENBSD_THREADS]
(STACKBOTTOM): Add comment.
* include/private/gcconfig.h [(POWERPC || SPARC || I386 || MIPS
|| HP_PA || ALPHA || ARM32 || SH && !SH4 || X86_64) && OPENBSD
&& !GC_OPENBSD_THREADS] (STACKBOTTOM): Define only if USRSTACK is
defined.
* include/private/gcconfig.h [MIPS && OPENBSD]: Reformat code.

include/private/gcconfig.h

index 2bce23439a53b53bcf6970f409e60a3b82bca085..dd5b2e8201c75e259497516ed23dc8072f23a2e2 100644 (file)
 #     ifndef GC_OPENBSD_THREADS
 #       include <sys/param.h>
 #       include <uvm/uvm_extern.h>
-#       define STACKBOTTOM ((ptr_t)USRSTACK)
+        /* USRSTACK is defined in <machine/vmparam.h> but that is       */
+        /* protected by _KERNEL in <uvm/uvm_param.h> file.              */
+#       ifdef USRSTACK
+#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#       endif
 #     endif
       extern int __data_start[];
 #     define DATASTART ((ptr_t)__data_start)
 #     ifndef GC_OPENBSD_THREADS
 #       include <sys/param.h>
 #       include <uvm/uvm_extern.h>
-#       define STACKBOTTOM ((ptr_t)USRSTACK)
+#       ifdef USRSTACK
+#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#       endif
 #     endif
       extern int __data_start[];
 #     define DATASTART ((ptr_t)__data_start)
 #       ifndef GC_OPENBSD_THREADS
 #         include <sys/param.h>
 #         include <uvm/uvm_extern.h>
-#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#         ifdef USRSTACK
+#           define STACKBOTTOM ((ptr_t)USRSTACK)
+#         endif
 #       endif
         extern int __data_start[];
 #       define DATASTART ((ptr_t)__data_start)
 #     endif /* _ELF_ */
 #  endif
 #  ifdef OPENBSD
-#    define OS_TYPE "OPENBSD"
-#    define ALIGNMENT 4
+#     define OS_TYPE "OPENBSD"
+#     define ALIGNMENT 4
 #     ifndef GC_OPENBSD_THREADS
-#      include <sys/param.h>
-#      include <uvm/uvm_extern.h>
-#      define STACKBOTTOM ((ptr_t)USRSTACK)
-#    endif
-     extern int _fdata[];
-#    define DATASTART ((ptr_t)_fdata)
-     extern int _end[];
-#    define DATAEND ((ptr_t)(&_end))
-#    define DYNAMIC_LOADING
+#       include <sys/param.h>
+#       include <uvm/uvm_extern.h>
+#       ifdef USRSTACK
+#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#       endif
+#     endif
+      extern int _fdata[];
+#     define DATASTART ((ptr_t)_fdata)
+      extern int _end[];
+#     define DATAEND ((ptr_t)(&_end))
+#     define DYNAMIC_LOADING
 #  endif
 #  ifdef FREEBSD
 #    define OS_TYPE "FREEBSD"
 #     ifndef GC_OPENBSD_THREADS
 #       include <sys/param.h>
 #       include <uvm/uvm_extern.h>
-#       define STACKBOTTOM ((ptr_t)USRSTACK)
+#       ifdef USRSTACK
+#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#       endif
 #     endif
       extern int __data_start[];
 #     define DATASTART ((ptr_t)__data_start)
 #       ifndef GC_OPENBSD_THREADS
 #         include <sys/param.h>
 #         include <uvm/uvm_extern.h>
-#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#         ifdef USRSTACK
+#           define STACKBOTTOM ((ptr_t)USRSTACK)
+#         endif
 #       endif
         extern int __data_start[];
 #       define DATASTART ((ptr_t)__data_start)
 #     ifndef GC_OPENBSD_THREADS
 #       include <sys/param.h>
 #       include <uvm/uvm_extern.h>
-#       define STACKBOTTOM ((ptr_t)USRSTACK)
+#       ifdef USRSTACK
+#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#       endif
 #     endif
       extern int __data_start[];
 #     define DATASTART ((ptr_t)__data_start)
 #      ifndef GC_OPENBSD_THREADS
 #        include <sys/param.h>
 #        include <uvm/uvm_extern.h>
-#        define STACKBOTTOM ((ptr_t)USRSTACK)
+#        ifdef USRSTACK
+#          define STACKBOTTOM ((ptr_t)USRSTACK)
+#        endif
 #      endif
        extern int __data_start[];
 #      define DATASTART ((ptr_t)__data_start)
 #       ifndef GC_OPENBSD_THREADS
 #         include <sys/param.h>
 #         include <uvm/uvm_extern.h>
-#         define STACKBOTTOM ((ptr_t)USRSTACK)
+#         ifdef USRSTACK
+#           define STACKBOTTOM ((ptr_t)USRSTACK)
+#         endif
 #       endif
         extern int __data_start[];
         extern int _end[];