[OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

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

[OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Christoph Thiede-2
 

Hello OpenSmalltalk,

Apparently the file "sqUnixEvent.c" is missing from the directory platforms/unix/vm.
It is still needed for the X11 plugin.
My quick fix was to checkout tag "202003021730", and to copy the file to the folder.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/555", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/555", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Christoph Thiede-2
 

The commit that removed it was this one: 924a24b

I saw that you did some cleanup of old event primitives, as documented in the commit message, @eliotmiranda. Was sqUnixEvent.c deleted by accident as part of this?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/555#issuecomment-799327721", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/555#issuecomment-799327721", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

David T. Lewis
 
On Mon, Mar 15, 2021 at 04:02:43AM -0700, Tom Beckmann wrote:
>  
> The commit that removed it was this one: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/924a24bb54870a621c5283f23631261d5a792000
>
> I saw that you did some cleanup of old event primitives, as documented in the commit message, @eliotmiranda. Was sqUnixEvent.c deleted by accident as part of this?
>

I restored the missing sqUnixEvent.c file, which I assume was mistakenly
deleted in that earlier commit.

Dave
 
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Bruce O'Neel-2
 
Hi,

That fixed one problem I was tripping over on the ARMv8 build.

There still seems to be a problem with the x86-64 build.  

Thanks.

bruce


clang -Wall  -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unu
sed-label -Wno-unused-function -Wno-unused-variable  -DHAVE_CONFIG_H  -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.
cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/e
doneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/
platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmallta
lk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unk
nown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable   -c -o sqUnixMain.o /home/edoneel/tmp/opensmalltalk-vm/platform
s/unix/vm/sqUnixMain.c
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:872:3: warning: implicit declaration of function 'pushOutputFile' is invalid in C99 [-Wim
plicit-function-declaration]
  pushOutputFile((char *)STDERR_FILENO);
  ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35: error: use of undeclared identifier 'REG_RBP'
                        void *fp = (void *)(uap ? uap->_FP_IN_UCONTEXT : 0);
                                                       ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:78:44: note: expanded from macro '_FP_IN_UCONTEXT'
# define _FP_IN_UCONTEXT uc_mcontext.gregs[REG_RBP]
                                           ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:927:35: error: use of undeclared identifier 'REG_RSP'
                        void *sp = (void *)(uap ? uap->_SP_IN_UCONTEXT : 0);
                                                       ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:79:44: note: expanded from macro '_SP_IN_UCONTEXT'
# define _SP_IN_UCONTEXT uc_mcontext.gregs[REG_RSP]
                                           ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:9: error: use of undeclared identifier 'REG_RAX'
                        regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],
                             ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:24: error: use of undeclared identifier 'REG_RBX'
                        regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],
                                            ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:39: error: use of undeclared identifier 'REG_RCX'
                        regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],
                                                           ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:54: error: use of undeclared identifier 'REG_RDX'
                        regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],
                                                                          ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:9: error: use of undeclared identifier 'REG_RDI'
                        regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],
                             ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:24: error: use of undeclared identifier 'REG_RSI'
                        regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],
                                            ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:39: error: use of undeclared identifier 'REG_RBP'
                        regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],
                                                           ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:54: error: use of undeclared identifier 'REG_RSP'
                        regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],
                                                                          ^
/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:994:9: error: use of undeclared identifier 'REG_R8'
                        regs[REG_R8 ], regs[REG_R9 ], regs[REG_R10], regs[REG_R11],
                             ^



22 March 2021 02:55 "David T. Lewis" <[hidden email]> wrote:

On Mon, Mar 15, 2021 at 04:02:43AM -0700, Tom Beckmann wrote:
>
> The commit that removed it was this one: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/924a24bb54870a621c5283f23631261d5a792000
>
> I saw that you did some cleanup of old event primitives, as documented in the commit message, @eliotmiranda. Was sqUnixEvent.c deleted by accident as part of this?
>

I restored the missing sqUnixEvent.c file, which I assume was mistakenly
deleted in that earlier commit.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

David T. Lewis
 
On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:

>  
>
> Hi,  
>  
> That fixed one problem I was tripping over on the ARMv8 build.  
>  
> There still seems to be a problem with the x86-64 build.????  
>  
> Thanks.  
>  
> bruce  

I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause of
the problem, but it seems to have been introduced in this commit:

commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
Author: Eliot Miranda <[hidden email]>
Date:   Wed Feb 10 21:41:31 2021 -0800

    Revisions to core include files to get EXPORT defined correctly at the relevant points.
    Essentially move the default EXPORT definitions from sq.h to sqMemoryAccess.h.
    Include fbdev support in build.linux32ARMv6 builds and add -m32 to their CFLAGS
    to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci skip]
    cuz new cogit files will arrive soon.


The changes seem straightforward, but for some reason the header files must
not be getting included properly.

Dave




