diff --git a/harbour/ChangeLog b/harbour/ChangeLog index eff4cd052b..dde02588fa 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,53 @@ The license applies to all entries newer than 2009-04-28. */ +2010-07-16 00:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * config/vxworks/diab.mk + + Implemented support for Wind River Compiler. + Incomplete yet, as I couldn't test each build + feature due to errors in earlier build stages. + + * src/common/hbver.c + + Added fourth version number level. + + Added version detection for Wind River Compiler (diag). + * Formatting. + + * src/common/hbprintf.c + * external/minizip/ioapi.h + + Fixes for Wind River Compiler (diag) + + * src/rtl/hbdyn.c + ! Dirty fix to compile in HB_LONG_LONG_OFF mode. + Przemek if you see this, can you take a look at it if + it's right or at least not terribly off? + + * include/hbsetup.h + ! Temporary hack for Wind River Compiler to use + HB_LONG_LONG_OFF, otherwise the compiler crashes with + internal error in hvm.c (without hvmall and optimizations + also). Now, this flag caused another slew of problems, + so as it looks now support for this compiler cannot + be added: + "../../../hvm.c", line 9827: internal compiler error (etoa:1000): - Failed allocating register pair + please contact support@windriver.com */ + + * include/hbinit.h + + Enabled Wind River compiler to use the GCC init mode. + (didn't actually test it, but it compiles) + + * utils/hbmk2/hbmk2.prg + + Added new debug switch -debugpars to get a list of + input parameters processed by hbmk2. + + Synced automatic HB_CCPOSTFIX configuration based on cpu + setting with GNU Make logic. + + * config/vxworks/gcc.mk + * Cleanups. + + Added more CPU postfixes. + + * INSTALL + * Minor convenience added to prev. + 2010-07-15 21:48 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * INSTALL ! vxWorks casing. diff --git a/harbour/INSTALL b/harbour/INSTALL index b3a6d1c0ad..b5602eaad5 100644 --- a/harbour/INSTALL +++ b/harbour/INSTALL @@ -939,6 +939,7 @@ HARBOUR wrenv -p vxworks-6.8 set HB_COMPILER=gcc set HB_CPU=arm + set HB_BUILD_NAME=arm win-make --- diff --git a/harbour/config/vxworks/diab.mk b/harbour/config/vxworks/diab.mk index f40a3b3817..5b4b3711f2 100644 --- a/harbour/config/vxworks/diab.mk +++ b/harbour/config/vxworks/diab.mk @@ -14,13 +14,50 @@ OBJ_EXT := .o LIB_PREF := lib LIB_EXT := .a -HB_DYN_COPT := -DHB_DYNLIB -Xcode-relative-far +HB_DYN_COPT := -DHB_DYNLIB -Xpic + +ifeq ($(HB_CPU),x86) + _DIAB_CPU := X86LH + _DIAB_VXCPU := _VX_SIMPENTIUM +else +ifeq ($(HB_CPU),arm) + _DIAB_CPU := + _DIAB_VXCPU := +else +ifeq ($(HB_CPU),mips) + _DIAB_CPU := + _DIAB_VXCPU := +else +ifeq ($(HB_CPU),ppc) + _DIAB_CPU := + _DIAB_VXCPU := +else +ifeq ($(HB_CPU),sh) + _DIAB_CPU := + _DIAB_VXCPU := +else +ifeq ($(HB_CPU),m68k) + _DIAB_CPU := + _DIAB_VXCPU := +endif +endif +endif +endif +endif +endif CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP) CC_IN := -c CC_OUT := -o CFLAGS += -I. -I$(HB_INC_COMPILE) +CFLAGS += -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip + +CFLAGS += -D_VX_CPU=$(_DIAB_VXCPU) + +CFLAGS += -t$(_DIAB_CPU):rtpsim -WDVSB_DIR=$(WIND_BASE)/target/lib +LDFLAGS += -t$(_DIAB_CPU):rtpsim -WDVSB_DIR=$(WIND_BASE)/target/lib +DFLAGS += -t$(_DIAB_CPU):rtpsim -WDVSB_DIR=$(WIND_BASE)/target/lib ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Xlint @@ -36,21 +73,23 @@ ifeq ($(HB_BUILD_DEBUG),yes) CFLAGS += -g endif -LD := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) +LD := $(CC) LD_OUT := -o -LIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS),-L$(dir)) -LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS),-l$(lib)) +LDLIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS_BIN),-L$(dir)) +DLIBPATHS := $(foreach dir,$(LIB_DIR) $(SYSLIBPATHS_DYN),-L$(dir)) -LDFLAGS += $(LIBPATHS) +LDLIBS := $(foreach lib,$(HB_USER_LIBS) $(LIBS) $(SYSLIBS_BIN),-l$(lib)) -AR := $(HB_CCPREFIX)ar$(HB_CCPOSTFIX) +LDFLAGS += $(LDLIBPATHS) + +AR := $(HB_CCPREFIX)dar AR_RULE = ( $(AR) $(ARFLAGS) $(HB_AFLAGS) $(HB_USER_AFLAGS) rcs $(LIB_DIR)/$@ $(^F) $(ARSTRIP) ) || ( $(RM) $(LIB_DIR)/$@ && $(FALSE) ) DY := $(CC) -DFLAGS += -shared $(LIBPATHS) +DFLAGS += -shared $(DLIBPATHS) DY_OUT := -o$(subst x,x, ) -DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS),-l$(lib)) +DLIBS := $(foreach lib,$(HB_USER_LIBS) $(SYSLIBS_DYN),-l$(lib)) DY_RULE = $(DY) $(DFLAGS) $(HB_USER_DFLAGS) $(DY_OUT)$(DYN_DIR)/$@ $^ $(DLIBS) $(DYSTRIP) && $(LN) $(@F) $(DYN_FILE2) diff --git a/harbour/config/vxworks/gcc.mk b/harbour/config/vxworks/gcc.mk index c3d37c92e5..24a5fa14b1 100644 --- a/harbour/config/vxworks/gcc.mk +++ b/harbour/config/vxworks/gcc.mk @@ -16,16 +16,22 @@ LIB_EXT := .a HB_DYN_COPT := -DHB_DYNLIB -fpic -ifeq ($(HB_CPU),x86) - ifeq ($(HB_CCPOSTFIX),) +ifeq ($(HB_CCPOSTFIX),) + ifeq ($(HB_CPU),x86) export HB_CCPOSTFIX := pentium - endif -else -ifeq ($(HB_CPU),arm) - ifeq ($(HB_CCPOSTFIX),) + else + ifeq ($(HB_CPU),arm) export HB_CCPOSTFIX := arm + else + ifeq ($(HB_CPU),mips) + export HB_CCPOSTFIX := mips + else + ifeq ($(HB_CPU),ppc) + export HB_CCPOSTFIX := ppc + endif + endif + endif endif -endif endif CC := $(HB_CCACHE) $(HB_CCPREFIX)$(HB_CMP)$(HB_CCPOSTFIX) @@ -40,7 +46,6 @@ CFLAGS += -I. -I$(HB_INC_COMPILE) CFLAGS += -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip CFLAGS += -fno-strict-aliasing CFLAGS += -D_C99 -D_HAS_C9X -CFLAGS += -D_VX_TOOL_FAMILY=gnu -D_VX_TOOL=gnu ifneq ($(HB_BUILD_WARN),no) CFLAGS += -W -Wall diff --git a/harbour/external/minizip/ioapi.h b/harbour/external/minizip/ioapi.h index 80c579ec36..812ef3f00d 100644 --- a/harbour/external/minizip/ioapi.h +++ b/harbour/external/minizip/ioapi.h @@ -47,6 +47,7 @@ #if defined( __BORLANDC__ ) || \ defined( __WATCOMC__ ) || \ defined( __MINGW32CE__ ) || \ + defined( __DCC__ ) || \ defined( HB_OS_BSD ) || \ defined( HB_OS_DARWIN ) || \ defined( HB_OS_HAIKU ) || \ diff --git a/harbour/include/hbinit.h b/harbour/include/hbinit.h index fa28f55e0f..3dec9976f0 100644 --- a/harbour/include/hbinit.h +++ b/harbour/include/hbinit.h @@ -161,7 +161,7 @@ extern HB_EXPORT PHB_SYMB hb_vmProcessSymbols( PHB_SYMB pSymbols, HB_USHORT uiSy } #elif defined( HB_GNUC_STARTUP ) || \ - defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) + defined( __GNUC__ ) || defined( __SUNPRO_C ) || defined( __SUNPRO_CC ) || defined( __DCC__ ) #if defined( HB_PRAGMA_STARTUP ) || defined( HB_DATASEG_STARTUP ) #error Wrong macros set for startup code - clean your make/env settings. diff --git a/harbour/include/hbsetup.h b/harbour/include/hbsetup.h index 644b09f480..bb619f3819 100644 --- a/harbour/include/hbsetup.h +++ b/harbour/include/hbsetup.h @@ -420,6 +420,12 @@ #if defined( HB_OS_VXWORKS ) #define HB_NO_FNMATCH #endif +#if defined( __DCC__ ) + /* NOTE: Without this, the compiler will crash with this error, even with optimizations disabled: [vszakats] + "../../../hvm.c", line 9827: internal compiler error (etoa:1000): - Failed allocating register pair + please contact support@windriver.com */ + #define HB_LONG_LONG_OFF +#endif /* *********************************************************************** * Operating system specific definitions diff --git a/harbour/src/common/hbprintf.c b/harbour/src/common/hbprintf.c index e2dce78629..44f1c633ec 100644 --- a/harbour/src/common/hbprintf.c +++ b/harbour/src/common/hbprintf.c @@ -113,6 +113,7 @@ optimized. #if ( defined( __BORLANDC__ ) && __BORLANDC__ < 1410 ) || \ ( defined( __WATCOMC__ ) && __WATCOMC__ < 1270 ) || \ defined( HB_OS_QNX ) || \ + defined( __DCC__ ) || \ ( defined( __DJGPP__ ) && \ ( __DJGPP__ < 2 || ( __DJGPP__ == 2 && __DJGPP_MINOR__ <= 3 ) ) ) || \ ( defined( _MSC_VER ) && \ diff --git a/harbour/src/common/hbver.c b/harbour/src/common/hbver.c index 9d1c886710..d39a9e4d05 100644 --- a/harbour/src/common/hbver.c +++ b/harbour/src/common/hbver.c @@ -516,6 +516,7 @@ char * hb_verCompiler( void ) int iVerMajor; int iVerMinor; int iVerPatch; + int iVerMicro = 0; HB_TRACE(HB_TR_DEBUG, ("hb_verCompiler()")); @@ -700,6 +701,15 @@ char * hb_verCompiler( void ) iVerPatch = 0; #endif +#elif defined( __DCC__ ) + + pszName = "Wind River Compiler (diab)"; + + iVerMajor = ( __VERSION_NUMBER__ / 1000 ) % 10; + iVerMinor = ( __VERSION_NUMBER__ / 100 ) % 10; + iVerPatch = ( __VERSION_NUMBER__ / 10 ) % 10; + iVerMicro = __VERSION_NUMBER__ % 10; + #elif defined( __clang__ ) && defined( __clang_major__ ) pszName = "LLVM/Clang C"; @@ -820,7 +830,9 @@ char * hb_verCompiler( void ) if( pszName ) { - if( iVerPatch != 0 ) + if( iVerMicro != 0 ) + hb_snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %d.%d.%d.%d", pszName, szSub, iVerMajor, iVerMinor, iVerPatch, iVerMicro ); + else if( iVerPatch != 0 ) hb_snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %d.%d.%d", pszName, szSub, iVerMajor, iVerMinor, iVerPatch ); else if( iVerMajor != 0 || iVerMinor != 0 ) hb_snprintf( pszCompiler, COMPILER_BUF_SIZE, "%s%s %d.%d", pszName, szSub, iVerMajor, iVerMinor ); @@ -831,11 +843,11 @@ char * hb_verCompiler( void ) hb_strncpy( pszCompiler, "(unknown)", COMPILER_BUF_SIZE - 1 ); #if defined( __clang_version__ ) - if (strstr( __clang_version__, "(")) + if( strstr( __clang_version__, "(") ) /* "2.0 (trunk 103176)" -> "(trunk 103176)" */ - hb_snprintf( szSub, sizeof( szSub ), " %s", strstr( __clang_version__, "(")); + hb_snprintf( szSub, sizeof( szSub ), " %s", strstr( __clang_version__, "(" ) ); else - hb_snprintf( szSub, sizeof( szSub ), " (%s)", __clang_version__); + hb_snprintf( szSub, sizeof( szSub ), " (%s)", __clang_version__ ); hb_strncat( pszCompiler, szSub, COMPILER_BUF_SIZE - 1 ); #endif diff --git a/harbour/src/rtl/hbdyn.c b/harbour/src/rtl/hbdyn.c index 4cd502b90b..5a16d183cc 100644 --- a/harbour/src/rtl/hbdyn.c +++ b/harbour/src/rtl/hbdyn.c @@ -454,7 +454,9 @@ typedef struct union { HB_U32 n32; +#if !defined( HB_LONG_LONG_OFF ) HB_U64 n64; +#endif double nDB; float nFL; } t; @@ -523,6 +525,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r break; case HB_DYN_CTYPE_LLONG: +#if !defined( HB_LONG_LONG_OFF ) pArg->value.t.n64 = hb_itemGetNInt( pParam ); if( pArg->bByRef ) *r1 = ( HB_U32 ) &pArg->value.t.n64; @@ -532,9 +535,11 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r *r2 = ( pArg->value.t.n64 >> 32 ); *b64 = HB_TRUE; } +#endif break; case HB_DYN_CTYPE_LLONG_UNSIGNED: +#if !defined( HB_LONG_LONG_OFF ) /* TOFIX: Digits are lost. */ #if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) pArg->value.t.n64 = ( HB_MAXUINT ) hb_itemGetNInt( pParam ); @@ -549,6 +554,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r *r2 = ( pArg->value.t.n64 >> 32 ); *b64 = HB_TRUE; } +#endif break; case HB_DYN_CTYPE_FLOAT: @@ -562,9 +568,11 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r *r1 = ( HB_U32 ) &pArg->value.t.nDB; else { +#if !defined( HB_LONG_LONG_OFF ) *r1 = pArg->value.t.n64 & 0xFFFFFFFF; *r2 = ( pArg->value.t.n64 >> 32 ); *b64 = HB_TRUE; +#endif } break; @@ -687,18 +695,22 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA break; case HB_DYN_CTYPE_LLONG: +#if !defined( HB_LONG_LONG_OFF ) #if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_LONGLONG ) value.t.n64 ); +#endif #endif break; case HB_DYN_CTYPE_LLONG_UNSIGNED: +#if !defined( HB_LONG_LONG_OFF ) #if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF ) hb_itemPutNInt( pItem, ( HB_MAXUINT ) value.t.n64 ); #else hb_itemPutNInt( pItem, ( HB_ULONGLONG ) value.t.n64 ); +#endif #endif break; @@ -847,7 +859,9 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA #endif HB_DYN_CTYPE_DECL( HB_U32, HB_CDECL, FX86_C32 ); +#if !defined( HB_LONG_LONG_OFF ) HB_DYN_CTYPE_DECL( HB_U64, HB_CDECL, FX86_C64 ); +#endif HB_DYN_CTYPE_DECL( double, HB_CDECL, FX86_CDB ); HB_DYN_CTYPE_DECL( float, HB_CDECL, FX86_CFL ); @@ -996,7 +1010,11 @@ void hb_dynCall( int iFuncFlags, void * pFunctionRaw, int iParams, int iFirst, i int iParamsRaw = 0; HB_U32 rawpar[ _DYNEXEC_MAXPARAM * 2 ]; +#if !defined( HB_LONG_LONG_OFF ) ret.t.n64 = 0; +#else + memset( &ret, 0, sizeof( ret ) ); +#endif if( iRetType == HB_DYN_CTYPE_DOUBLE ) iRetTypeRaw = _RETTYPERAW_DOUBLE; @@ -1096,7 +1114,9 @@ void hb_dynCall( int iFuncFlags, void * pFunctionRaw, int iParams, int iFirst, i HB_DYN_FUN_CALL( iParamsRaw, n32, FX86_C32 ); break; case _RETTYPERAW_INT64: +#if !defined( HB_LONG_LONG_OFF ) HB_DYN_FUN_CALL( iParamsRaw, n64, FX86_C64 ); +#endif break; case _RETTYPERAW_DOUBLE: HB_DYN_FUN_CALL( iParamsRaw, nDB, FX86_CDB ); diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index e541b53d5b..1b7380bc9d 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -370,31 +370,32 @@ REQUEST hbmk_KEYW #define _HBMK_lDEBUGSTUB 95 #define _HBMK_lDEBUGI18N 96 #define _HBMK_lDEBUGDEPD 97 +#define _HBMK_lDEBUGPARS 98 -#define _HBMK_cCCPATH 98 -#define _HBMK_cCCPREFIX 99 -#define _HBMK_cCCPOSTFIX 100 -#define _HBMK_cCCEXT 101 +#define _HBMK_cCCPATH 99 +#define _HBMK_cCCPREFIX 100 +#define _HBMK_cCCPOSTFIX 101 +#define _HBMK_cCCEXT 102 -#define _HBMK_cWorkDir 102 -#define _HBMK_cWorkDirDynSub 103 -#define _HBMK_nCmd_Esc 104 -#define _HBMK_nScr_Esc 105 -#define _HBMK_nCmd_FNF 106 -#define _HBMK_nScr_FNF 107 -#define _HBMK_nErrorLevel 108 +#define _HBMK_cWorkDir 103 +#define _HBMK_cWorkDirDynSub 104 +#define _HBMK_nCmd_Esc 105 +#define _HBMK_nScr_Esc 106 +#define _HBMK_nCmd_FNF 107 +#define _HBMK_nScr_FNF 108 +#define _HBMK_nErrorLevel 109 -#define _HBMK_cPROGDIR 109 -#define _HBMK_cPROGNAME 110 +#define _HBMK_cPROGDIR 110 +#define _HBMK_cPROGNAME 111 -#define _HBMK_hAUTOHBC 111 -#define _HBMK_hAUTOHBCFOUND 112 +#define _HBMK_hAUTOHBC 112 +#define _HBMK_hAUTOHBCFOUND 113 -#define _HBMK_aDEPTHBC 113 +#define _HBMK_aDEPTHBC 114 -#define _HBMK_lStopAfterHarbour 114 +#define _HBMK_lStopAfterHarbour 115 -#define _HBMK_MAX_ 114 +#define _HBMK_MAX_ 115 #define _HBMK_DEP_CTRL_MARKER ".control." /* must be an invalid path */ @@ -873,6 +874,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) hbmk[ _HBMK_lDEBUGSTUB ] := .F. hbmk[ _HBMK_lDEBUGI18N ] := .F. hbmk[ _HBMK_lDEBUGDEPD ] := .F. + hbmk[ _HBMK_lDEBUGPARS ] := .F. hbmk[ _HBMK_nCmd_Esc ] := NIL hbmk[ _HBMK_nScr_Esc ] := NIL @@ -1767,6 +1769,7 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) CASE cParamL == "-debugstub" ; hbmk[ _HBMK_lDEBUGSTUB ] := .T. CASE cParamL == "-debugi18n" ; hbmk[ _HBMK_lDEBUGI18N ] := .T. CASE cParamL == "-debugdepd" ; hbmk[ _HBMK_lDEBUGDEPD ] := .T. + CASE cParamL == "-debugpars" ; hbmk[ _HBMK_lDEBUGPARS ] := .T. CASE cParamL == "-nulrdd" ; hbmk[ _HBMK_lNULRDD ] := .T. CASE cParamL == "-nulrdd-" ; hbmk[ _HBMK_lNULRDD ] := .F. CASE cParamL == "-map" ; hbmk[ _HBMK_lMAP ] := .T. @@ -2427,6 +2430,12 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) ENDCASE NEXT + IF hbmk[ _HBMK_lDEBUGPARS ] + FOR EACH aParam IN aParams + hbmk_OutStd( hbmk, hb_StrFormat( "debugpars: %1$s '%2$s' (%3$s:%4$s)", Str( aParam:__enumIndex(), 3 ), aParam[ _PAR_cParam ], aParam[ _PAR_cFileName ], hb_ntos( aParam[ _PAR_nLine ] ) ) ) + NEXT + ENDIF + dep_postprocess( hbmk ) IF ! l_lLIBSYSMISC @@ -2687,6 +2696,15 @@ FUNCTION hbmk2( aArgs, /* @ */ lPause ) IF hbmk[ _HBMK_lDEBUG ] AAdd( hbmk[ _HBMK_aOPTC ], "-g" ) ENDIF + IF hbmk[ _HBMK_cPLAT ] == "vxworks" .AND. ; + Empty( hbmk[ _HBMK_cCCPOSTFIX ] ) + SWITCH hbmk[ _HBMK_cCPU ] + CASE "x86" ; hbmk[ _HBMK_cCCPOSTFIX ] := "pentium" ; EXIT + CASE "arm" ; hbmk[ _HBMK_cCCPOSTFIX ] := "arm" ; EXIT + CASE "mips" ; hbmk[ _HBMK_cCCPOSTFIX ] := "mips" ; EXIT + CASE "ppc" ; hbmk[ _HBMK_cCCPOSTFIX ] := "ppc" ; EXIT + ENDSWITCH + ENDIF cLibLibPrefix := "lib" cLibPrefix := "-l" cLibExt := ""