openwatcom: some patches were upstreamed.

This commit is contained in:
Adrien Destugues
2015-01-19 23:06:08 +01:00
parent af1b8eba0b
commit 871cecde3e
2 changed files with 187 additions and 305 deletions

View File

@@ -17,7 +17,7 @@ if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
fi
SECONDARY_ARCHITECTURES="x86"
SRC_URI="git@github.com:open-watcom/open-watcom-v2.git#7d23ba88ff2a81660b2a48e4b73d2fcbcb36b837"
SRC_URI="git@github.com:open-watcom/open-watcom-v2.git#a3b3e22c3a0266a93da5f7d67bc368ff34813449"
PATCHES="openwatcom-$portVersion.patchset"
PROVIDES="

View File

@@ -1,306 +1,4 @@
From d7a38595716dc02a6cc991acc3c1d4b700c15632 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 15 Jul 2014 12:57:37 +0200
Subject: let wasm know about Haiku.
diff --git a/bld/wasm/c/main.c b/bld/wasm/c/main.c
index 6fbcd0b..424341b 100644
--- a/bld/wasm/c/main.c
+++ b/bld/wasm/c/main.c
@@ -1065,6 +1065,8 @@ static bool set_build_target( void )
SetTargName( "QNX", 3 );
#elif defined(__LINUX__)
SetTargName( "LINUX", 5 );
+#elif defined(__HAIKU__)
+ SetTargName( "HAIKU", 5 );
#elif defined(__BSD__)
SetTargName( "BSD", 3 );
#elif defined(__OSX__) || defined(__APPLE__)
--
1.8.3.4
From 48aeab747fe564d9ddc88f712707cc60650cdb67 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 15 Jul 2014 18:54:26 +0200
Subject: Rename sched.h to avoid conflict with haiku headers.
diff --git a/bld/cg/c/dumpschd.c b/bld/cg/c/dumpschd.c
index 63d486c..9ec4504 100644
--- a/bld/cg/c/dumpschd.c
+++ b/bld/cg/c/dumpschd.c
@@ -38,7 +38,7 @@
#include "memout.h"
#include "procdef.h"
#include "freelist.h"
-#include "sched.h"
+#include "inssched.h"
#include "dumpio.h"
extern void DumpIns(instruction *);
diff --git a/bld/cg/c/inssched.c b/bld/cg/c/inssched.c
index dce35bd..3cb288e 100644
--- a/bld/cg/c/inssched.c
+++ b/bld/cg/c/inssched.c
@@ -36,7 +36,7 @@
#include "spawn.h"
#include "memout.h"
#include "freelist.h"
-#include "sched.h"
+#include "inssched.h"
#include "zoiks.h"
#include "data.h"
#include "x87.h"
diff --git a/bld/cg/h/inssched.h b/bld/cg/h/inssched.h
new file mode 100644
index 0000000..f44a87a
--- /dev/null
+++ b/bld/cg/h/inssched.h
@@ -0,0 +1,54 @@
+/****************************************************************************
+*
+* Open Watcom Project
+*
+* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
+*
+* ========================================================================
+*
+* This file contains Original Code and/or Modifications of Original
+* Code as defined in and that are subject to the Sybase Open Watcom
+* Public License version 1.0 (the 'License'). You may not use this file
+* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
+* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
+* provided with the Original Code and Modifications, and is also
+* available at www.sybase.com/developer/opensource.
+*
+* The Original Code and all software distributed under the License are
+* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
+* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
+* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
+* NON-INFRINGEMENT. Please see the License for the specific language
+* governing rights and limitations under the License.
+*
+* ========================================================================
+*
+* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
+* DESCRIBE IT HERE!
+*
+****************************************************************************/
+
+
+typedef struct FU_entry {
+ unsigned short good_fu;
+ byte unit_stall;
+ byte opnd_stall;
+} FU_entry;
+
+typedef struct data_dag {
+ struct data_dag *prev;
+ instruction *ins;
+ struct dep_list_entry *deps;
+ struct data_dag *ready;
+ unsigned stallable : 8;
+ unsigned visited : 1;
+ unsigned scheduled : 1;
+ instruction_id height;
+ instruction_id anc_count;
+} data_dag;
+
+typedef struct dep_list_entry {
+ struct dep_list_entry *next;
+ data_dag *dep;
+} dep_list_entry;
diff --git a/bld/cg/h/sched.h b/bld/cg/h/sched.h
deleted file mode 100644
index f44a87a..0000000
--- a/bld/cg/h/sched.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-*
-* Open Watcom Project
-*
-* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
-*
-* ========================================================================
-*
-* This file contains Original Code and/or Modifications of Original
-* Code as defined in and that are subject to the Sybase Open Watcom
-* Public License version 1.0 (the 'License'). You may not use this file
-* except in compliance with the License. BY USING THIS FILE YOU AGREE TO
-* ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
-* provided with the Original Code and Modifications, and is also
-* available at www.sybase.com/developer/opensource.
-*
-* The Original Code and all software distributed under the License are
-* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
-* EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
-* ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
-* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
-* NON-INFRINGEMENT. Please see the License for the specific language
-* governing rights and limitations under the License.
-*
-* ========================================================================
-*
-* Description: WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
-* DESCRIBE IT HERE!
-*
-****************************************************************************/
-
-
-typedef struct FU_entry {
- unsigned short good_fu;
- byte unit_stall;
- byte opnd_stall;
-} FU_entry;
-
-typedef struct data_dag {
- struct data_dag *prev;
- instruction *ins;
- struct dep_list_entry *deps;
- struct data_dag *ready;
- unsigned stallable : 8;
- unsigned visited : 1;
- unsigned scheduled : 1;
- instruction_id height;
- instruction_id anc_count;
-} data_dag;
-
-typedef struct dep_list_entry {
- struct dep_list_entry *next;
- data_dag *dep;
-} dep_list_entry;
diff --git a/bld/cg/intel/c/386funit.c b/bld/cg/intel/c/386funit.c
index 3761e0f..e6b9bb5 100644
--- a/bld/cg/intel/c/386funit.c
+++ b/bld/cg/intel/c/386funit.c
@@ -34,7 +34,7 @@
#include "coderep.h"
#include "indvars.h"
#include "model.h"
-#include "sched.h"
+#include "inssched.h"
enum {
F_NONE = 0x0000,
diff --git a/bld/cg/risc/axp/c/axpfunit.c b/bld/cg/risc/axp/c/axpfunit.c
index c4541f5..3f15bb4 100644
--- a/bld/cg/risc/axp/c/axpfunit.c
+++ b/bld/cg/risc/axp/c/axpfunit.c
@@ -34,7 +34,7 @@
#include "coderep.h"
#include "indvars.h"
#include "model.h"
-#include "sched.h"
+#include "inssched.h"
enum {
F_NONE = 0x0000,
diff --git a/bld/cg/risc/mps/c/mpsfunit.c b/bld/cg/risc/mps/c/mpsfunit.c
index 6474dbd..d23f170 100644
--- a/bld/cg/risc/mps/c/mpsfunit.c
+++ b/bld/cg/risc/mps/c/mpsfunit.c
@@ -33,7 +33,7 @@
#include "coderep.h"
#include "indvars.h"
#include "model.h"
-#include "sched.h"
+#include "inssched.h"
enum {
F_NONE = 0x0000,
diff --git a/bld/cg/risc/ppc/c/ppcfunit.c b/bld/cg/risc/ppc/c/ppcfunit.c
index 732f73b..1365b02 100644
--- a/bld/cg/risc/ppc/c/ppcfunit.c
+++ b/bld/cg/risc/ppc/c/ppcfunit.c
@@ -34,7 +34,7 @@
#include "coderep.h"
#include "indvars.h"
#include "model.h"
-#include "sched.h"
+#include "inssched.h"
enum {
F_NONE = 0x0000,
diff --git a/bld/cg/s37/c/s37funit.c b/bld/cg/s37/c/s37funit.c
index 658ad95..15c7e6a 100644
--- a/bld/cg/s37/c/s37funit.c
+++ b/bld/cg/s37/c/s37funit.c
@@ -35,7 +35,7 @@
#include "indvars.h"
#include "opcodes.h"
#include "model.h"
-#include "sched.h"
+#include "inssched.h"
#include "funits.h"
#include "pattern.h"
--
1.8.3.4
From 4e304b0ff86d62f71615cc5dc7d61f4ddd5ebc6c Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 15 Jul 2014 18:56:03 +0200
Subject: Implement cmdname for haiku.
The default implementation can't work when /proc is not available,
because it then fallbacks to _argv but is called before that is
initialised (eg in wlink).
diff --git a/bld/watcom/c/clibext.c b/bld/watcom/c/clibext.c
index 9eec4d6..26d8f20 100644
--- a/bld/watcom/c/clibext.c
+++ b/bld/watcom/c/clibext.c
@@ -1264,6 +1264,17 @@ char *_cmdname( char *name )
return( name );
}
+#elif defined (__HAIKU__)
+
+#include <image.h>
+
+char *_cmdname( char *name )
+{
+ image_info info;
+ get_image_info( 0, &info );
+ return( strcpy( name, info.name ) );
+}
+
#elif defined( __UNIX__ )
char *_cmdname( char *name )
--
1.8.3.4
From 31f32a11b8b69fe294a35c9a08fe880baabc4e56 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 15 Jul 2014 18:58:53 +0200
Subject: Let cc know about Haiku.
diff --git a/bld/cc/c/coptions.c b/bld/cc/c/coptions.c
index f0e9f41..8fbe651 100644
--- a/bld/cc/c/coptions.c
+++ b/bld/cc/c/coptions.c
@@ -282,6 +282,8 @@ local void SetTargSystem( void )
_SetConstTarg( "qnx" );
#elif defined( __LINUX__ )
_SetConstTarg( "linux" );
+ #elif defined( __HAIKU__ )
+ _SetConstTarg( "haiku" );
#elif defined( __SOLARIS__ ) || defined( __sun__ )
_SetConstTarg( "solaris" );
#elif defined( __OSX__ ) || defined( __APPLE__ )
--
1.8.3.4
From 274e3144905cb02dbafa193b79bb596ba67c9fa4 Mon Sep 17 00:00:00 2001
From 1b692403e242c2383cb1055e5fac6d3014920993 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 15 Jul 2014 19:39:16 +0200
Subject: Replace "local" with "static".
@@ -823,7 +521,7 @@ index 45a69b5..0ac6a97 100644
1.8.3.4
From 6470c82af223c0c5e912e1ef0218155971e6bd8e Mon Sep 17 00:00:00 2001
From eda63ead29387368ea13473af964ada010826c8e Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Sun, 18 Jan 2015 15:35:30 +0100
Subject: Adjust setvars.sh to Haiku build environment.
@@ -853,3 +551,187 @@ index a64d135..30bce44 100755
--
1.8.3.4
From a720938fa74b28394287eb1c4f13804520089948 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 19 Jan 2015 19:36:32 +0100
Subject: loadfind: long is 32-bit, off_t might be 64bit
Use the proper type to get the correct sign expansion effect.
diff --git a/bld/wres/c/loadfind.c b/bld/wres/c/loadfind.c
index 28b9529..c94ae26 100644
--- a/bld/wres/c/loadfind.c
+++ b/bld/wres/c/loadfind.c
@@ -61,7 +61,7 @@ unsigned char FindResources( PHANDLE_INFO hInstance )
/* look for the resource information in a debugger record at the end of file */
{
long currpos;
- long offset;
+ off_t offset;
dbgheader header;
bool notfound;
char buffer[sizeof( PATCH_LEVEL )];
@@ -69,7 +69,7 @@ unsigned char FindResources( PHANDLE_INFO hInstance )
notfound = true;
FileShift = 0;
offset = sizeof( dbgheader );
- if( WRESSEEK( hInstance->handle, -(long)sizeof( PATCH_LEVEL ), SEEK_END ) != -1 ) {
+ if( WRESSEEK( hInstance->handle, -(off_t)sizeof( PATCH_LEVEL ), SEEK_END ) != -1 ) {
if( WRESREAD( hInstance->handle, buffer, sizeof( PATCH_LEVEL ) ) == sizeof( PATCH_LEVEL ) ) {
if( memcmp( buffer, PATCH_LEVEL, PATCH_LEVEL_HEAD_SIZE ) == 0 ) {
offset += sizeof( PATCH_LEVEL );
--
1.8.3.4
From 48aea848589760809e793b3f38af51fc4c0dd313 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 19 Jan 2015 22:44:26 +0100
Subject: Fix local.mif for Haiku.
* It was still referencing BSD from which it was copied, resulting in
broken build.
diff --git a/build/mif/local.mif b/build/mif/local.mif
index 1990b94..4537b76 100644
--- a/build/mif/local.mif
+++ b/build/mif/local.mif
@@ -453,7 +453,7 @@ bld_cl_sys =
bld_incs = $(bld_extra_incs) -I"$(watcom_dir)/h"
-bld_cppflags = $(common_cppflags_bsd) $(common_cppflags_$(bld_cpu))
+bld_cppflags = $(common_cppflags_haiku) $(common_cppflags_$(bld_cpu))
bld_cflags = $(common_cflags) $(common_flags) -o $@
@@ -485,8 +485,8 @@ cl = gcc -pipe
librarian = ar
-cppflags_bsd = $(common_cppflags_bsd)
-cppflags_osi = $(common_cppflags_bsd)
+cppflags_haiku = $(common_cppflags_haiku)
+cppflags_osi = $(common_cppflags_haiku)
cppflags_386 = $(common_cppflags_386)
cppflags_ppc = $(common_cppflags_ppc)
cppflags_x64 = $(common_cppflags_x64)
--
1.8.3.4
From 4b0ebc440cc9f2b217c39f00f89cf2e280fc4bc1 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 19 Jan 2015 22:45:36 +0100
Subject: makeinit, variety.h: Haiku support.
Not sure if this is needed, for symmetry with other systems only.
diff --git a/bld/lib_misc/h/variety.h b/bld/lib_misc/h/variety.h
index 241183e..7323caa 100644
--- a/bld/lib_misc/h/variety.h
+++ b/bld/lib_misc/h/variety.h
@@ -164,6 +164,16 @@
#else
#error unrecognized processor for Linux
#endif
+#elif defined(__HAIKU__)
+ #define __PROTECT_MODE__
+ #define __UNIX__
+ #if defined(__386__)
+ #define __HAIKU_386__
+ #elif defined(__PPC__)
+ #define __HAIKU_PPC__
+ #else
+ #error unrecognized processor for Haiku
+ #endif
#elif defined(__NETWARE__)
#define __PROTECT_MODE__
#if defined(__386__)
diff --git a/build/makeinit b/build/makeinit
index f9bc945..692675a 100644
--- a/build/makeinit
+++ b/build/makeinit
@@ -82,6 +82,17 @@ bld64host_osi = 1
!else ifdef __BSDPPC__
bld_cpu = ppc
bld_os = bsd
+!else ifdef __HAIKU386__
+bld_cpu = 386
+bld_os = haiku
+!else ifdef __HAIKUX64__
+bld_cpu = x64
+bld_os = haiku
+bld64host_bsd = 1
+bld64host_osi = 1
+!else ifdef __HAIKUPPC__
+bld_cpu = ppc
+bld_os = haiku
!endif
!ifdef nulldevice_$(bld_os)
--
1.8.3.4
From 61579736f40c305f7e33642c17e36c4daad73094 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 19 Jan 2015 22:46:14 +0100
Subject: walloca: silcene warning on Haiku
We already define __alloca in Haiku system headers, and this triggers a
warning during build.
diff --git a/bld/watcom/h/walloca.h b/bld/watcom/h/walloca.h
index 66a7ac8..6f70d1c 100644
--- a/bld/watcom/h/walloca.h
+++ b/bld/watcom/h/walloca.h
@@ -41,7 +41,7 @@
#if !defined( __WATCOMC__ )
#if defined( _MSC_VER )
#define __alloca _alloca
-#else
+#elif !defined(__HAIKU__)
#define __alloca alloca
#endif
#endif
--
1.8.3.4
From bfc9f3a6eab0dbc28d4eb91698842faa8fb94ac8 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@gmail.com>
Date: Mon, 19 Jan 2015 22:47:04 +0100
Subject: wl, builder: let makefiles know about Haiku
* We want the POSIX stuff used, otherwise there are undefined
references.
diff --git a/bld/builder/master.mif b/bld/builder/master.mif
index 6ce7918..2d7f651 100644
--- a/bld/builder/master.mif
+++ b/bld/builder/master.mif
@@ -36,6 +36,7 @@ inc_dirs = -I"../h" -I"$(pmake_dir)" -I"$(posix_dir)/h"
sys_bsd = sys.obj sysposix.obj
sys_dos = sys.obj sysdos.obj sysdoscd.obj
sys_linux = sys.obj sysposix.obj
+sys_haiku = sys.obj sysposix.obj
sys_nt = sysnt.obj sysdoscd.obj
sys_os2 = sys.obj sysos2.obj sysdoscd.obj
diff --git a/bld/wl/wlobjs.mif b/bld/wl/wlobjs.mif
index 7b50b4f..e1efd0b 100644
--- a/bld/wl/wlobjs.mif
+++ b/bld/wl/wlobjs.mif
@@ -125,6 +125,7 @@ wlink_ide_objs = $(_subdir_)idedrv.obj
wlink_objs_dos = $(_subdir_)linkio.obj
wlink_objs_qnx = $(_subdir_)posixio.obj
wlink_objs_linux = $(_subdir_)posixio.obj
+wlink_objs_haiku = $(_subdir_)posixio.obj
wlink_objs_osx = $(_subdir_)posixio.obj
wlink_objs_bsd = $(_subdir_)posixio.obj
wlink_objs_nt = $(_subdir_)ntio.obj
--
1.8.3.4