>  
> clang -Wall?? -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unu  
> sed-label -Wno-unused-function -Wno-unused-variable?? -DHAVE_CONFIG_H?? -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.  
> [cog.spur/build](http://cog.spur/build) -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/[squeak.cog.spur/build](http://squeak.cog.spur/build) -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/e  
> doneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/  
> platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmallta  
> lk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unk  
> nown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable???? -c -o sqUnixMain.o /home/edoneel/tmp/opensmalltalk-vm/platform  
> s/unix/vm/sqUnixMain.c  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:872:3: warning: implicit declaration of function 'pushOutputFile' is invalid in C99 [-Wim  
> plicit-function-declaration]  
> ?? pushOutputFile((char *)STDERR_FILENO);  
> ?? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35: error: use of undeclared identifier 'REG_RBP'  
> ?????????????????????????????????????????????? void *fp = (void *)(uap ? uap->_FP_IN_UCONTEXT : 0);  
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:78:44: note: expanded from macro '_FP_IN_UCONTEXT'  
> # define _FP_IN_UCONTEXT uc_mcontext.gregs[REG_RBP]  
> ???????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:927:35: error: use of undeclared identifier 'REG_RSP'  
> ?????????????????????????????????????????????? void *sp = (void *)(uap ? uap->_SP_IN_UCONTEXT : 0);  
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:79:44: note: expanded from macro '_SP_IN_UCONTEXT'  
> # define _SP_IN_UCONTEXT uc_mcontext.gregs[REG_RSP]  
> ???????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:9: error: use of undeclared identifier 'REG_RAX'  
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],  
> ???????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:24: error: use of undeclared identifier 'REG_RBX'  
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],  
> ?????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:39: error: use of undeclared identifier 'REG_RCX'  
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],  
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:54: error: use of undeclared identifier 'REG_RDX'  
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],  
> ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:9: error: use of undeclared identifier 'REG_RDI'  
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],  
> ???????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:24: error: use of undeclared identifier 'REG_RSI'  
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],  
> ?????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:39: error: use of undeclared identifier 'REG_RBP'  
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],  
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:54: error: use of undeclared identifier 'REG_RSP'  
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP],  
> ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^  
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:994:9: error: use of undeclared identifier 'REG_R8'  
> ?????????????????????????????????????????????? regs[REG_R8 ], regs[REG_R9 ], regs[REG_R10], regs[REG_R11],  
> ???????????????????????????????????????????????????????? ^  
>  
>  
>  
>  
>
> > On Mon, Mar 15, 2021 at 04:02:43AM -0700, Tom Beckmann wrote:  
> >  >  
> >  > The commit that removed it was this one: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/924a24bb54870a621c5283f23631261d5a792000 
> >  >  
> >  > I saw that you did some cleanup of old event primitives, as documented in the commit message, @eliotmiranda. Was sqUnixEvent.c deleted by accident as part of this?  
> >  >  
> >  
> >  I restored the missing sqUnixEvent.c file, which I assume was mistakenly  
> >  deleted in that earlier commit.  
> >  
> >  Dave
>  
>

Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Eliot Miranda-2
 
Hi David,

On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis <[hidden email]> wrote:
 
On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:

>
> Hi, 
>   
> That fixed one problem I was tripping over on the ARMv8 build. 
>   
> There still seems to be a problem with the x86-64 build.???? 
>   
> Thanks. 
>   
> bruce 

I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause of
the problem, but it seems to have been introduced in this commit:

commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
Author: Eliot Miranda <[hidden email]>
Date:   Wed Feb 10 21:41:31 2021 -0800

    Revisions to core include files to get EXPORT defined correctly at the relevant points.
    Essentially move the default EXPORT definitions from sq.h to sqMemoryAccess.h.
    Include fbdev support in build.linux32ARMv6 builds and add -m32 to their CFLAGS
    to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci skip]
    cuz new cogit files will arrive soon.


The changes seem straightforward, but for some reason the header files must
not be getting included properly.

Dave




>   
> clang -Wall?? -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unu   
> sed-label -Wno-unused-function -Wno-unused-variable?? -DHAVE_CONFIG_H?? -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak. 
> [cog.spur/build](http://cog.spur/build) -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/[squeak.cog.spur/build](http://squeak.cog.spur/build) -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/e 
> doneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/ 
> platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmallta 
> lk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unk 
> nown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable???? -c -o sqUnixMain.o /home/edoneel/tmp/opensmalltalk-vm/platform 
> s/unix/vm/sqUnixMain.c 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:872:3: warning: implicit declaration of function 'pushOutputFile' is invalid in C99 [-Wim 
> plicit-function-declaration] 
> ?? pushOutputFile((char *)STDERR_FILENO); 
> ?? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35: error: use of undeclared identifier 'REG_RBP' 

If you have a look at the code here the file is trying to
- find out what platform it is on
- pull in the relevant version of ucontext.h containing the relevant defines for extracting register values from an interrupt context
- print out the registers for a crash report
So please look to
- find out if platforms/unix/vm/include_ucontext.h is working correctly on this platform
- find out what are the platform defines (-E -dM is your friend here)
- find out how ucontext.h defines the registers in a ucontext

> ?????????????????????????????????????????????? void *fp = (void *)(uap ? uap->_FP_IN_UCONTEXT : 0); 
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:78:44: note: expanded from macro '_FP_IN_UCONTEXT' 
> # define _FP_IN_UCONTEXT uc_mcontext.gregs[REG_RBP] 
> ???????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:927:35: error: use of undeclared identifier 'REG_RSP' 
> ?????????????????????????????????????????????? void *sp = (void *)(uap ? uap->_SP_IN_UCONTEXT : 0); 
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/include_ucontext.h:79:44: note: expanded from macro '_SP_IN_UCONTEXT' 
> # define _SP_IN_UCONTEXT uc_mcontext.gregs[REG_RSP] 
> ???????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:9: error: use of undeclared identifier 'REG_RAX' 
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX], 
> ???????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:24: error: use of undeclared identifier 'REG_RBX' 
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX], 
> ?????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:39: error: use of undeclared identifier 'REG_RCX' 
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX], 
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:992:54: error: use of undeclared identifier 'REG_RDX' 
> ?????????????????????????????????????????????? regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX], 
> ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:9: error: use of undeclared identifier 'REG_RDI' 
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP], 
> ???????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:24: error: use of undeclared identifier 'REG_RSI' 
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP], 
> ?????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:39: error: use of undeclared identifier 'REG_RBP' 
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP], 
> ???????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:993:54: error: use of undeclared identifier 'REG_RSP' 
> ?????????????????????????????????????????????? regs[REG_RDI], regs[REG_RSI], regs[REG_RBP], regs[REG_RSP], 
> ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ^ 
> /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:994:9: error: use of undeclared identifier 'REG_R8' 
> ?????????????????????????????????????????????? regs[REG_R8 ], regs[REG_R9 ], regs[REG_R10], regs[REG_R11], 
> ???????????????????????????????????????????????????????? ^ 
>   
>   
>   
>   
>
> > On Mon, Mar 15, 2021 at 04:02:43AM -0700, Tom Beckmann wrote: 
> >  > 
> >  > The commit that removed it was this one: https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/924a24bb54870a621c5283f23631261d5a792000 
> >  > 
> >  > I saw that you did some cleanup of old event primitives, as documented in the commit message, @eliotmiranda. Was sqUnixEvent.c deleted by accident as part of this? 
> >  > 
> >   
> >  I restored the missing sqUnixEvent.c file, which I assume was mistakenly 
> >  deleted in that earlier commit. 
> >   
> >  Dave
>   
>



--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

David T. Lewis
 
On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:

