From fa8b6518bd353906d85e6a7f6886fd759f5bc10b Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 15 Jul 2014 19:42:20 +0200 Subject: [PATCH] WIP recipe for Open Watcom. Build fails after the bootstrapping stage, as executables compiled with Watcom tools crash the runtime loader. --- sys-devel/openwatcom/openwatcom-1.9.0.recipe | 50 + .../patches/openwatcom-1.9.0.patchset | 878 ++++++++++++++++++ 2 files changed, 928 insertions(+) create mode 100644 sys-devel/openwatcom/openwatcom-1.9.0.recipe create mode 100644 sys-devel/openwatcom/patches/openwatcom-1.9.0.patchset diff --git a/sys-devel/openwatcom/openwatcom-1.9.0.recipe b/sys-devel/openwatcom/openwatcom-1.9.0.recipe new file mode 100644 index 000000000..c9705af9e --- /dev/null +++ b/sys-devel/openwatcom/openwatcom-1.9.0.recipe @@ -0,0 +1,50 @@ +SUMMARY="C/C++ compiler targetting DOS and Win16/32 machines" +DESCRIPTION=" +Open Watcom is a project of the open source community to maintain and enhance \ +the Watcom C, C++, and Fortran cross compilers and tools. An Open Source \ +license from Sybase allows free commercial and non-commercial use of Open\ +Watcom." +HOMEPAGE="http://openwatcom.org" +LICENSE="Open Watcom Public Licence v1.0" +COPYRIGHT="Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved." +REVISION="1" + +ARCHITECTURES="" +if [ $effectiveTargetArchitecture != x86_gcc2 ]; then + # x86_gcc2 is fine as primary target architecture as long as we're building + # for a different secondary architecture. + ARCHITECTURES="$ARCHITECTURES !x86_gcc2" +fi +SECONDARY_ARCHITECTURES="!x86" + +SRC_URI="ftp://ftp.openwatcom.org/source/open_watcom_$portVersion-src.tar.bz2" +CHECKSUM_SHA256="6d303327988ee2dda60cfabebf3f45a9758aee4da117d41cf3153fccb7e5e4bf" +SOURCE_DIR="OW19" +PATCHES="openwatcom-$portVersion.patchset" + +PROVIDES=" + openwatcom$secondaryArchSuffix = $portVersion +" + +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel >= $haikuVersion + cmd:awk + cmd:cc$secondaryArchSuffix + cmd:make + cmd:which +" + +BUILD() +{ + ./build.sh +} + +INSTALL() +{ + false +} + +TEST() +{ + false +} diff --git a/sys-devel/openwatcom/patches/openwatcom-1.9.0.patchset b/sys-devel/openwatcom/patches/openwatcom-1.9.0.patchset new file mode 100644 index 000000000..6b4597648 --- /dev/null +++ b/sys-devel/openwatcom/patches/openwatcom-1.9.0.patchset @@ -0,0 +1,878 @@ +From f5fb7475a12450ec7e62c6b10330babb9e50883b Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +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 587dfc5..5b309f6 100644 +--- a/bld/wasm/c/main.c ++++ b/bld/wasm/c/main.c +@@ -1071,6 +1071,8 @@ static int 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 9149ee7cdaa1365f99788fb8a47a309e999c4e2b Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +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 1fa5e7c..3a59fd9 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 "dump.h" + + extern void DumpPtr(pointer); +diff --git a/bld/cg/c/inssched.c b/bld/cg/c/inssched.c +index 7604bfb..e0197f3 100644 +--- a/bld/cg/c/inssched.c ++++ b/bld/cg/c/inssched.c +@@ -40,7 +40,7 @@ + #include "memout.h" + #include "procdef.h" + #include "freelist.h" +-#include "sched.h" ++#include "inssched.h" + #include "pattern.h" + #include "vergen.h" + #include "zoiks.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 11eb872..0e36840 100644 +--- a/bld/cg/intel/c/386funit.c ++++ b/bld/cg/intel/c/386funit.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" + +diff --git a/bld/cg/risc/axp/c/axpfunit.c b/bld/cg/risc/axp/c/axpfunit.c +index 8d42217..d6fcc05 100644 +--- a/bld/cg/risc/axp/c/axpfunit.c ++++ b/bld/cg/risc/axp/c/axpfunit.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" + +diff --git a/bld/cg/risc/mps/c/mpsfunit.c b/bld/cg/risc/mps/c/mpsfunit.c +index 549e56c..eac36ea 100644 +--- a/bld/cg/risc/mps/c/mpsfunit.c ++++ b/bld/cg/risc/mps/c/mpsfunit.c +@@ -34,7 +34,7 @@ + #include "indvars.h" + #include "opcodes.h" + #include "model.h" +-#include "sched.h" ++#include "inssched.h" + #include "funits.h" + #include "pattern.h" + +diff --git a/bld/cg/risc/ppc/c/ppcfunit.c b/bld/cg/risc/ppc/c/ppcfunit.c +index 67a42a4..20274ef 100644 +--- a/bld/cg/risc/ppc/c/ppcfunit.c ++++ b/bld/cg/risc/ppc/c/ppcfunit.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" + +diff --git a/bld/cg/s37/c/s37funit.c b/bld/cg/s37/c/s37funit.c +index 4820665..2c12277 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 527f810f6af718323ef3f8ae8ca878af6ee4439d Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +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 365ae18..98039c1 100644 +--- a/bld/watcom/c/clibext.c ++++ b/bld/watcom/c/clibext.c +@@ -1255,6 +1255,17 @@ char *_cmdname( char *name ) + return( name ); + } + ++#elif defined __HAIKU__ ++ ++#include ++ ++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 7984a7d862362bf03a10b889ed625741c8fbeaf7 Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +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 e67dcc4..418c6d6 100644 +--- a/bld/cc/c/coptions.c ++++ b/bld/cc/c/coptions.c +@@ -278,6 +278,8 @@ local void SetTargSystem( void ) /* 07-aug-90 */ + _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 6e3f2370059fb631e793aebd3fcb9809b067c52c Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Tue, 15 Jul 2014 19:39:16 +0200 +Subject: Replace "local" with "static". + + +diff --git a/bld/build/mif/defrule.mif b/bld/build/mif/defrule.mif +index c964ad1..939bd2c 100644 +--- a/bld/build/mif/defrule.mif ++++ b/bld/build/mif/defrule.mif +@@ -1,10 +1,5 @@ + .c.obj: $($(proj_name)_autodepends) +-!ifeq verbose 1 + $(cc) $(cflags) $(extra_c_flags_$[&) $(inc_path) $[@ +-!else +- @echo cc $@ +- @$(cc) $(cflags) $(extra_c_flags_$[&) $(inc_path) $[@ +-!endif + + .cpp.obj: $($(proj_name)_autodepends) + !ifeq verbose 1 +diff --git a/bld/cc/c/ccheck.c b/bld/cc/c/ccheck.c +index 6ef3aed..4610390 100644 +--- a/bld/cc/c/ccheck.c ++++ b/bld/cc/c/ccheck.c +@@ -66,7 +66,7 @@ typedef enum { + + extern struct aux_info *GetLangInfo( type_modifiers flags ); + +-local cmp_type const CompTable[TYPE_LAST_ENTRY][TYPE_LAST_ENTRY] = { ++static cmp_type const CompTable[TYPE_LAST_ENTRY][TYPE_LAST_ENTRY] = { + /* BL,CH,UC,SH,US,IN,UI,LO,UL,DL,DU,FL,DB,LD,FI,DI,LI,PO,AR,ST,UN,FU,FI,VO,EN,TY,UF,DD,PC,WC,FC,DC,LC, */ + /* BOOL */ { OK,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,AC,__,__,__,__,__,__,__,__,__,__,__,__,__,__,__, }, + /* CHAR */ { AC,OK,OK,OK,OK,OK,OK,AC,AC,AC,AC,AC,AC,AC,__,__,__,PC,__,__,__,__,OK,__,OK,__,OK,__,__,__,__,__,__, }, +@@ -103,8 +103,8 @@ local cmp_type const CompTable[TYPE_LAST_ENTRY][TYPE_LAST_ENTRY] = { + /* LDCOMPLEX*/ { __,__,__,__,__,__,__,__,__,__,__,AC,AC,AC,AC,AC,AC,__,__,__,__,__,__,__,__,__,__,__,__,__,AC,AC,OK, }, + }; + +-local int TypeCheck( TYPEPTR typ1, TYPEPTR typ2 ); +-local bool IsPointer( TYPEPTR typ ); ++static int TypeCheck( TYPEPTR typ1, TYPEPTR typ2 ); ++static bool IsPointer( TYPEPTR typ ); + + + static cmp_type InUnion( TYPEPTR typ1, TYPEPTR typ2, int reversed ) +@@ -1017,7 +1017,7 @@ int VerifyType( TYPEPTR new, TYPEPTR old, SYMPTR sym ) + } + + +-local int TypeCheck( TYPEPTR typ1, TYPEPTR typ2 ) ++static int TypeCheck( TYPEPTR typ1, TYPEPTR typ2 ) + { + int pointer_type; + type_modifiers ptr_mask; +diff --git a/bld/cc/c/cexpr.c b/bld/cc/c/cexpr.c +index fb04a8c..5700aee 100644 +--- a/bld/cc/c/cexpr.c ++++ b/bld/cc/c/cexpr.c +@@ -45,26 +45,26 @@ struct mathfuncs { + #include "cmathfun.h" + }; + +-local TREEPTR GenNextParm(TREEPTR,TYPEPTR **); +-local TREEPTR StartFunc(TREEPTR,TYPEPTR **); +-local TREEPTR GetExpr(void); +-local TREEPTR ExprId(void); +-local TREEPTR ExprOpnd(void); +-local TREEPTR SizeofOp(TYPEPTR); +-local TREEPTR ScalarExpr(TREEPTR); +-local TREEPTR UnaryPlus(TREEPTR); +-local TREEPTR TernOp(TREEPTR,TREEPTR,TREEPTR); +-local TREEPTR ColonOp(TREEPTR); +-local TREEPTR StartTernary(TREEPTR); +-local TREEPTR NotOp(TREEPTR); +-local TREEPTR AndAnd(TREEPTR); +-local TREEPTR OrOr(TREEPTR); +-local TREEPTR GenFuncCall(TREEPTR); +-local TREEPTR IndexOp(TREEPTR,TREEPTR); +-local TREEPTR SegOp(TREEPTR,TREEPTR); +-local void PopNestedParms( TYPEPTR **plistptr ); +-local void IncSymWeight( SYMPTR sym ); +-local void AddCallNode( TREEPTR tree ); ++static TREEPTR GenNextParm(TREEPTR,TYPEPTR **); ++static TREEPTR StartFunc(TREEPTR,TYPEPTR **); ++static TREEPTR GetExpr(void); ++static TREEPTR ExprId(void); ++static TREEPTR ExprOpnd(void); ++static TREEPTR SizeofOp(TYPEPTR); ++static TREEPTR ScalarExpr(TREEPTR); ++static TREEPTR UnaryPlus(TREEPTR); ++static TREEPTR TernOp(TREEPTR,TREEPTR,TREEPTR); ++static TREEPTR ColonOp(TREEPTR); ++static TREEPTR StartTernary(TREEPTR); ++static TREEPTR NotOp(TREEPTR); ++static TREEPTR AndAnd(TREEPTR); ++static TREEPTR OrOr(TREEPTR); ++static TREEPTR GenFuncCall(TREEPTR); ++static TREEPTR IndexOp(TREEPTR,TREEPTR); ++static TREEPTR SegOp(TREEPTR,TREEPTR); ++static void PopNestedParms( TYPEPTR **plistptr ); ++static void IncSymWeight( SYMPTR sym ); ++static void AddCallNode( TREEPTR tree ); + extern int64 LongValue64( TREEPTR leaf ); + + #define PTR_FLAGS (FLAG_CONST | FLAG_VOLATILE | FLAG_UNALIGNED | FLAG_MEM_MODEL|FLAG_FAR16 | FLAG_BASED ) +@@ -294,7 +294,7 @@ TREEPTR LongLeaf( target_long value ) + return( leaf ); + } + +-local TREEPTR EnumLeaf( ENUMPTR ep ) ++static TREEPTR EnumLeaf( ENUMPTR ep ) + { + DATA_TYPE decl_type; + TREEPTR leaf; +@@ -433,7 +433,7 @@ TREEPTR SymLeaf( void ) + } + + +-local void IncSymWeight( SYMPTR sym ) ++static void IncSymWeight( SYMPTR sym ) + { + static int LoopWeights[] = { 1, 0x10, 0x100, 0x1000 }; + +@@ -504,7 +504,7 @@ static bool IsCallValue( TREEPTR tree ) + } + + // This RVALUE thing is backwards -mjc +-local TREEPTR TakeRValue( TREEPTR tree, int void_ok ) ++static TREEPTR TakeRValue( TREEPTR tree, int void_ok ) + { + TYPEPTR typ; + sym_flags symb_flags; +@@ -960,7 +960,7 @@ FIELDPTR SearchFields( TYPEPTR *class_typ, unsigned long *field_offset, + } + + +-local TYPEPTR Ptr2Struct( TYPEPTR typ ) ++static TYPEPTR Ptr2Struct( TYPEPTR typ ) + { + if( typ->decl_type != TYPE_POINTER ) { + return( NULL ); +@@ -1179,7 +1179,7 @@ TREEPTR SingleExpr( void ) + } + + +-local TREEPTR GetExpr( void ) ++static TREEPTR GetExpr( void ) + { + TREEPTR tree, op1; + TYPEPTR typ; +@@ -1463,7 +1463,7 @@ local TREEPTR GetExpr( void ) + } + + +-local TREEPTR ExprOpnd( void ) ++static TREEPTR ExprOpnd( void ) + { + TREEPTR tree; + TYPEPTR typ; +@@ -1627,7 +1627,7 @@ local TREEPTR ExprOpnd( void ) + } + + +-local int IsMacroDefined( void ) ++static int IsMacroDefined( void ) + { + MEPTR mentry; + +@@ -1644,7 +1644,7 @@ local int IsMacroDefined( void ) + } + + +-local TREEPTR ExprId( void ) ++static TREEPTR ExprId( void ) + { + TREEPTR tree; + int value; +@@ -1697,7 +1697,7 @@ local TREEPTR ExprId( void ) + + + #if 0 +-local int LValueArray( TREEPTR tree ) ++static int LValueArray( TREEPTR tree ) + { + TYPEPTR typ; + +@@ -1716,7 +1716,7 @@ local int LValueArray( TREEPTR tree ) + } + #endif + +-local TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) + { + TYPEPTR typ; + op_flags tree_flags; +@@ -1780,14 +1780,14 @@ local TREEPTR GenIndex( TREEPTR tree, TREEPTR index_expr ) + return( tree ); + } + +-local TREEPTR ArrayIndex( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR ArrayIndex( TREEPTR tree, TREEPTR index_expr ) + { + tree = GenIndex( tree, index_expr ); + return( tree ); + } + + +-local TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) ++static TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) + { + TYPEPTR typ; + +@@ -1816,7 +1816,7 @@ local TREEPTR IndexOp( TREEPTR tree, TREEPTR index_expr ) + return( tree ); + } + +-local void AddCallNode( TREEPTR tree ) ++static void AddCallNode( TREEPTR tree ) + // if a function call has no prototype wait till end + // to check it out + { +@@ -1861,7 +1861,7 @@ static int ParmNum( void ) + return( parm_count ); + } + +-local TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) ++static TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) + { + TYPEPTR *plist; + TYPEPTR typ; +@@ -1948,7 +1948,7 @@ local TREEPTR GenNextParm( TREEPTR tree, TYPEPTR **plistptr ) + } + + +-local int IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, int n, SYMPTR sym ) ++static int IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, int n, SYMPTR sym ) + { + char func_name[6]; + +@@ -1970,7 +1970,7 @@ local int IntrinsicMathFunc( SYM_NAMEPTR sym_name, int i, int n, SYMPTR sym ) + #else + #define REG_SIZE 4 + #endif +-local TREEPTR GenVaStartNode( TREEPTR last_parm ) ++static TREEPTR GenVaStartNode( TREEPTR last_parm ) + { + // there should be 3 parms __builtin_va_start( list, parm_name, stdarg ) + // - first parm should be name of va_list +@@ -2025,7 +2025,7 @@ local TREEPTR GenVaStartNode( TREEPTR last_parm ) + return( tree ); + } + +-local TREEPTR GenAllocaNode( TREEPTR size_parm ) ++static TREEPTR GenAllocaNode( TREEPTR size_parm ) + { + // there should be 1 parm __builtin_alloca( size ) + TREEPTR tree; +@@ -2042,7 +2042,7 @@ local TREEPTR GenAllocaNode( TREEPTR size_parm ) + #endif + + #if _CPU == _PPC +-local TREEPTR GenVaArgNode( TREEPTR last_parm ) ++static TREEPTR GenVaArgNode( TREEPTR last_parm ) + { + // there should be 2 parms __builtin_varg( list, type_arg ) + // - first parm should be name of va_list +@@ -2075,7 +2075,7 @@ local TREEPTR GenVaArgNode( TREEPTR last_parm ) + } + #endif + +-local TREEPTR GenFuncCall( TREEPTR last_parm ) ++static TREEPTR GenFuncCall( TREEPTR last_parm ) + { + int i, n; + TREEPTR functree; +@@ -2229,7 +2229,7 @@ done_call: + return( tree ); + } + +-local void PopNestedParms( TYPEPTR **plistptr ) ++static void PopNestedParms( TYPEPTR **plistptr ) + { + struct nested_parm_lists *npl; + +@@ -2259,7 +2259,7 @@ static TREEPTR DummyFuncName( void ) + return( tree ); + } + +-local TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) ++static TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) + { + TYPEPTR typ; + TYPEPTR orig_typ; +@@ -2391,7 +2391,7 @@ local TREEPTR StartFunc( TREEPTR tree, TYPEPTR **plistptr ) + } + + +-local TREEPTR OrOr( TREEPTR tree ) ++static TREEPTR OrOr( TREEPTR tree ) + { + // This routine is called when || token is found + if( tree->op.opr == OPR_PUSHINT ) { +@@ -2404,7 +2404,7 @@ local TREEPTR OrOr( TREEPTR tree ) + } + + +-local TREEPTR AndAnd( TREEPTR tree ) ++static TREEPTR AndAnd( TREEPTR tree ) + { + // This routine is called when && token is found + if( tree->op.opr == OPR_PUSHINT ) { +@@ -2456,7 +2456,7 @@ TREEPTR BoolExpr( TREEPTR tree ) + } + + +-local TREEPTR NotOp( TREEPTR tree ) ++static TREEPTR NotOp( TREEPTR tree ) + { + TREEPTR opnd; + FLOATVAL *flt; +@@ -2510,14 +2510,14 @@ local TREEPTR NotOp( TREEPTR tree ) + } + + +-local TREEPTR StartTernary( TREEPTR tree ) ++static TREEPTR StartTernary( TREEPTR tree ) + { + tree = BoolExpr( tree ); + return( tree ); + } + + +-local TREEPTR ColonOp( TREEPTR true_part ) ++static TREEPTR ColonOp( TREEPTR true_part ) + { + if( Class[ Level ] != TC_TERNARY ) { + CErr1( ERR_MISSING_QUESTION_OR_MISPLACED_COLON ); +@@ -2592,7 +2592,7 @@ static TREEPTR TernOp( TREEPTR expr1, TREEPTR true_part, TREEPTR false_part ) + } + + +-local TREEPTR UnaryPlus( TREEPTR tree ) ++static TREEPTR UnaryPlus( TREEPTR tree ) + { + TYPEPTR typ; + +@@ -2644,7 +2644,7 @@ TREEPTR ScalarExpr( TREEPTR tree ) + } + + +-local TREEPTR SizeofOp( TYPEPTR typ ) ++static TREEPTR SizeofOp( TYPEPTR typ ) + { + TREEPTR tree; + unsigned long size; +@@ -2675,7 +2675,7 @@ local TREEPTR SizeofOp( TYPEPTR typ ) + return( tree ); + } + +-local TREEPTR SegOp( TREEPTR seg, TREEPTR offset ) ++static TREEPTR SegOp( TREEPTR seg, TREEPTR offset ) + { + TREEPTR tree; + TYPEPTR typ; +diff --git a/bld/cc/c/cmac2.c b/bld/cc/c/cmac2.c +index fe073ff..048ce33 100644 +--- a/bld/cc/c/cmac2.c ++++ b/bld/cc/c/cmac2.c +@@ -50,11 +50,11 @@ static void CError( void ); + static void CIdent( void ); + static void CUnknown( void ); + +-local void Flush2EOL( void ); +-local void GrabTokens( int parm_cnt, struct macro_parm *formal_parms, const char *mac_name ); +-local void IncLevel( int value ); +-local int FormalParm( struct macro_parm *formal_parms ); +-local void ChkEOL( void ); ++static void Flush2EOL( void ); ++static void GrabTokens( int parm_cnt, struct macro_parm *formal_parms, const char *mac_name ); ++static void IncLevel( int value ); ++static int FormalParm( struct macro_parm *formal_parms ); ++static void ChkEOL( void ); + + struct preproc { + char *directive; +@@ -194,18 +194,18 @@ static void Flush2EOL( void ) + } + + +-local void CSkip( void ) ++static void CSkip( void ) + { + } + + +-local void CSkipIf( void ) ++static void CSkipIf( void ) + { + IncLevel( 0 ); + } + + +-local void CUnknown( void ) ++static void CUnknown( void ) + { + if( NestLevel == SkipLevel ) { + CErr2p( ERR_UNKNOWN_DIRECTIVE, Buffer ); +@@ -213,7 +213,7 @@ local void CUnknown( void ) + } + + +-local void CIdent( void ) ++static void CIdent( void ) + { + if( !CompFlags.extensions_enabled ) + CUnknown(); +@@ -276,7 +276,7 @@ void CInclude( void ) + } + + +-local void CDefine( void ) ++static void CDefine( void ) + { + struct macro_parm *mp, *prev_mp, *formal_parms; + int parm_cnt, parm_end = 0; +@@ -362,7 +362,7 @@ local void CDefine( void ) + } + + +-local void GrabTokens( int parm_cnt, struct macro_parm *formal_parms, const char *mac_name ) ++static void GrabTokens( int parm_cnt, struct macro_parm *formal_parms, const char *mac_name ) + { + MEPTR mentry; + int i; +@@ -496,7 +496,7 @@ local void GrabTokens( int parm_cnt, struct macro_parm *formal_parms, const char + } + + +-local int FormalParm( struct macro_parm *formal_parms ) ++static int FormalParm( struct macro_parm *formal_parms ) + { + int i; + +@@ -511,7 +511,7 @@ local int FormalParm( struct macro_parm *formal_parms ) + } + + +-local void CIfDef( void ) ++static void CIfDef( void ) + { + MEPTR mentry; + +@@ -533,7 +533,7 @@ local void CIfDef( void ) + } + + +-local void CIfNDef( void ) ++static void CIfNDef( void ) + { + MEPTR mentry; + +@@ -555,7 +555,7 @@ local void CIfNDef( void ) + } + + +-local int GetConstExpr( void ) /* 13-nov-91 */ ++static int GetConstExpr( void ) /* 13-nov-91 */ + { + int value; + int useful_side_effect; +@@ -576,7 +576,7 @@ local int GetConstExpr( void ) /* 13-nov-91 */ + return( value ); + } + +-local void CIf( void ) ++static void CIf( void ) + { + int value; + +@@ -588,7 +588,7 @@ local void CIf( void ) + } + + +-local void CElif( void ) ++static void CElif( void ) + { + int value; + +@@ -617,7 +617,7 @@ local void CElif( void ) + } + + +-local void IncLevel( int value ) ++static void IncLevel( int value ) + { + struct cpp_info *cpp; + +@@ -638,7 +638,7 @@ local void IncLevel( int value ) + } + + +-local void WantEOL( void ) ++static void WantEOL( void ) + { + if( CompFlags.extensions_enabled ) { + if( CurToken != T_NULL && CurToken != T_EOF ) { +@@ -653,7 +653,7 @@ local void WantEOL( void ) + } + + +-local void CElse( void ) ++static void CElse( void ) + { + if( ( NestLevel == 0 ) || ( CppStack->cpp_type == PRE_ELSE ) ) { + CErr1( ERR_MISPLACED_ELSE ); +@@ -675,7 +675,7 @@ local void CElse( void ) + } + + +-local void CEndif( void ) ++static void CEndif( void ) + { + if( NestLevel == 0 ) { + CErr1( ERR_MISPLACED_ENDIF ); +@@ -743,7 +743,7 @@ extern bool MacroDel( char *name ) + } + + +-local void CUndef( void ) ++static void CUndef( void ) + { + + PPNextToken(); +@@ -757,7 +757,7 @@ local void CUndef( void ) + } + + +-local void ChkEOL( void ) ++static void ChkEOL( void ) + { + if( ( CurToken != T_NULL ) && ( CurToken != T_EOF ) ) { + ExpectEndOfLine(); +@@ -765,7 +765,7 @@ local void ChkEOL( void ) + } + + +-local void CLine( void ) ++static void CLine( void ) + { + FNAMEPTR flist; + unsigned long src_line; +@@ -808,7 +808,7 @@ local void CLine( void ) + } + + +-local void CError( void ) ++static void CError( void ) + { + int i; + int save; +diff --git a/bld/cc/master.mif b/bld/cc/master.mif +index 95c7958..2b6376d 100644 +--- a/bld/cc/master.mif ++++ b/bld/cc/master.mif +@@ -54,7 +54,7 @@ pre_obj_deps += code$(target_cpu).gh + # + # C compiler options + # +-defines = -Dlocal=static ++#defines = -Dlocal="static" + + extra_c_flags = $(defines) + !ifeq cg_dll 1 +-- +1.8.3.4 +