[harbour/core] Incorrect detection of Open Watcom default target (Issue #379)

137 views
Skip to first unread message

Przemyslaw Czerpak

unread,
Jan 29, 2025, 5:17:19 PM1/29/25
to harbou...@googlegroups.com

Hu Aleksander,

I cannot reproduce it in Linux.
OpenWatcom 1.9 and 2.0 builds for Linux, MS-Windows, DOS and OS2
are compiled fine and hbtest for Linux, MS-Windows and DOS does not
show any errors. I haven't tested OS2 1.9 and 2.0 builds because I do
not have OS2 here.
Can you recompile Harbour with your OpenWatcom MS-Windows
with
    HB_USER_PRGFLAGS=-gc2
and send rt_hvma.c to me?

best regards,
Przemek

W dniu 28.01.2025 o 20:44, Aleksander Czajczyński pisze:

makefile ugliness++ :-)
Some mixture of methods was applied. Though this Watcom detection is a bit of strange, because it can even override user specified HB_PLATFORM, but that was what Harbour 3.2 did for many year, so i won't change it in this tree.

@omm please retest

To whom may it concern, hbtest build with 2025-01-03 OW on win32 gives strange some strange results, i haven't seen before (not seen OW circa 2020):

Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2024, Viktor Szakats
---------------------------------------------------------------------------
      Version: Harbour 3.2.0dev (r2501281246)
     Compiler: Open Watcom C 13.0 (32-bit)
           OS: Windows 7 6.1 SP1
   Date, Time: 2025-01-28 20:36:36
Shortcut opt.: On
     Switches:   