>  
> Hi David,
>
> On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis <[hidden email]> wrote:
>
> >
> > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > >
> > >
> > > Hi,
> > >
> > > That fixed one problem I was tripping over on the ARMv8 build.
> > >
> > > There still seems to be a problem with the x86-64 build.????
> > >
> > > Thanks.
> > >
> > > bruce
> >
> > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > of
> > the problem, but it seems to have been introduced in this commit:
> >
> > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > Author: Eliot Miranda <[hidden email]>
> > Date:   Wed Feb 10 21:41:31 2021 -0800
> >
> >     Revisions to core include files to get EXPORT defined correctly at the
> > relevant points.
> >     Essentially move the default EXPORT definitions from sq.h to
> > sqMemoryAccess.h.
> >     Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > their CFLAGS
> >     to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > skip]
> >     cuz new cogit files will arrive soon.
> >
> >
> > The changes seem straightforward, but for some reason the header files must
> > not be getting included properly.
> >
> > Dave
> >
> > >
> > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > error: use of undeclared identifier 'REG_RBP'
> >
>
> If you have a look at the code here the file is trying to
> - find out what platform it is on
> - pull in the relevant version of ucontext.h containing the relevant
> defines for extracting register values from an interrupt context
> - print out the registers for a crash report
> So please look to
> - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> this platform
> - find out what are the platform defines (-E -dM is your friend here)
> - find out how ucontext.h defines the registers in a ucontext
>

Hi Eliot,

I think that platforms/unix/vm/include_ucontext.h is working correctly.
Using -E -dM, I can confirm:

  #define __linux__ 1
  #define __x86_64 1

Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
which is where I think the issue originates(?).

So there is something else going wrong with the includes for Linux, but
I am blind and cannot spot it.

Dave

Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Bruce O'Neel-2
 
Hi,

Yea that's right, but, I think that is not where the problem is.

What seems to have happened is that someone got clever with <features.h> which is included in the beginning of  <sys/ucontext.h> and which must have changed between different versions of Linux.  So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.  Now it seams that the magic #define is _GNU_SOURCE.

The easiest patch I found is below and attached above.  I also attached features.h just so you can see the nightmare that has become.

diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
index 29b710460..eb67f677e 100755
--- a/build.linux64x64/squeak.cog.spur/build/mvm
+++ b/build.linux64x64/squeak.cog.spur/build/mvm
@@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
--with-src=spur64src \
TARGET_ARCH="-m64" \
CC=clang \
- CFLAGS="$CFLAGS" \
+ CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
LIBS="$LIBS" \
LDFLAGS="$LDFLAGS"
rm -f vm/sqUnixMain.o # nuke version info

I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.

This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.

cheers

bruce

24 March 2021 20:58 "David T. Lewis" <[hidden email]> wrote:

On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
>
> Hi David,
>
> On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
>
> >
> > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > >
> > >
> > > Hi,
> > >
> > > That fixed one problem I was tripping over on the ARMv8 build.
> > >
> > > There still seems to be a problem with the x86-64 build.????
> > >
> > > Thanks.
> > >
> > > bruce
> >
> > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > of
> > the problem, but it seems to have been introduced in this commit:
> >
> > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > Author: Eliot Miranda
> > Date: Wed Feb 10 21:41:31 2021 -0800
> >
> > Revisions to core include files to get EXPORT defined correctly at the
> > relevant points.
> > Essentially move the default EXPORT definitions from sq.h to
> > sqMemoryAccess.h.
> > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > their CFLAGS
> > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > skip]
> > cuz new cogit files will arrive soon.
> >
> >
> > The changes seem straightforward, but for some reason the header files must
> > not be getting included properly.
> >
> > Dave
> >
> > >
> > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > error: use of undeclared identifier 'REG_RBP'
> >
>
> If you have a look at the code here the file is trying to
> - find out what platform it is on
> - pull in the relevant version of ucontext.h containing the relevant
> defines for extracting register values from an interrupt context
> - print out the registers for a crash report
> So please look to
> - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> this platform
> - find out what are the platform defines (-E -dM is your friend here)
> - find out how ucontext.h defines the registers in a ucontext
>

Hi Eliot,

I think that platforms/unix/vm/include_ucontext.h is working correctly.
Using -E -dM, I can confirm:

#define __linux__ 1
#define __x86_64 1

Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
which is where I think the issue originates(?).

So there is something else going wrong with the includes for Linux, but
I am blind and cannot spot it.

Dave



