[OpenSmalltalk/opensmalltalk-vm] aafcb7: Changes to sq.h and sqAssert.h to accompany commit

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] aafcb7: Changes to sq.h and sqAssert.h to accompany commit

Eliot Miranda-3
 
  Branch: refs/heads/Cog
  Home:   https://github.com/OpenSmalltalk/opensmalltalk-vm
  Commit: aafcb78371c7e576073a8dbf2f1f32667568e05e
      https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/aafcb78371c7e576073a8dbf2f1f32667568e05e
  Author: Eliot Miranda <[hidden email]>
  Date:   2021-02-08 (Mon, 08 Feb 2021)

  Changed paths:
    M platforms/Cross/vm/sq.h
    M platforms/Cross/vm/sqAssert.h
    M platforms/win32/vm/sqWin32Heartbeat.c

  Log Message:
  -----------
  Changes to sq.h and sqAssert.h to accompany commit
dbe76be273c374a63a25e1079486a6ef2aabcfba
Author: Eliot Miranda <[hidden email]>
Date:   Mon Feb 8 20:32:56 2021 -0800

    CogVM source as per  VMMaker.oscog-eem.2943

    Resolve the conflict between sqAssert.h's attempt to export warning and error to
    external plugins with the crude redefinition of the EXPORT macro on generating
    plugins. So so by moving the redefinition of EXPORT after a plugin's include
    files. The issue here is Windows' requirement to use declspec(dll_import) &
    declspec(dll_import) for sharing between exe and dll.

To allow the VM to export warning and error to external plugins, warning and
error must be correctly declared using the EXPORT macro.  Hence these macros
cannot be redefined until after the interpreters and any definitions in
sqPlatformSpecific.h have been seen and applied.

Further, so that sqPlatformSpecific.h *can* define EXPORT et al sq.h must
include it before it attempts to provide default definitions of EXPORT et al
and sq.h should never replace EXPORT et al if they have been defined.

Further still, sqPlatformSpecific.h *cannot* be included before stdio if it
is to "conveniently" define fseeko & ftello to the various 64-bit versions
certain platforms require.

Thankyou for understanding.  The idea of sqCOnfig.h is perhaps in conflict
with these changes.  However, in my opinion it is much more important that
we be able to build a complete VM on all platforms, including the ability to
use asserts in external plugins, than it is for a convenient sqConfig.h to be
usable.  As previously discussed, C includes are white box and cannot reliably
be prefixed with sqConfig.h unless we maintain each platform's sqConfig.h to
apply to every possible version of a platform's include files, an obvious
impossibility.

I ask anyone wishing to alter the system here to please contact me and discuss
before making changes.  It is extraordinarily expensive and frustrating to have
to make changes of this kind to make sure that a signfiicantly more complex VM
such as Terf's builds correctly.


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] aafcb7: Changes to sq.h and sqAssert.h to accompany commit

David T. Lewis
 
On Mon, Feb 08, 2021 at 09:02:10PM -0800, Eliot Miranda wrote:
>
> I ask anyone wishing to alter the system here to please contact me and discuss
> before making changes.  It is extraordinarily expensive and frustrating to have
> to make changes of this kind to make sure that a signfiicantly more complex VM
> such as Terf's builds correctly.
>
>

Hi Eliot,

Just a heads up in case it is not showing in the automated buids. I
am getting build failures, apparently related to these changes. The
last working version for me is 9f1b4644e7396e473bd9bb4cf67f8a9d5a4e11d6

I am working on Ubuntu 16.04 LTS and currently building from
opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build.debug

With the latest Cog branch the LOG shows:

In file included from /home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqVirtualMachine.c:8:
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:24:14: error: expected function body after function declarator
EXPORT(void) error(const char *);
             ^
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:25:14: error: expected function body after function declarator
EXPORT(void) warning(const char *);
             ^
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:26:14: error: expected function body after function declarator
EXPORT(void) warningat(const char *,int);

Dave

Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] aafcb7: Changes to sq.h and sqAssert.h to accompany commit

Eliot Miranda-2
 
Hi David,

On Wed, Feb 10, 2021 at 8:38 PM David T. Lewis <[hidden email]> wrote:
 
On Mon, Feb 08, 2021 at 09:02:10PM -0800, Eliot Miranda wrote:
>
> I ask anyone wishing to alter the system here to please contact me and discuss
> before making changes.  It is extraordinarily expensive and frustrating to have
> to make changes of this kind to make sure that a signfiicantly more complex VM
> such as Terf's builds correctly.
>
>

Hi Eliot,

Just a heads up in case it is not showing in the automated buids. I
am getting build failures, apparently related to these changes. The
last working version for me is 9f1b4644e7396e473bd9bb4cf67f8a9d5a4e11d6

Thanks for the heads up.  Looking at it now.  The cogit files don't include sq.h so they don't pick up sq.h's default definition of EXPORT et al.  I'm testing what happens if I move the def to sqMemoryAccess.h (so far so good on linux, but have to test on Windows & Mac).  Putting them in sqMemoryAccess.h clearly shows an issue with the cogitFOO.c files, which include sqMemoryAccess.h *before* sqPlatformSpecific.h.  That can't work, so if I do decide to move EXPORT et al to sqMemoryAccess.h I'll have to change the header file declarations of the cogit files to get sqPlatformSpecific.h before sqMemoryAccess.h.  This is such a mess :-(.


I am working on Ubuntu 16.04 LTS and currently building from
opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build.debug

With the latest Cog branch the LOG shows:

In file included from /home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqVirtualMachine.c:8:
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:24:14: error: expected function body after function declarator
EXPORT(void) error(const char *);
             ^
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:25:14: error: expected function body after function declarator
EXPORT(void) warning(const char *);
             ^
/home/lewis/squeak/git/opensmalltalk-vm/platforms/Cross/vm/sqAssert.h:26:14: error: expected function body after function declarator
EXPORT(void) warningat(const char *,int);

Dave



--
_,,,^..^,,,_
best, Eliot