===========================================================================
R No.  Line            TestCall()                               -> Result                                                                                | Expected
---------------------------------------------------------------------------
!  819 MAIN_HVMA(618)  ( nA := -50000000000                  , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20          50000000000"
!  820 MAIN_HVMA(619)  ( nA := -500000000000                 , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20         500000000000"
!  821 MAIN_HVMA(620)  ( nA := -5000000000000                , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20        5000000000000"
!  822 MAIN_HVMA(621)  ( nA := -50000000000000               , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20       50000000000000"
!  823 MAIN_HVMA(622)  ( nA := -500000000000000              , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20      500000000000000"
!  824 MAIN_HVMA(623)  ( nA := -5000000000000000             , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20     5000000000000000"
!  825 MAIN_HVMA(624)  ( nA := -50000000000000000            , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20    50000000000000000"
!  826 MAIN_HVMA(625)  ( nA := -500000000000000000           , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20   500000000000000000"
!  827 MAIN_HVMA(626)  ( nA := -5000000000000000000          , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20  5000000000000000000"
===========================================================================
Test calls passed:       4853 ( 99.81 % )
Test calls failed:          9 ( 0.19 % )
                   ----------
            Total:       4862 ( Time elapsed: 0.14 seconds )

WARNING: Failures detected

NT to Linux cross-build stops at ZLIB

wcc386   -zq -bt=linux -w3 -6r -fp6 -onaehtr -s -ei -zp4 -zt0 -oi -i. -i..\..\..\..\..\include  -DHB_HAS_PCRE -IC:\HARBOUR\harbour-32.corenew\src\3rd\pcre -DPCRE_STATIC -DHB_HAS_ZLIB -IC:\HARBOUR\harbour-32.corenew\src\3rd\zlib  -fo=cputime.o   ..\..\..\cputime.c
..\..\..\cputime.c(125): Warning! W131: No prototype found for function 'sysconf'
..\..\..\cputime.c(125): Error! E1011: Symbol '_SC_CLK_TCK' has not been declared
..\..\..\cputime.c(125): Warning! W308: The function 'sysconf' without prototyped parameters called
..\..\..\cputime.c(125): Note! N2002: 'sysconf' defined in: ..\..\..\cputime.c(125)
../../../../../config/rules.mk:88: recipe for target 'cputime.o' failed
win-make[3]: *** [cputime.o] Error 1
../../config/lib.mk:68: recipe for target 'descend' failed
win-make[2]: *** [descend] Error 2
../config/dir.mk:71: recipe for target 'rtl' failed
win-make[1]: *** [rtl] Error 2
config/dir.mk:71: recipe for target 'src' failed
win-make: *** [src] Error 2

Please create issues if you're concerned.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <harbour/core/issues/379/2619911341@github.com>


oleksa

unread,
Jan 29, 2025, 6:34:04 PM1/29/25
to harbou...@googlegroups.com
Hi Przemek,

Just recompile Harbour:
Open Watcom x86 32-bit Compilers Driver Program
Version 2.0 beta Jan 28 2025 02:12:43 (32-bit)
Copyright (c) 2002-2025 The Open Watcom Contributors. All Rights Reserved.
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
01:20
! Building Harbour 3.2.0dev from source - https://harbour.github.io
! MAKE: win-make 4.1 sh.exe clean install  
! HB_USER_PRGFLAGS: -gc2
! HB_INSTALL_PREFIX: c:\dev\harbour_wc
! HB_HOST_PLAT: win (x86_64)  HB_SHELL: nt
! HB_PLATFORM: win (x86) (auto-detected)
! HB_COMPILER: watcom (auto-detected: C:/WATCOM/BINNT/)
! Component: 'zlib' found in C:/Dev/core/src/3rd/zlib (local)
! Component: 'pcre' found in C:/Dev/core/src/3rd/pcre (local)
! Component: 'gpm' not supported on win platform
! Component: 'slang' not found. Configure with HB_WITH_SLANG.
! Component: 'curses' not found. Configure with HB_WITH_CURSES.
! Component: 'x11' not found. Configure with HB_WITH_X11.
! Component: 'wattcp/watt-32' not supported on win platform
! GIT_REVISION: 1d0c512822

rt_hvma.c in attach

Regards,
Oleksii

30 січня 2025, 00:17:20, Від "'Przemyslaw Czerpak' via Harbour Developers" <harbou...@googlegroups.com>:

You are receiving this because you are subscribed to this thread.Message ID: <harbour/core/issues/379/26199...@github.com>

--
You received this message because you are subscribed to the Google Groups "Harbour Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-deve...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-devel/e41e0508-c29d-41bd-b293-c2cb7e3e91f9%40poczta.onet.pl.
rt_hvma.c

Przemyslaw Czerpak

unread,
Jan 29, 2025, 8:48:15 PM1/29/25
to harbou...@googlegroups.com
Thank you.

The bug is in Win32 version of OpenWatcom (Linux version
works correctly so my cross builds were OK and I was not
able to reproduce the problem).
Inside conditions like:
    #[el]if <exp1> <op> <exp2?
64bit signed and unsigned integers in <exp1> and <exp2>
are stripped to 32 bit ones, i.e.
    #if LONGLONG_MAX < LONG_MAX
        #error "BUG"
    #endif
It should be reported to OpenWatcom authors.
Can someone do that?
Meanwhile I'll commit temporary workaround changing
our #if expressions to use == and != operators instead
of <[=] and >[=] and eliminating unsigned 32 and 64 bit
comparisons.

best regards,
Przemek

W dniu 30.01.2025 o 00:33, oleksa pisze:

Aleksander Czajczynski

unread,
Jan 30, 2025, 6:46:41 AM1/30/25
to harbou...@googlegroups.com
Hello!

After your fixes, hbtest looks fine! Also NT-to-linux cross x86 build now finishes and is confirmed to be working (apart from minor hbmk2 reports, when it unsuccessfully tries to build dyn contribs - I don't think it is supported).

Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2024, Viktor Szakats
---------------------------------------------------------------------------
     Version: Harbour 3.2.0dev (r2501300323)
     Compiler: Open Watcom C 13.0 (32-bit) // <- Win32 host
           OS: Linux 3.16.0-10-686-pae i686
   Date, Time: 2025-01-30 12:43:21

Shortcut opt.: On
     Switches:
===========================================================================
R No.  Line            TestCall()                               -> Result                                                                                | Expected
---------------------------------------------------------------------------
===========================================================================
Test calls passed:       4861 ( 100.00 % )
Test calls failed:          0 ( 0.00 % )
                   ----------
            Total:       4861 ( Time elapsed: 0.09 seconds )

Best regards, Aleksander

Aleksander Czajczynski

unread,
Jan 30, 2025, 11:50:13 AM1/30/25
to harbou...@googlegroups.com
In short: OW truncates in preprocessor at C89 mode now, but we include stdint.h and datatypes are there(?)
https://github.com/open-watcom/open-watcom-v2/issues/1389

Best regards, Aleksander

Przemyslaw Czerpak

unread,
Jan 30, 2025, 1:01:36 PM1/30/25
to harbou...@googlegroups.com
Hi Aleksander,
Thank you for your time.
In Linux OE uses 64bit integers in #pragma directives ans
I haven't used any compiler switches to force cXX standard.
In the past I was making OW builds on different Linux
versions for Linux, Win, DOS and OS2 (AFAIR with 1.7, 1.8, 1.9)
and they worked without this problem. Now 2.0 also works.
But it's interesting if DOS and/or Win 1.9 builds has the same
problem. I've just logged in to an old computer on which I made
some test long time ago with DOSEMU and I've found interesting
output from HBTEST:
    Version: Harbour 2.0.0beta3 (Rev. 13081)
    Compiler: Open Watcom C++ 12.70.8 (32-bit)
    OS: DOS 6.22
    Date, Time: 2009.12.01 04:28:23

and the problem had not existed. HBTEST reported:

!  742 MAIN_HVMA(542)  RTSTR( 00000500000000000000 )
       Result: " 16  500000000000000"
     Expected: " 21       500000000000000"
!  743 MAIN_HVMA(543)  RTSTR( 0500000000000000 )
       Result: " 16  500000000000000"
     Expected: " 17   500000000000000"
! 1087 MAIN_MATH(359)  Str(1234567890 * 1234567890 )
       Result: " 1524157875019052100"
     Expected: " 1524157875019052000"


and this is expected. These are the same results as in all other
builds also current one. Just simply now we are hiding above
as expected results but you can still see them running hbtest
with -noalt parameter.
It means that current OW 2.0 behavior is not backward
compatible but it's regression.

DOS output froim hbtest.exe compiled 2 days ago with
OW 2.0 as cross build for DOS in this Linux box (without my
recent modifications) looks as follow:
Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2024, Viktor Szakats
---------------------------------------------------------------------------
      Version: Harbour 3.2.0dev (r2501281246)
     Compiler: Open Watcom C 12.90 (32-bit)
           OS: DOS 6.22 (Windows 3.10)
   Date, Time: 2025-01-30 18:52:07

Shortcut opt.: On
     Switches:
===========================================================================
R No.  Line            TestCall()                               -> Result
                                                                         | Expec
ted
---------------------------------------------------------------------------
===========================================================================
Test calls passed:       4861 ( 100.00 % )
Test calls failed:          0 ( 0.00 % )
                   ----------
            Total:       4861 ( Time elapsed: 0.00 seconds )

So for sure Linux cross builds for DOS works correctly with 65 bit integers
in #pragma directives without -za99

best regards,
Przemek


W dniu 30.01.2025 o 17:39, Aleksander Czajczynski pisze:

Aleksander Czajczynski

unread,
Jan 30, 2025, 1:46:56 PM1/30/25
to harbou...@googlegroups.com
A note, your DOS build advertises OpenWatcom C 12.90, mine 13.00:
Harbour Compatibility and Regression Test Suite
Copyright (c) 1999-2024, Viktor Szakats
---------------------------------------------------------------------------
      Version: Harbour 3.2.0dev (r2501281927)
     Compiler: Open Watcom C 13.0 (32-bit)
           OS: DOS 7.10 (Windows 4.10)
   Date, Time: 2025-01-28 20:52:36
Shortcut opt.: On
     Switches:   
===========================================================================
R No.  Line            TestCall()                               -> Result                                                                                | Expected
---------------------------------------------------------------------------
!  819 MAIN_HVMA(618)  ( nA := -50000000000                  , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20          50000000000"
!  820 MAIN_HVMA(619)  ( nA := -500000000000                 , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20         500000000000"
!  821 MAIN_HVMA(620)  ( nA := -5000000000000                , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20        5000000000000"
!  822 MAIN_HVMA(621)  ( nA := -50000000000000               , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20       50000000000000"
!  823 MAIN_HVMA(622)  ( nA := -500000000000000              , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20      500000000000000"
!  824 MAIN_HVMA(623)  ( nA := -5000000000000000             , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20     5000000000000000"
!  825 MAIN_HVMA(624)  ( nA := -50000000000000000            , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20    50000000000000000"
!  826 MAIN_HVMA(625)  ( nA := -500000000000000000           , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20   500000000000000000"
!  827 MAIN_HVMA(626)  ( nA := -5000000000000000000          , RTSTR( -nA ) )
       Result: " 10 **********"
     Expected: " 20  5000000000000000000"
! 3287 MAIN_MISC(107)  Set( 19,   BADFNAME2() )
       Result: "E 20 TERM 2013 Create error <*INVALI*.TMP> OS:-1 #:1 F:DR"
     Expected: "E 20 TERM 2013 Create error <*INVALI*.TMP> OS:2 #:1 F:DR"
! 3288 MAIN_MISC(108)  Set( 24, BADFNAME2() )
       Result: "E 20 TERM 2014 Create error <*INVALI*.TMP> OS:-1 #:1 F:DR"
     Expected: "E 20 TERM 2014 Create error <*INVALI*.TMP> OS:2 #:1 F:DR"
! 3289 MAIN_MISC(109)  Set( 22, BADFNAME2() )
       Result: "E 20 TERM 2015 Create error <*INVALI*.TMP> OS:-1 #:1 F:DR"
     Expected: "E 20 TERM 2015 Create error <*INVALI*.TMP> OS:2 #:1 F:DR"
! 3748 MAIN_MISC(809)  __CopyFile( "$$COPYFR.TMP", BADFNAME1() )
       Result: "E 20 BASE 2012 Create error <*INVALID*.> OS:-1 #:1 F:DR"
     Expected: "E 20 BASE 2012 Create error <*INVALID*.> OS:2 #:1 F:DR"
! 4861 MAIN_LAST(196)  __MSave( BADFNAME(), "*", .T. )
       Result: "E 20 BASE 2006 Create error <*BADNAM*.MEM> OS:-1 #:1 F:DR"
     Expected: "E 20 BASE 2006 Create error <*BADNAM*.MEM> OS:2 #:1 F:DR"
===========================================================================
Test calls passed:       4847 ( 99.71 % )
Test calls failed:         14 ( 0.29 % )
                   ----------
            Total:       4861 ( Time elapsed: 3.91 seconds )

WARNING: Failures detected




Reply all
Reply to author
Forward
0 new messages