diff (567 bytes) Download Attachment
features.h (17K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Tobias Pape
 
Hi Bruce and all

> On 25. Mar 2021, at 09:43, Bruce O'Neel <[hidden email]> wrote:
>
> Hi,
>
> Yea that's right, but, I think that is not where the problem is.
>
> What seems to have happened is that someone got clever with <features.h> which is included in the beginning of  <sys/ucontext.h> and which must have changed between different versions of Linux.  So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.


>  Now it seams that the magic #define is _GNU_SOURCE.

This is so quite a long time already.
I just checked a system frozen in time in 2012, it is the same there.
All __USE_* get undefined in features.h and only set with the respective _*_SOURCE options.

The __USE_GNU dance in
         https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/vm/include_ucontext.h#L15

is hence sadly ineffective.


>
> The easiest patch I found is below and attached above.  I also attached features.h just so you can see the nightmare that has become.
>
> diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
> index 29b710460..eb67f677e 100755
> --- a/build.linux64x64/squeak.cog.spur/build/mvm
> +++ b/build.linux64x64/squeak.cog.spur/build/mvm
> @@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
> --with-src=spur64src \
> TARGET_ARCH="-m64" \
> CC=clang \
> - CFLAGS="$CFLAGS" \
> + CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
> LIBS="$LIBS" \
> LDFLAGS="$LDFLAGS"
> rm -f vm/sqUnixMain.o # nuke version info
>
Configure should define that!

AC_USE_SYSTEM_EXTENSIONS in
        https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/config/configure.ac#L42
does exactly that: if GNU Extensions are avaialbe, define _GNU_SORUCE.

This define should be in config.h

This is the unconfigured file: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/config/config.h.in#L392

Once you run ./configure, it _will_ define _GNU_SOURCE.

However, it must be sur that config.h is included.
This is done unconditionally in sqMemoryAccess.h and conditionally (HAVE_CONFIG_H) in sqConfig.h (which is pulled by sq.h)
(HAVE_CONFIG_H is set as I see in your email from 2 days ago)


Based on your command in your email, can yous please send the output of

clang -Wall  -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable  -DHAVE_CONFIG_H  -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable   -E -o sqUnixMain.i /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c

and the resulting sqUnixMain.i?


Best regards
        -Tobias


> I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.
>
> This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.
>
> cheers
>
> bruce
>
> 24 March 2021 20:58 "David T. Lewis" <[hidden email]> wrote:
>
> On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
> >
> > Hi David,
> >
> > On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
> >
> > >
> > > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > That fixed one problem I was tripping over on the ARMv8 build.
> > > >
> > > > There still seems to be a problem with the x86-64 build.????
> > > >
> > > > Thanks.
> > > >
> > > > bruce
> > >
> > > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > > of
> > > the problem, but it seems to have been introduced in this commit:
> > >
> > > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > > Author: Eliot Miranda
> > > Date: Wed Feb 10 21:41:31 2021 -0800
> > >
> > > Revisions to core include files to get EXPORT defined correctly at the
> > > relevant points.
> > > Essentially move the default EXPORT definitions from sq.h to
> > > sqMemoryAccess.h.
> > > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > > their CFLAGS
> > > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > > skip]
> > > cuz new cogit files will arrive soon.
> > >
> > >
> > > The changes seem straightforward, but for some reason the header files must
> > > not be getting included properly.
> > >
> > > Dave
> > >
> > > >
> > > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > > error: use of undeclared identifier 'REG_RBP'
> > >
> >
> > If you have a look at the code here the file is trying to
> > - find out what platform it is on
> > - pull in the relevant version of ucontext.h containing the relevant
> > defines for extracting register values from an interrupt context
> > - print out the registers for a crash report
> > So please look to
> > - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> > this platform
> > - find out what are the platform defines (-E -dM is your friend here)
> > - find out how ucontext.h defines the registers in a ucontext
> >
>
> Hi Eliot,
>
> I think that platforms/unix/vm/include_ucontext.h is working correctly.
> Using -E -dM, I can confirm:
>
> #define __linux__ 1
> #define __x86_64 1
>
> Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
> which is where I think the issue originates(?).
>
> So there is something else going wrong with the includes for Linux, but
> I am blind and cannot spot it.
>
> Dave
>
>
> <diff><features.h>


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Bruce O'Neel-2
 
Hi,

I've attached sqUnixMain.i from the command below.

And yes it is in config.h


#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif

Thanks.

bruce



25 March 2021 10:14 Tobias Pape <[hidden email]> wrote:
Hi Bruce and all

> On 25. Mar 2021, at 09:43, Bruce O'Neel wrote:
>
> Hi,
>
> Yea that's right, but, I think that is not where the problem is.
>
> What seems to have happened is that someone got clever with which is included in the beginning of and which must have changed between different versions of Linux. So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.


> Now it seams that the magic #define is _GNU_SOURCE.

This is so quite a long time already.
I just checked a system frozen in time in 2012, it is the same there.
All __USE_* get undefined in features.h and only set with the respective _*_SOURCE options.

The __USE_GNU dance in

is hence sadly ineffective.


>
> The easiest patch I found is below and attached above. I also attached features.h just so you can see the nightmare that has become.
>
> diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
> index 29b710460..eb67f677e 100755
> --- a/build.linux64x64/squeak.cog.spur/build/mvm
> +++ b/build.linux64x64/squeak.cog.spur/build/mvm
> @@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
> --with-src=spur64src \
> TARGET_ARCH="-m64" \
> CC=clang \
> - CFLAGS="$CFLAGS" \
> + CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
> LIBS="$LIBS" \
> LDFLAGS="$LDFLAGS"
> rm -f vm/sqUnixMain.o # nuke version info
>
Configure should define that!

AC_USE_SYSTEM_EXTENSIONS in
does exactly that: if GNU Extensions are avaialbe, define _GNU_SORUCE.

This define should be in config.h


Once you run ./configure, it _will_ define _GNU_SOURCE.

However, it must be sur that config.h is included.
This is done unconditionally in sqMemoryAccess.h and conditionally (HAVE_CONFIG_H) in sqConfig.h (which is pulled by sq.h)
(HAVE_CONFIG_H is set as I see in your email from 2 days ago)


Based on your command in your email, can yous please send the output of

clang -Wall -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -E -o sqUnixMain.i /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c

and the resulting sqUnixMain.i?


Best regards
-Tobias


> I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.
>
> This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.
>
> cheers
>
> bruce
>
> 24 March 2021 20:58 "David T. Lewis" wrote:
>
> On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
> >
> > Hi David,
> >
> > On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
> >
> > >
> > > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > > >
> > > >
> > > > Hi,
> > > >
> > > > That fixed one problem I was tripping over on the ARMv8 build.
> > > >
> > > > There still seems to be a problem with the x86-64 build.????
> > > >
> > > > Thanks.
> > > >
> > > > bruce
> > >
> > > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > > of
> > > the problem, but it seems to have been introduced in this commit:
> > >
> > > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > > Author: Eliot Miranda
> > > Date: Wed Feb 10 21:41:31 2021 -0800
> > >
> > > Revisions to core include files to get EXPORT defined correctly at the
> > > relevant points.
> > > Essentially move the default EXPORT definitions from sq.h to
> > > sqMemoryAccess.h.
> > > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > > their CFLAGS
> > > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > > skip]
> > > cuz new cogit files will arrive soon.
> > >
> > >
> > > The changes seem straightforward, but for some reason the header files must
> > > not be getting included properly.
> > >
> > > Dave
> > >
> > > >
> > > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > > error: use of undeclared identifier 'REG_RBP'
> > >
> >
> > If you have a look at the code here the file is trying to
> > - find out what platform it is on
> > - pull in the relevant version of ucontext.h containing the relevant
> > defines for extracting register values from an interrupt context
> > - print out the registers for a crash report
> > So please look to
> > - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> > this platform
> > - find out what are the platform defines (-E -dM is your friend here)
> > - find out how ucontext.h defines the registers in a ucontext
> >
>
> Hi Eliot,
>
> I think that platforms/unix/vm/include_ucontext.h is working correctly.
> Using -E -dM, I can confirm:
>
> #define __linux__ 1
> #define __x86_64 1
>
> Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
> which is where I think the issue originates(?).
>
> So there is something else going wrong with the includes for Linux, but
> I am blind and cannot spot it.
>
> Dave
>
>
>




