pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

self-git: first part of porting to NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Jul 22 02:30:21 2019 +0200
Changeset:	17ddc824bdd228159cf97ede125a59ef69c24ccc

Modified Files:
	self-git/distinfo
Added Files:
	self-git/patches/patch-vm_cmake_netbsd.cmake
	self-git/patches/patch-vm_cmake_platform.cmake
	self-git/patches/patch-vm_src_unix_os_os__includes__unix.hh
	self-git/patches/patch-vm_src_unix_os_os__unix.cpp
	self-git/patches/patch-vm_src_unix_os_os__unix.hh
	self-git/patches/patch-vm_src_unix_os_sig__unix.hh

Log Message:
self-git: first part of porting to NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=17ddc824bdd228159cf97ede125a59ef69c24ccc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 self-git/distinfo                                  |  6 ++
 self-git/patches/patch-vm_cmake_netbsd.cmake       | 63 ++++++++++++++++++++
 self-git/patches/patch-vm_cmake_platform.cmake     | 27 +++++++++
 .../patch-vm_src_unix_os_os__includes__unix.hh     | 68 ++++++++++++++++++++++
 self-git/patches/patch-vm_src_unix_os_os__unix.cpp | 61 +++++++++++++++++++
 self-git/patches/patch-vm_src_unix_os_os__unix.hh  | 18 ++++++
 self-git/patches/patch-vm_src_unix_os_sig__unix.hh | 14 +++++
 7 files changed, 257 insertions(+)

diffs:
diff --git a/self-git/distinfo b/self-git/distinfo
index afc76512f4..ab20254a37 100644
--- a/self-git/distinfo
+++ b/self-git/distinfo
@@ -1,2 +1,8 @@
 $NetBSD$
 
