FDOS/kernel

Build issue with recent OpenWatcom snapshots requiring `-wcd=106`

Closed this issue · 8 comments

lss4 commented

Originally mentioned here, there's an ongoing build issue with recent OpenWatcom 2.0 snapshots requiring -wcd=106 to suppress typecasting related warnings so build can continue.

I suppose the CI was changed to use a tagged release of OpenWatcom because of the warnings, per 4e23a63. Older OpenWatcom snapshots did not not produce the warnings and thus no need to suppress.

After some digging the warning seems to be caused by the failure(x) macro here. It seems S_ERROR being 0x8000 is making the compiler implicitly assume unsigned int which caused the warning. If I put an explicit cast in the macro, say,

#define failure(x)      (int)(S_ERROR+S_DONE+x)

then all but one such warnings would be gone. The only one left is this return that did not utilize the failure(x) macro so I have to manually put an explicit cast matching the function's return type. After adding those explicit casts the build process completed without other issues.

After building, I did checksums on the previous kernel build with -wcd=106 and the current one with the explicit cast added. Both have identical checksums, so it appears the generated code are likely the same.

I don't know which should be the most appropriate type for the failure(x) macro to explicit cast into. From OpenWatcom's warnings, at least in dsk.c, some places expected int while others short.

It seems like the device return codes should use UWORD (aka unsigned short, 16-bit unsigned integer data type).

Open Watcom 2.0 was fixed and little improved wmake to be backward compatible with Open Watcom 1.9 that now you can use OW 2.0 as replacement for OW 1.9 and all is build by OW 2.0 without problem.

Hi @jmalak , I'm trying to switch the CI back to using the current-build rather than the tagged version, after seeing your comment. Unfortunately the xv on github actions ubuntu 22.04 image doesn't seem to be able to unpack the snapshot. Locally I can do this okay, and yet the revisions seem to be the same.

GA
2024-04-28 18:02:25 URL:https://github.com/open-watcom/open-watcom-v2/releases/tag/Current-build/ow-snapshot.tar.xz [154939] -> "ow-snapshot.tar.xz" [1]
xz (XZ Utils) 5.2.5
liblzma 5.2.5
xz: ow-snapshot.tar.xz: File format not recognized
Local Ubuntu 22.04
$ xz --version
xz (XZ Utils) 5.2.5
liblzma 5.2.5
$ xz --list /tmp/ow-snapshot.tar.xz 
Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename
    1       1    140.9 MiB    472.0 MiB  0.298  CRC64   /tmp/ow-snapshot.tar.xz

I just don't know what's going on there, so for now I'll have to stick with the tagged version.

Hi @PerditionC I am using

Current runner version: '2.316.0'
Operating System
Ubuntu
22.04.4
LTS

OWTAR=ow-snapshot.tar.xz

#   get watcom binary snapshot
[ -f $OWTAR ] || wget https://github.com/open-watcom/open-watcom-v2/releases/download/Last-CI-build/$OWTAR

mkdir -p ${HOME}/.dosemu/drive_c
cd ${HOME}/.dosemu/drive_c && (

  mkdir -p bin
  mkdir -p watcom

  # Boot files
  unzip -L -q ${HERE}/kernel.zip
  cp -p bin/kernl386.sys ./kernel.sys
  unzip -L -q ${HERE}/freecom.zip
  cp -p bin/command.com ./command.com
  cp -p /usr/share/dosemu/dosemu2-cmds-0.3/c/fdconfig.sys .

  # Development files
  unzip -L -q ${HERE}/djgpp_mk.zip
  cp -p devel/djgpp/bin/make.exe bin/.
  unzip -L -q ${HERE}/upx.zip
  cp -p devel/upx/upx.exe bin/.
  echo PATH to make and upx binaries is 'c:/bin'

  unzip -L -q ${HERE}/nasm.zip
  echo PATH to nasm binary is 'c:/devel/nasm'

#  unzip -L -q ${HERE}/i16gcc.zip
#  unzip -L -q ${HERE}/i16newli.zip
#  unzip -L -q ${HERE}/i16butil.zip
#  unzip -L -q ${HERE}/i16lbi86.zip
#  echo PATH to ia16 binaries is 'c:/devel/i16gnu/bin'

  (cd watcom && tar -xf ${HERE}/$OWTAR)
  echo PATH to watcom binaries is 'c:/watcom/binw'
)

and setup for Linux

export WATCOM=${HOME}/.dosemu/drive_c/watcom
export PATH=$BUILD_DIR/bin:$PATH:$WATCOM/binl64

And it is download without problem and untar correctly.

I was testing the current-build not last-ci-build.

Thanks, that fixes it. Sorry for being a little stupid! 😄

Tomorrow you can change it back to daily build (Current-build snapshot), it will be up-to-date.
Anyway DOS build (in DOSEMU) works now with OW 2.O too, there was issue with wmake compatibility (copy command).