sqUnixMain.i (265K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Tobias Pape
 
Hi Bruce, all


> On 25. Mar 2021, at 10:32, Bruce O'Neel <[hidden email]> wrote:
>
> Hi,
>
> I've attached sqUnixMain.i from the command below.

Thanks, that helps.

The problem is here:

# 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c" 2
# 36 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c"
# 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h" 1
# 12 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 439 "/usr/include/features.h" 3 4
# 1 "/usr/include/stdc-predef.h" 1 3 4


This is due to aafcb78371c7e576073a8dbf2f1f32667568e05e, Where the include of "sqConfig.h" was demoted to _after_ stdio.h and such.

This seems to deal with an interdependency between EXPORT and sqPlatformSpecific.h
but I don't understand what that has to do with sqConfig.h

I see that _only_ win32 is doing a lot of stuff in sqConfig.h (via sqWin32.h) which _most probably_ would belong in sqPlatformSpecific.h in the first place.

Since Eliot strongly-worded to not change that, I wont commit a fix.

best
        -tobias



>
> And yes it is in config.h
>
>
> #ifndef _GNU_SOURCE
> # define _GNU_SOURCE 1
> #endif
>
> Thanks.
>
> bruce
>
>
>
> 25 March 2021 10:14 Tobias Pape <[hidden email]> wrote:
> Hi Bruce and all
>
> > On 25. Mar 2021, at 09:43, Bruce O'Neel wrote:
> >
> > Hi,
> >
> > Yea that's right, but, I think that is not where the problem is.
> >
> > What seems to have happened is that someone got clever with which is included in the beginning of and which must have changed between different versions of Linux. So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.
>
>
> > Now it seams that the magic #define is _GNU_SOURCE.
>
> This is so quite a long time already.
> I just checked a system frozen in time in 2012, it is the same there.
> All __USE_* get undefined in features.h and only set with the respective _*_SOURCE options.
>
> The __USE_GNU dance in
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/vm/include_ucontext.h#L15
>
> is hence sadly ineffective.
>
>
> >
> > The easiest patch I found is below and attached above. I also attached features.h just so you can see the nightmare that has become.
> >
> > diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
> > index 29b710460..eb67f677e 100755
> > --- a/build.linux64x64/squeak.cog.spur/build/mvm
> > +++ b/build.linux64x64/squeak.cog.spur/build/mvm
> > @@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
> > --with-src=spur64src \
> > TARGET_ARCH="-m64" \
> > CC=clang \
> > - CFLAGS="$CFLAGS" \
> > + CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
> > LIBS="$LIBS" \
> > LDFLAGS="$LDFLAGS"
> > rm -f vm/sqUnixMain.o # nuke version info
> >
> Configure should define that!
>
> AC_USE_SYSTEM_EXTENSIONS in
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/config/configure.ac#L42
> does exactly that: if GNU Extensions are avaialbe, define _GNU_SORUCE.
>
> This define should be in config.h
>
> This is the unconfigured file: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/config/config.h.in#L392
>
> Once you run ./configure, it _will_ define _GNU_SOURCE.
>
> However, it must be sur that config.h is included.
> This is done unconditionally in sqMemoryAccess.h and conditionally (HAVE_CONFIG_H) in sqConfig.h (which is pulled by sq.h)
> (HAVE_CONFIG_H is set as I see in your email from 2 days ago)
>
>
> Based on your command in your email, can yous please send the output of
>
> clang -Wall -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -E -o sqUnixMain.i /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c
>
> and the resulting sqUnixMain.i?
>
>
> Best regards
> -Tobias
>
>
> > I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.
> >
> > This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.
> >
> > cheers
> >
> > bruce
> >
> > 24 March 2021 20:58 "David T. Lewis" wrote:
> >
> > On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
> > >
> > > Hi David,
> > >
> > > On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
> > >
> > > >
> > > > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > That fixed one problem I was tripping over on the ARMv8 build.
> > > > >
> > > > > There still seems to be a problem with the x86-64 build.????
> > > > >
> > > > > Thanks.
> > > > >
> > > > > bruce
> > > >
> > > > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > > > of
> > > > the problem, but it seems to have been introduced in this commit:
> > > >
> > > > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > > > Author: Eliot Miranda
> > > > Date: Wed Feb 10 21:41:31 2021 -0800
> > > >
> > > > Revisions to core include files to get EXPORT defined correctly at the
> > > > relevant points.
> > > > Essentially move the default EXPORT definitions from sq.h to
> > > > sqMemoryAccess.h.
> > > > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > > > their CFLAGS
> > > > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > > > skip]
> > > > cuz new cogit files will arrive soon.
> > > >
> > > >
> > > > The changes seem straightforward, but for some reason the header files must
> > > > not be getting included properly.
> > > >
> > > > Dave
> > > >
> > > > >
> > > > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > > > error: use of undeclared identifier 'REG_RBP'
> > > >
> > >
> > > If you have a look at the code here the file is trying to
> > > - find out what platform it is on
> > > - pull in the relevant version of ucontext.h containing the relevant
> > > defines for extracting register values from an interrupt context
> > > - print out the registers for a crash report
> > > So please look to
> > > - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> > > this platform
> > > - find out what are the platform defines (-E -dM is your friend here)
> > > - find out how ucontext.h defines the registers in a ucontext
> > >
> >
> > Hi Eliot,
> >
> > I think that platforms/unix/vm/include_ucontext.h is working correctly.
> > Using -E -dM, I can confirm:
> >
> > #define __linux__ 1
> > #define __x86_64 1
> >
> > Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
> > which is where I think the issue originates(?).
> >
> > So there is something else going wrong with the includes for Linux, but
> > I am blind and cannot spot it.
> >
> > Dave
> >
> >
> >
>
>
>
> <sqUnixMain.i>


Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Eliot Miranda-2
 
Hi Tobias, Hi All,

On Thu, Mar 25, 2021 at 3:04 AM Tobias Pape <[hidden email]> wrote:
Hi Bruce, all


> On 25. Mar 2021, at 10:32, Bruce O'Neel <[hidden email]> wrote:
>
> Hi,
>
> I've attached sqUnixMain.i from the command below.