+SHA1 (patch-vm_cmake_netbsd.cmake) = b124b0d960c1ae73927e262176d52c9a50ef23da
+SHA1 (patch-vm_cmake_platform.cmake) = 390b55a1fecd0263c1c9eb7c2fa9aec8edd7dc9b
+SHA1 (patch-vm_src_unix_os_os__includes__unix.hh) = be0a5cd0a1328c84a7a4fc5415553aa2b680699a
+SHA1 (patch-vm_src_unix_os_os__unix.cpp) = f41ce3619a5b4fe89887a435a80c2ad740b4c926
+SHA1 (patch-vm_src_unix_os_os__unix.hh) = afc4d067f5737af892ef72b75342d2bb62dc3b4f
+SHA1 (patch-vm_src_unix_os_sig__unix.hh) = 2d0beed746b8568582a91277e2891d949e7f6395
diff --git a/self-git/patches/patch-vm_cmake_netbsd.cmake b/self-git/patches/patch-vm_cmake_netbsd.cmake
new file mode 100644
index 0000000000..cf2772b5c3
--- /dev/null
+++ b/self-git/patches/patch-vm_cmake_netbsd.cmake
@@ -0,0 +1,63 @@
+$NetBSD$
+
+--- vm/cmake/netbsd.cmake.orig	2019-07-21 23:10:42.764519867 +0000
++++ vm/cmake/netbsd.cmake
+@@ -0,0 +1,58 @@
++#!/usr/bin/env cmake
++
++set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
++
++
++set(SELF_PREFIX_PREFIX_THRESHOLD_INIT
++  "35" # DO NOT SET BELOW 35. Breaks X-includes!
++)
++
++set(SELF_X11_INIT ON)
++
++
++# Threads
++enable_language(C)
++find_package(Threads REQUIRED)
++set(EXTRA_LIBRARIES ${EXTRA_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
++
++
++#
++# NetBSD compile definitons
++#
++list(APPEND _defines
++  -DDEBUG
++  -DGLUE_CHECKSUM=0
++)
++
++set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
++set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -m32")
++list(APPEND _flags -m32)
++list(APPEND CMAKE_REQUIRED_DEFINITIONS -m32)
++set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
++
++if(clang)
++  #
++  # clang 3.0 integrated assembler on linux
++  # seems not to produce 32bit jump targets
++  # for global labels, so revert back to
++  # binutils as. *sigh*
++  #
++  set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -no-integrated-as -DNO_INTEGRATED_AS_clang")
++endif()
++
++#
++# "API". Set up target specific stuff.
++#
++macro(setup_target target)
++  # "super"
++  setup_target_common(${target})
++endmacro()
++
++
++#
++# "API". Setup prefix headers
++#
++macro(include_prefix_header target file)
++  # "super"
++  include_prefix_header_common(${target} ${file})
++endmacro()
diff --git a/self-git/patches/patch-vm_cmake_platform.cmake b/self-git/patches/patch-vm_cmake_platform.cmake
new file mode 100644
index 0000000000..48aa0bfa23
--- /dev/null
+++ b/self-git/patches/patch-vm_cmake_platform.cmake
@@ -0,0 +1,27 @@
+$NetBSD$
+
+--- vm/cmake/platform.cmake.orig	2019-07-21 22:47:42.000000000 +0000
++++ vm/cmake/platform.cmake
+@@ -53,6 +53,15 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "(Solar
+   set(platform_name "Solaris")  
+   set(platform "svr4")
+   set(TARGET_OS_VERSION "SOLARIS_VERSION")
++
++elseif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
++  
++  set(platform_kind "unix")
++  set(TARGET_OS_FAMILY  "UNIX_FAMILY")
++  
++  set(platform_name "NetBSD")
++  set(platform "netbsd")
++  set(TARGET_OS_VERSION "NETBSD_VERSION")
+   
+ else()
+   
+@@ -87,6 +96,3 @@ mark_as_advanced(DYNAMIC COMPILER TARGET
+ 
+ 
+ message(STATUS "Preparing for ${platform_name} on ${platform_processor}")
+-
+-
+-
diff --git a/self-git/patches/patch-vm_src_unix_os_os__includes__unix.hh b/self-git/patches/patch-vm_src_unix_os_os__includes__unix.hh
new file mode 100644
index 0000000000..e913b0ffa0
--- /dev/null
+++ b/self-git/patches/patch-vm_src_unix_os_os__includes__unix.hh
@@ -0,0 +1,68 @@
+$NetBSD$
+
+--- vm/src/unix/os/os_includes_unix.hh.orig	2019-07-21 22:47:42.000000000 +0000
++++ vm/src/unix/os/os_includes_unix.hh
+@@ -41,7 +41,7 @@ extern "C" { 
+ }
+ 
+ # include <stdlib.h>
+-#if TARGET_OS_VERSION != MACOSX_VERSION
++#if TARGET_OS_VERSION != MACOSX_VERSION && TARGET_OS_VERSION != NETBSD_VERSION
+ # include <alloca.h>
+ #endif
+ 
+@@ -78,6 +78,8 @@ extern "C" { 
+ #   include <termios.h>
+ #   include <sys/ioctl.h>
+ #   include <pthread.h>
++# elif TARGET_OS_VERSION == NETBSD_VERSION
++#   include <termios.h>
+ # else
+ #   include <termio.h>
+ # endif
+@@ -103,7 +105,8 @@ extern "C" { 
+   typedef sigcontext       self_sig_context_t;
+   typedef struct sigstack  self_stack_t;
+ # elif TARGET_OS_VERSION == MACOSX_VERSION \
+-    || TARGET_OS_VERSION ==  LINUX_VERSION
++    || TARGET_OS_VERSION ==  LINUX_VERSION \
++    || TARGET_OS_VERSION ==  NETBSD_VERSION
+   typedef siginfo_t        self_code_info_t;
+   typedef ucontext_t       self_sig_context_t;
+   typedef stack_t          self_stack_t;
+@@ -164,7 +167,8 @@ extern "C" {
+ 
+ 
+ # if TARGET_OS_VERSION != SOLARIS_VERSION  \
+-  && TARGET_OS_VERSION != LINUX_VERSION
++  && TARGET_OS_VERSION != LINUX_VERSION \
++  && TARGET_OS_VERSION != NETBSD_VERSION
+   #  include <sys/vadvise.h>
+    extern "C" {
+      int vadvise(int);
+@@ -205,6 +209,8 @@ extern "C" {
+ # define FORK vfork
+ # elif  TARGET_OS_VERSION == LINUX_VERSION
+ # define FORK vfork
++# elif  TARGET_OS_VERSION == NETBSD_VERSION
++# define FORK vfork
+ # else
+    error which?
+ #endif
+@@ -228,7 +234,8 @@ const int Last_OS_Signal = SIGUSR2+1+20;
+ 
+ # if  TARGET_OS_VERSION == SOLARIS_VERSION \
+   ||  TARGET_OS_VERSION ==  MACOSX_VERSION \
+-  ||  TARGET_OS_VERSION ==   LINUX_VERSION
++  ||  TARGET_OS_VERSION ==   LINUX_VERSION \
++  ||  TARGET_OS_VERSION ==  NETBSD_VERSION
+ 
+   typedef void (*Signal_Handler_t)(int sig, self_code_info_t *info, self_sig_context_t *con);
+ 
+@@ -247,4 +254,4 @@ extern "C" { int malloc_verify(); }
+ 
+ # if TARGET_OS_VERSION == MACOSX_VERSION
+   typedef size_t nbytes_t;
+-# endif
+\ No newline at end of file
++# endif
diff --git a/self-git/patches/patch-vm_src_unix_os_os__unix.cpp b/self-git/patches/patch-vm_src_unix_os_os__unix.cpp
new file mode 100644
index 0000000000..395d0c1768
--- /dev/null
+++ b/self-git/patches/patch-vm_src_unix_os_os__unix.cpp
@@ -0,0 +1,61 @@
+$NetBSD$
+
+--- vm/src/unix/os/os_unix.cpp.orig	2019-07-21 22:47:42.000000000 +0000
++++ vm/src/unix/os/os_unix.cpp
+@@ -195,6 +195,17 @@ void OS::init() {
+   len = sizeof(mem_size);
+   sysctl(mib, 2, &mem_size, &len, NULL, 0);
+   real_mem_size = mem_size;
++# elif  TARGET_OS_VERSION ==  NETBSD_VERSION
++
++  int mib[2];
++  int64_t mem_size;
++  size_t len;
++
++  mib[0] = CTL_HW;
++  mib[1] = HW_USERMEM64;
++  len = sizeof(mem_size);
++  sysctl(mib, 2, &mem_size, &len, NULL, 0);
++  real_mem_size = mem_size;
+ # elif TARGET_OS_VERSION == LINUX_VERSION
+   real_mem_size = 0x40000000; // punt for now
+ # else
+@@ -348,7 +359,8 @@ bool OS::setup_snapshot_to_run(const cha
+ void OS::set_log_buf(FILE* f, char* buf, int bs) {    
+ # if  TARGET_OS_VERSION == SOLARIS_VERSION \
+   ||  TARGET_OS_VERSION ==  MACOSX_VERSION \
+-  ||  TARGET_OS_VERSION ==   LINUX_VERSION
++  ||  TARGET_OS_VERSION ==   LINUX_VERSION \
++  ||  TARGET_OS_VERSION ==  NETBSD_VERSION
+   setvbuf(f, buf, _IOFBF, bs);
+   
+ # elif  TARGET_OS_VERSION == SUNOS_VERSION
+@@ -403,7 +415,8 @@ bool OS::get_swap_space_info(int &totalK
+ 
+ # elif  TARGET_OS_VERSION ==  SUNOS_VERSION \
+     ||  TARGET_OS_VERSION == MACOSX_VERSION \
+-    ||  TARGET_OS_VERSION ==  LINUX_VERSION
++    ||  TARGET_OS_VERSION ==  LINUX_VERSION \
++    ||  TARGET_OS_VERSION == NETBSD_VERSION
+ 
+ bool OS::get_swap_space_info(int &, int &) {
+   return false;
+@@ -559,7 +572,7 @@ int OS::min_core(caddr_t addr, size_t le
+     normal_access((char*)0, (char*)~0);
+   }
+ 
+-# elif  TARGET_OS_VERSION == LINUX_VERSION
++# elif  TARGET_OS_VERSION == LINUX_VERSION || TARGET_OS_VERSION == NETBSD_VERSION
+   void OS::setPageAdvisory(char *start, char *end, int code) {
+     if (end - start < OS::dont_bother) return;
+     char *ps= real_page_start(start);
+@@ -843,7 +856,8 @@ void OS::check_events() { 
+ 
+ # if  TARGET_OS_VERSION == SOLARIS_VERSION \
+   ||  TARGET_OS_VERSION ==  MACOSX_VERSION \
+-  ||  TARGET_OS_VERSION ==  LINUX_VERSION
++  ||  TARGET_OS_VERSION ==  LINUX_VERSION \
++  ||  TARGET_OS_VERSION == NETBSD_VERSION
+ extern "C" {
+   int malloc_verify() { return 1; }
+ }
diff --git a/self-git/patches/patch-vm_src_unix_os_os__unix.hh b/self-git/patches/patch-vm_src_unix_os_os__unix.hh
new file mode 100644
index 0000000000..68df45718c
--- /dev/null
+++ b/self-git/patches/patch-vm_src_unix_os_os__unix.hh
@@ -0,0 +1,18 @@
+$NetBSD$
+
+--- vm/src/unix/os/os_unix.hh.orig	2019-07-21 22:47:42.000000000 +0000
++++ vm/src/unix/os/os_unix.hh
+@@ -14,6 +14,8 @@
+   || TARGET_OS_VERSION == MACOSX_VERSION \
+   || TARGET_OS_VERSION == LINUX_VERSION
+      static const int logname_max = 8; 
++# elif TARGET_OS_VERSION == NETBSD_VERSION
++     static const int logname_max = MAXLOGNAME;
+ # else
+      static const int logname_max = LOGNAME_MAX;
+ # endif
+@@ -30,4 +32,3 @@
+   ||  TARGET_OS_VERSION ==  LINUX_VERSION
+     static void setPageAdvisory(char *start, char *end, int code);
+ # endif
+-
diff --git a/self-git/patches/patch-vm_src_unix_os_sig__unix.hh b/self-git/patches/patch-vm_src_unix_os_sig__unix.hh
new file mode 100644
index 0000000000..f8fcbd7fb9
--- /dev/null
+++ b/self-git/patches/patch-vm_src_unix_os_sig__unix.hh
@@ -0,0 +1,14 @@
+$NetBSD$
+
+--- vm/src/unix/os/sig_unix.hh.orig	2019-07-21 22:47:42.000000000 +0000
++++ vm/src/unix/os/sig_unix.hh
+@@ -42,7 +42,8 @@
+ // So we use common code for both platforms as much as possible. -mabdelmalek 10/02
+ # if  TARGET_OS_VERSION == SOLARIS_VERSION  \
+   ||  TARGET_OS_VERSION ==  MACOSX_VERSION  \
+-  ||  TARGET_OS_VERSION ==   LINUX_VERSION
++  ||  TARGET_OS_VERSION ==   LINUX_VERSION  \
++  ||  TARGET_OS_VERSION ==  NETBSD_VERSION
+    static int install_flags() { return SA_ONSTACK | SA_SIGINFO | SA_RESTART; }
+ # elif TARGET_OS_VERSION == SUNOS_VERSION
+    static int install_flags() { return SA_ONSTACK; /* ! SA_INTERRUPT */ }


Home | Main Index | Thread Index | Old Index