Thanks, that helps.

The problem is here:

# 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c" 2
# 36 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c"
# 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h" 1
# 12 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 439 "/usr/include/features.h" 3 4
# 1 "/usr/include/stdc-predef.h" 1 3 4


This is due to aafcb78371c7e576073a8dbf2f1f32667568e05e, Where the include of "sqConfig.h" was demoted to _after_ stdio.h and such.

This seems to deal with an interdependency between EXPORT and sqPlatformSpecific.h
but I don't understand what that has to do with sqConfig.h

I see that _only_ win32 is doing a lot of stuff in sqConfig.h (via sqWin32.h) which _most probably_ would belong in sqPlatformSpecific.h in the first place.

Since Eliot strongly-worded to not change that, I wont commit a fix.

I am trying to maintain a complex product across Windows and MacOS, and soon enough linux ARMv8.  In doing this I hade to change the order of includes for sqPlatformSpecific.h to get the EXPORT & IMPORT macros correctly defined to be able to share variables and functions between the VM and dlls on Windows.  This *must not* be broken.

I do not object to including a config.h file before any platform includes, provided that that config.h is generated *and only defines values meaningful to the platform include files*.  I find sqConfig.h noise at best.  Its purpose is unclear and differs across platforms.

I said many years ago that I find the current automake code in platforms/unix/config a disaster:
- it does not run reliably on many linuxes
- it does not produce the same configure script when run on different distros and different versions of the same distro
- it is two phase, one must first compile, and then configure
- the makefiles it produces are awal: they don't include dependency information so one must manually delete objects to get proper recompilation

I have said on numerous occasions that I believe that the right way to tackle these problems is to
- discard the automake nonsense in favour of a small configure script that generates a sqConfig.h in the root of the relevant build directory (e.g. build.linux64x64/sqConfig.h, build.linux64ARMv8/sqConfig.h, etc). -- we can't call it configh.h wit5hout affecting plugins that include code which has its own config.h
- use proper static makefiles that are parameterised by plugins.int, plugins.ext and the mvm script

But no one is stepping up to help.  So I'm just going to ensure that Terf works (it includes everything Squeak does and then much more) on the platforms we care about at the moment, and try and try and address the structural problems with the current platform sources when I have time, or when (as the IMPORT/EXPORT issue did) issues force addressing them.

I've written and maintained the static makefiles for MacOS.  I've written the static MSVC Makefiles for WIndows.  I've maintained with Nicholas the static Makefiles for MinGW/Cygwin that Andreas contributed.  I've spent far too long struggling with the autoconf mess on unix.  Anybody prepared to step up and move to statuic makefiles, a config.h in every build directory and move all generated and platform source files to conform to the template

#include "sqConfig.h"
#include <platform headers>
#include "our readers

?


and test across at least 64-bit macos, windows, msvc & mingw/cygwin, & at least one linux platform?

best
        -tobias



>
> And yes it is in config.h
>
>
> #ifndef _GNU_SOURCE
> # define _GNU_SOURCE 1
> #endif
>
> Thanks.
>
> bruce
>
>
>
> 25 March 2021 10:14 Tobias Pape <[hidden email]> wrote:
> Hi Bruce and all
>
> > On 25. Mar 2021, at 09:43, Bruce O'Neel wrote:
> >
> > Hi,
> >
> > Yea that's right, but, I think that is not where the problem is.
> >
> > What seems to have happened is that someone got clever with which is included in the beginning of and which must have changed between different versions of Linux. So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.
>
>
> > Now it seams that the magic #define is _GNU_SOURCE.
>
> This is so quite a long time already.
> I just checked a system frozen in time in 2012, it is the same there.
> All __USE_* get undefined in features.h and only set with the respective _*_SOURCE options.
>
> The __USE_GNU dance in
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/vm/include_ucontext.h#L15
>
> is hence sadly ineffective.
>
>
> >
> > The easiest patch I found is below and attached above. I also attached features.h just so you can see the nightmare that has become.
> >
> > diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
> > index 29b710460..eb67f677e 100755
> > --- a/build.linux64x64/squeak.cog.spur/build/mvm
> > +++ b/build.linux64x64/squeak.cog.spur/build/mvm
> > @@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
> > --with-src=spur64src \
> > TARGET_ARCH="-m64" \
> > CC=clang \
> > - CFLAGS="$CFLAGS" \
> > + CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
> > LIBS="$LIBS" \
> > LDFLAGS="$LDFLAGS"
> > rm -f vm/sqUnixMain.o # nuke version info
> >
> Configure should define that!
>
> AC_USE_SYSTEM_EXTENSIONS in
> https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/config/configure.ac#L42
> does exactly that: if GNU Extensions are avaialbe, define _GNU_SORUCE.
>
> This define should be in config.h
>
> This is the unconfigured file: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/config/config.h.in#L392
>
> Once you run ./configure, it _will_ define _GNU_SOURCE.
>
> However, it must be sur that config.h is included.
> This is done unconditionally in sqMemoryAccess.h and conditionally (HAVE_CONFIG_H) in sqConfig.h (which is pulled by sq.h)
> (HAVE_CONFIG_H is set as I see in your email from 2 days ago)
>
>
> Based on your command in your email, can yous please send the output of
>
> clang -Wall -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -E -o sqUnixMain.i /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c
>
> and the resulting sqUnixMain.i?
>
>
> Best regards
> -Tobias
>
>
> > I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.
> >
> > This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.
> >
> > cheers
> >
> > bruce
> >
> > 24 March 2021 20:58 "David T. Lewis" wrote:
> >
> > On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
> > >
> > > Hi David,
> > >
> > > On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
> > >
> > > >
> > > > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > > > >
> > > > >
> > > > > Hi,
> > > > >
> > > > > That fixed one problem I was tripping over on the ARMv8 build.
> > > > >
> > > > > There still seems to be a problem with the x86-64 build.????
> > > > >
> > > > > Thanks.
> > > > >
> > > > > bruce
> > > >
> > > > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > > > of
> > > > the problem, but it seems to have been introduced in this commit:
> > > >
> > > > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > > > Author: Eliot Miranda
> > > > Date: Wed Feb 10 21:41:31 2021 -0800
> > > >
> > > > Revisions to core include files to get EXPORT defined correctly at the
> > > > relevant points.
> > > > Essentially move the default EXPORT definitions from sq.h to
> > > > sqMemoryAccess.h.
> > > > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > > > their CFLAGS
> > > > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > > > skip]
> > > > cuz new cogit files will arrive soon.
> > > >
> > > >
> > > > The changes seem straightforward, but for some reason the header files must
> > > > not be getting included properly.
> > > >
> > > > Dave
> > > >
> > > > >
> > > > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > > > error: use of undeclared identifier 'REG_RBP'
> > > >
> > >
> > > If you have a look at the code here the file is trying to
> > > - find out what platform it is on
> > > - pull in the relevant version of ucontext.h containing the relevant
> > > defines for extracting register values from an interrupt context
> > > - print out the registers for a crash report
> > > So please look to
> > > - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> > > this platform
> > > - find out what are the platform defines (-E -dM is your friend here)
> > > - find out how ucontext.h defines the registers in a ucontext
> > >
> >
> > Hi Eliot,
> >
> > I think that platforms/unix/vm/include_ucontext.h is working correctly.
> > Using -E -dM, I can confirm:
> >
> > #define __linux__ 1
> > #define __x86_64 1
> >
> > Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
> > which is where I think the issue originates(?).
> >
> > So there is something else going wrong with the includes for Linux, but
> > I am blind and cannot spot it.
> >
> > Dave
> >
> >
> >
>
>
>
> <sqUnixMain.i>




--
_,,,^..^,,,_
best, Eliot
Reply | Threaded
Open this post in threaded view
|

Re: [OpenSmalltalk/opensmalltalk-vm] sqUnixEvent.c missing from platforms/unix/vm (#555)

Tobias Pape
 
Hi Eliot

> On 25. Mar 2021, at 22:43, Eliot Miranda <[hidden email]> wrote:
>
> Hi Tobias, Hi All,
>


I just wanted to respect your request _not_ rewriting what you committed in that one commit.


> On Thu, Mar 25, 2021 at 3:04 AM Tobias Pape <[hidden email]> wrote:
> Hi Bruce, all
>
>
> > On 25. Mar 2021, at 10:32, Bruce O'Neel <[hidden email]> wrote:
> >
> > Hi,
> >
> > I've attached sqUnixMain.i from the command below.
>
> Thanks, that helps.
>
> The problem is here:
>
> # 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c" 2
> # 36 "/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c"
> # 1 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h" 1
> # 12 "/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm/sq.h"
> # 1 "/usr/include/stdio.h" 1 3 4
> # 27 "/usr/include/stdio.h" 3 4
> # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
> # 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
> # 1 "/usr/include/features.h" 1 3 4
> # 439 "/usr/include/features.h" 3 4
> # 1 "/usr/include/stdc-predef.h" 1 3 4
>
>
> This is due to aafcb78371c7e576073a8dbf2f1f32667568e05e, Where the include of "sqConfig.h" was demoted to _after_ stdio.h and such.
>
> This seems to deal with an interdependency between EXPORT and sqPlatformSpecific.h
> but I don't understand what that has to do with sqConfig.h
>
> I see that _only_ win32 is doing a lot of stuff in sqConfig.h (via sqWin32.h) which _most probably_ would belong in sqPlatformSpecific.h in the first place.
>
> Since Eliot strongly-worded to not change that, I wont commit a fix.
>
> I am trying to maintain a complex product across Windows and MacOS, and soon enough linux ARMv8.  In doing this I hade to change the order of includes for sqPlatformSpecific.h to get the EXPORT & IMPORT macros correctly defined to be able to share variables and functions between the VM and dlls on Windows.  This *must not* be broken.
>
> I do not object to including a config.h file before any platform includes, provided that that config.h is generated *and only defines values meaningful to the platform include files*.  I find sqConfig.h noise at best.  Its purpose is unclear and differs across platforms.
>
> I said many years ago that I find the current automake code in platforms/unix/config a disaster:
> - it does not run reliably on many linuxes
> - it does not produce the same configure script when run on different distros and different versions of the same distro
> - it is two phase, one must first compile, and then configure
> - the makefiles it produces are awal: they don't include dependency information so one must manually delete objects to get proper recompilation
>
> I have said on numerous occasions that I believe that the right way to tackle these problems is to
> - discard the automake nonsense in favour of a small configure script that generates a sqConfig.h in the root of the relevant build directory (e.g. build.linux64x64/sqConfig.h, build.linux64ARMv8/sqConfig.h, etc). -- we can't call it configh.h wit5hout affecting plugins that include code which has its own config.h
> - use proper static makefiles that are parameterised by plugins.int, plugins.ext and the mvm script
>
> But no one is stepping up to help.  So I'm just going to ensure that Terf works (it includes everything Squeak does and then much more) on the platforms we care about at the moment, and try and try and address the structural problems with the current platform sources when I have time, or when (as the IMPORT/EXPORT issue did) issues force addressing them.
>
> I've written and maintained the static makefiles for MacOS.  I've written the static MSVC Makefiles for WIndows.  I've maintained with Nicholas the static Makefiles for MinGW/Cygwin that Andreas contributed.  I've spent far too long struggling with the autoconf mess on unix.  Anybody prepared to step up and move to statuic makefiles, a config.h in every build directory and move all generated and platform source files to conform to the template
>
> #include "sqConfig.h"
> #include <platform headers>
> #include "our readers
>
> ?
>
>
> and test across at least 64-bit macos, windows, msvc & mingw/cygwin, & at least one linux platform?


I know your stance regarding the configure stuff and hence did not want to interfere.
I still disagree with the hand-crafted solution. I deem it not viable.
But as I have not nearly as much contributed here, I won't interfere.
I'm just tired of hand-written static makefiles. Sorry.

Best regards
        -Tobi



>
> best
>         -tobias
>
>
>
> >
> > And yes it is in config.h
> >
> >
> > #ifndef _GNU_SOURCE
> > # define _GNU_SOURCE 1
> > #endif
> >
> > Thanks.
> >
> > bruce
> >
> >
> >
> > 25 March 2021 10:14 Tobias Pape <[hidden email]> wrote:
> > Hi Bruce and all
> >
> > > On 25. Mar 2021, at 09:43, Bruce O'Neel wrote:
> > >
> > > Hi,
> > >
> > > Yea that's right, but, I think that is not where the problem is.
> > >
> > > What seems to have happened is that someone got clever with which is included in the beginning of and which must have changed between different versions of Linux. So I'm on what is basically Ubuntu 20.4 and they have played around what __USE_GNU means.
> >
> >
> > > Now it seams that the magic #define is _GNU_SOURCE.
> >
> > This is so quite a long time already.
> > I just checked a system frozen in time in 2012, it is the same there.
> > All __USE_* get undefined in features.h and only set with the respective _*_SOURCE options.
> >
> > The __USE_GNU dance in
> > https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/vm/include_ucontext.h#L15
> >
> > is hence sadly ineffective.
> >
> >
> > >
> > > The easiest patch I found is below and attached above. I also attached features.h just so you can see the nightmare that has become.
> > >
> > > diff --git a/build.linux64x64/squeak.cog.spur/build/mvm b/build.linux64x64/squeak.cog.spur/build/mvm
> > > index 29b710460..eb67f677e 100755
> > > --- a/build.linux64x64/squeak.cog.spur/build/mvm
> > > +++ b/build.linux64x64/squeak.cog.spur/build/mvm
> > > @@ -34,7 +34,7 @@ test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak
> > > --with-src=spur64src \
> > > TARGET_ARCH="-m64" \
> > > CC=clang \
> > > - CFLAGS="$CFLAGS" \
> > > + CFLAGS="$CFLAGS -D_GNU_SOURCE=1" \
> > > LIBS="$LIBS" \
> > > LDFLAGS="$LDFLAGS"
> > > rm -f vm/sqUnixMain.o # nuke version info
> > >
> > Configure should define that!
> >
> > AC_USE_SYSTEM_EXTENSIONS in
> > https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/4f6b75b56b314c20b1842078872bd845d61344a4/platforms/unix/config/configure.ac#L42
> > does exactly that: if GNU Extensions are avaialbe, define _GNU_SORUCE.
> >
> > This define should be in config.h
> >
> > This is the unconfigured file: https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/config/config.h.in#L392
> >
> > Once you run ./configure, it _will_ define _GNU_SOURCE.
> >
> > However, it must be sur that config.h is included.
> > This is done unconditionally in sqMemoryAccess.h and conditionally (HAVE_CONFIG_H) in sqConfig.h (which is pulled by sq.h)
> > (HAVE_CONFIG_H is set as I see in your email from 2 days ago)
> >
> >
> > Based on your command in your email, can yous please send the output of
> >
> > clang -Wall -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/build.linux64x64/squeak.cog.spur/build -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/usr/local/include -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm -I/home/edoneel/tmp/opensmalltalk-vm/spur64src/vm -I/home/edoneel/tmp/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin -I/home/edoneel/tmp/opensmalltalk-vm/platforms/unix/plugins/B3DAcceleratorPlugin -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -E -o sqUnixMain.i /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c
> >
> > and the resulting sqUnixMain.i?
> >
> >
> > Best regards
> > -Tobias
> >
> >
> > > I tried to play the same ifdef games currently with __USE_GNU in include_ucontext.h but I was not successful.
> > >
> > > This builds both with clang and with gcc on Ubuntu 20.4 on x86_64.
> > >
> > > cheers
> > >
> > > bruce
> > >
> > > 24 March 2021 20:58 "David T. Lewis" wrote:
> > >
> > > On Wed, Mar 24, 2021 at 11:54:55AM -0700, Eliot Miranda wrote:
> > > >
> > > > Hi David,
> > > >
> > > > On Mon, Mar 22, 2021 at 4:14 PM David T. Lewis wrote:
> > > >
> > > > >
> > > > > On Mon, Mar 22, 2021 at 11:46:27AM +0100, Bruce O'Neel wrote:
> > > > > >
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > That fixed one problem I was tripping over on the ARMv8 build.
> > > > > >
> > > > > > There still seems to be a problem with the x86-64 build.????
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > bruce
> > > > >
> > > > > I see the same issue on my Linux x86-64 PC. I cannot spot the exact cause
> > > > > of
> > > > > the problem, but it seems to have been introduced in this commit:
> > > > >
> > > > > commit 6d74c4b652c7780110fe327f97e98aaef5242fbc
> > > > > Author: Eliot Miranda
> > > > > Date: Wed Feb 10 21:41:31 2021 -0800
> > > > >
> > > > > Revisions to core include files to get EXPORT defined correctly at the
> > > > > relevant points.
> > > > > Essentially move the default EXPORT definitions from sq.h to
> > > > > sqMemoryAccess.h.
> > > > > Include fbdev support in build.linux32ARMv6 builds and add -m32 to
> > > > > their CFLAGS
> > > > > to attempt to get the 32-bit VMs to be compilable on 64-bit ARM. [ci
> > > > > skip]
> > > > > cuz new cogit files will arrive soon.
> > > > >
> > > > >
> > > > > The changes seem straightforward, but for some reason the header files must
> > > > > not be getting included properly.
> > > > >
> > > > > Dave
> > > > >
> > > > > >
> > > > > /home/edoneel/tmp/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:926:35:
> > > > > error: use of undeclared identifier 'REG_RBP'
> > > > >
> > > >
> > > > If you have a look at the code here the file is trying to
> > > > - find out what platform it is on
> > > > - pull in the relevant version of ucontext.h containing the relevant
> > > > defines for extracting register values from an interrupt context
> > > > - print out the registers for a crash report
> > > > So please look to
> > > > - find out if platforms/unix/vm/include_ucontext.h is working correctly on
> > > > this platform
> > > > - find out what are the platform defines (-E -dM is your friend here)
> > > > - find out how ucontext.h defines the registers in a ucontext
> > > >
> > >
> > > Hi Eliot,
> > >
> > > I think that platforms/unix/vm/include_ucontext.h is working correctly.
> > > Using -E -dM, I can confirm:
> > >
> > > #define __linux__ 1
> > > #define __x86_64 1
> > >
> > > Also, include_ucontext.h was not modified in commit 924a24bb54870a621c5283f23631261d5a792000
> > > which is where I think the issue originates(?).
> > >
> > > So there is something else going wrong with the includes for Linux, but
> > > I am blind and cannot spot it.
> > >
> > > Dave
> > >
> > >
> > >
> >
> >
> >
> > <sqUnixMain.i>