Hi everybody,
My name is Ignacio Truffat, I am currently working for my University's final project in Smalltalk. This language and the tool-set all look fantastic.
Currently trying to grasp the process of building a VM. I am using 64b linux Mint. So far I have been able to:
- Make the necessary configurations - Run *`scripts/updateSCCSVersions`* successfully - Install all libraries (or their equivalent, such as 'g++') as described in *`building/linux64x64/HowToBuild`* - Create a VMMaker image via the scripts in Platform - Use Squeak to run the VMMaker image - Use the VMMaker image to produce c-code (goes to the *`src`* folder) - Try to build the image using ` *building/linux64x64/squeak.cog.spurt/builds/mvm`*
This last step is the one which is failing. For some reason, it seems the building step for plugin IA32ABI is failing. Here you have the excerpt:
--------************************** gcc -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 -Wno-unused-but-set-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/unix/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog -I/usr/local/include -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c -o xabicc.o /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:21:22: warning: missing terminating ' character 21 | # error Windows doesn't use the SystemV ABI | ^ In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c: In function ‘thunkEntry’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: error: ‘DisownVMFromCallback’ undeclared (first use in this function) 194 | interpreterProxy->disownVM(DisownVMFromCallback); | ^~~~~~~~~~~~~~~~~~~~ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:204: xabicc.o] Error 1 make: *** [Makefile:470: IA32ABI/IA32ABI.a] Error 2 --------**************************
(will attach the whole log as an attachment in the email)
Tried to see if I could simply remove the IA32ABI plugin, but the whole thing also breaks. Apparently it's being imported from other places, so maybe it's not something I should remove?
Anyway, looking forward to your replies. Thank you for your time and attention.
Cheers.
Hi Ignacio --
Try clang instead of gcc. The CI builds and uses clang: https://github.com/OpenSmalltalk/opensmalltalk-vm/actions/workflows/linux.ym...
If you suspect a broken HEAD, try the last stable tag: https://github.com/OpenSmalltalk/opensmalltalk-vm/tree/202312181441
The MCM configuration map for VMMaker also has a tag for this version. You can then generate the C sources for 202312181441 by yourself.
I suspect gcc. Try clang :-)
Best, Marcel
Am 26.04.2024 15:33:08 schrieb Ignacio Truffat imtruffat@gmail.com:
Hi Ignacio,
it looks like there is some coding error in the #ifdef’s that select the relevant platform file included by xabicc.c, or in x64sysvabicc.c. In these cases you can use -E and/or -P to see what the preprocessor feeds to the compiler. There’s also a switch that causes the compiler to print out the predefined macros. This will help you debug the ifdef problem.
BTW, you only need your generate new vm sources if you’re actually changing the core vm. If you are, that’s great! In which case, welcome, and I’m curious what your project involves. If not, no matter, but just build from the sources in the opensmalltalk-vm repo.
Good luck! Eliot _,,,^..^,,,_ (phone)
On Apr 26, 2024, at 6:29 AM, Ignacio Truffat imtruffat@gmail.com wrote:
Hi everybody,
My name is Ignacio Truffat, I am currently working for my University's final project in Smalltalk. This language and the tool-set all look fantastic.
Currently trying to grasp the process of building a VM. I am using 64b linux Mint. So far I have been able to: Make the necessary configurations Run `scripts/updateSCCSVersions` successfully Install all libraries (or their equivalent, such as 'g++') as described in `building/linux64x64/HowToBuild` Create a VMMaker image via the scripts in Platform Use Squeak to run the VMMaker image Use the VMMaker image to produce c-code (goes to the `src` folder) Try to build the image using `building/linux64x64/squeak.cog.spurt/builds/mvm`
This last step is the one which is failing. For some reason, it seems the building step for plugin IA32ABI is failing. Here you have the excerpt:
--------************************** gcc -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 -Wno-unused-but-set-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/unix/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog -I/usr/local/include -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c -o xabicc.o /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:21:22: warning: missing terminating ' character 21 | # error Windows doesn't use the SystemV ABI | ^ In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c: In function ‘thunkEntry’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: error: ‘DisownVMFromCallback’ undeclared (first use in this function) 194 | interpreterProxy->disownVM(DisownVMFromCallback); | ^~~~~~~~~~~~~~~~~~~~ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:204: xabicc.o] Error 1 make: *** [Makefile:470: IA32ABI/IA32ABI.a] Error 2 --------**************************
(will attach the whole log as an attachment in the email)
Tried to see if I could simply remove the IA32ABI plugin, but the whole thing also breaks. Apparently it's being imported from other places, so maybe it's not something I should remove?
Anyway, looking forward to your replies. Thank you for your time and attention.
Cheers. <full_log.txt>
Hi everybody, thank you for your swift replies! I will try to keep up to date with my compilation issue. C/C++ are not my strongest suit, so it's likely I'll ask something similar in the future. I appreciate the patience.
Not entirely sure how to debug it, but apparently the files are being imported in a weird order, which is why values defined in preprocessor directives are missing. As a quick workaround, I tried to see if I could change the standard library version to any version that allowed implicit definitions (which in theory can tolerate the bad-order).
- With GNU99/C17 I was actually able to run a complete compilation, but in the end my squeak program ended up having an stack overflow issues, so I wouldn't call it a success. - Small side-note: I needed to install `libxrandr-dev` to complete the building stage. Not sure if it was just my machine, if anyone else can replicate it that might be relevant for the `HowToBuild` file.
So, no luck so far. I have the stack dump from my failed attempt, but I believe this crash is probably related to my changed standard versions. For the sake of completeness, I am attaching the dump but feel free to ignore it as I don't believe it to be the guilty party. Will probably keep trying a few things and debugging the compilation, posting again if I find myself unable to make progress on my own.
-----
@MarcelTaeumel: Thank you for your time. I already tried to use CLang instead of GCC, but I am getting the exact same warnings and same errors. I imagine it's probably related to some defaults on my machine/OS, more than the compilation tools themselves. Will keep looking.
-----
@ElliotMiranda: Also thank you for your answer! It seems you are correct and the problem is probably some preprocessor directive. I am not exactly familiar with how to debug gcc/clang, but I'll keep looking and post any update here.
Right now I am working as part of a bigger project to add full live-typing support to the squeak vm, which has to capture the behavior of calls being made during execution, so we do need to change the core VM. I honestly believe that this tool can be very useful for any language in general, but in particular for something as dynamic as Smalltalk. It opens the doors for a big quantity of QoL improvements for coders (such as linters , autocompleters, etc).
-----
Kind regards, Ignacio.
On Sat, Apr 27, 2024 at 12:49 AM Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Ignacio,
it looks like there is some coding error in the #ifdef’s that select
the relevant platform file included by xabicc.c, or in x64sysvabicc.c. In these cases you can use -E and/or -P to see what the preprocessor feeds to the compiler. There’s also a switch that causes the compiler to print out the predefined macros. This will help you debug the ifdef problem.
BTW, you only need your generate new vm sources if you’re actually changing the core vm. If you are, that’s great! In which case, welcome, and I’m curious what your project involves. If not, no matter, but just build from the sources in the opensmalltalk-vm repo.
Good luck! Eliot _,,,^..^,,,_ (phone)
On Apr 26, 2024, at 6:29 AM, Ignacio Truffat imtruffat@gmail.com wrote:
Hi everybody,
My name is Ignacio Truffat, I am currently working for my University's final project in Smalltalk. This language and the tool-set all look fantastic.
Currently trying to grasp the process of building a VM. I am using 64b linux Mint. So far I have been able to:
- Make the necessary configurations
described in *`building/linux64x64/HowToBuild`*
- Run *`scripts/updateSCCSVersions`* successfully
- Install all libraries (or their equivalent, such as 'g++') as
- Create a VMMaker image via the scripts in Platform
- Use Squeak to run the VMMaker image
- Use the VMMaker image to produce c-code (goes to the *`src`* folder)
- Try to build the image using `
*building/linux64x64/squeak.cog.spurt/builds/mvm`*
This last step is the one which is failing. For some reason, it seems the building step for plugin IA32ABI is failing. Here you have the excerpt:
--------************************** gcc -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 -Wno-unused-but-set-variable -DHAVE_CONFIG_H -DSQUEAK_BUILTIN_PLUGIN -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/unix/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/vm -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog -I/usr/local/include -I/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c -o xabicc.o /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:21:22: warning: missing terminating ' character 21 | # error Windows doesn't use the SystemV ABI | ^ In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c: In function ‘thunkEntry’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: error: ‘DisownVMFromCallback’ undeclared (first use in this function) 194 | interpreterProxy->disownVM(DisownVMFromCallback); | ^~~~~~~~~~~~~~~~~~~~ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [Makefile:204: xabicc.o] Error 1 make: *** [Makefile:470: IA32ABI/IA32ABI.a] Error 2 --------**************************
(will attach the whole log as an attachment in the email)
Tried to see if I could simply remove the IA32ABI plugin, but the whole thing also breaks. Apparently it's being imported from other places, so maybe it's not something I should remove?
Anyway, looking forward to your replies. Thank you for your time and attention.
Cheers. <full_log.txt>
On 2024-04-29, at 2:35 PM, Ignacio Truffat imtruffat@gmail.com wrote:/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c
In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:21:22: warning: missing terminating ' character 21 | # error Windows doesn't use the SystemV ABI | ^ In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c: In function ‘thunkEntry’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: error: ‘DisownVMFromCallback’ undeclared (first use in this function) 194 | interpreterProxy->disownVM(DisownVMFromCallback); | ^~~~~~~~~~~~~~~~~~~~ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: note: each undeclared identifier is reported only once for each function it appears in
The proximate issue is that something is trying to compile the code for Windows (ie you have got defined values for one of the x86_64 related defines and either _MSC_VER or _MINGW32_ stuff defined. I doubt that this is what you need if you are building on a mint linux system!
Tried to see if I could simply remove the IA32ABI plugin, but the whole thing also breaks. Apparently it's being imported from other places, so maybe it's not something I should remove?
Hmph; while it may be that not having a specific plugin makes the system not run (though that shouldn't be the case, that's why they're plugins!) it should certainly not be the case that it prevents building a vm. Something is wrong at a higher level of your build setup.
Are you building on mint linux, for mint linux? Or are you doing some strange cross-compiling process? You do know that it's called cross-compiling because it mostly makes you cross, right.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: SEOB: Set Every Other Bit
Hi @TimRowledge,
I am happy to build for Mint Linux exclusively. As far as I understand it, I am compiling for this machine and not doing anything Cross. The way I do it is first build the sources in VMMaker, and then run building/linux64x64/squeak.cog.spur/build/mvm with CLang. Nothing in those steps should trigger a Cross compilation.
The fact that there are *some* Cross files installed makes some sense, since many components shared by linux are probably there. If I am also trying to compile windows stuff, then that's probably a problem with my setup. As @EliotMiranda mentioned above, there is probably an issue with either the pre-proccessor directives and/or the order files are being handled. (which in turn leads to conditional directives missing their chance to trigger)
If you have any idea of what could be wrong, please let me know. Later this week I'll try to investigate a bit deeper on my own and see if I can find anything else. Thank you for your time.
~ Ignacio.
On Tue, Apr 30, 2024 at 8:55 AM Tim Rowledge tim@rowledge.org wrote:
On 2024-04-29, at 2:35 PM, Ignacio Truffat imtruffat@gmail.com
wrote:/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c
In file included from
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21:
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:21:22: warning: missing terminating ' character
21 | # error Windows doesn't use the SystemV ABI | ^ In file included from
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/xabicc.c:21:
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c: In function ‘thunkEntry’:
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: error: ‘DisownVMFromCallback’ undeclared (first use in this function)
194 |
interpreterProxy->disownVM(DisownVMFromCallback);
| ^~~~~~~~~~~~~~~~~~~~
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/platforms/Cross/plugins/IA32ABI/x64sysvabicc.c:194:44: note: each undeclared identifier is reported only once for each function it appears in
The proximate issue is that something is trying to compile the code for Windows (ie you have got defined values for one of the x86_64 related defines and either _MSC_VER or _MINGW32_ stuff defined. I doubt that this is what you need if you are building on a mint linux system!
Tried to see if I could simply remove the IA32ABI plugin, but the whole
thing also breaks. Apparently it's being imported from other places, so maybe it's not something I should remove?
Hmph; while it may be that not having a specific plugin makes the system not run (though that shouldn't be the case, that's why they're plugins!) it should certainly not be the case that it prevents building a vm. Something is wrong at a higher level of your build setup.
Are you building on mint linux, for mint linux? Or are you doing some strange cross-compiling process? You do know that it's called cross-compiling because it mostly makes you cross, right.
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: SEOB: Set Every Other Bit
On 2024-04-29, at 10:22 PM, Ignacio Truffat imtruffat@gmail.com wrote: I am happy to build for Mint Linux exclusively. As far as I understand it, I am compiling for this machine and not doing anything Cross. The way I do it is first build the sources in VMMaker, and then run building/linux64x64/squeak.cog.spur/build/mvm with CLang. Nothing in those steps should trigger a Cross compilation.
Correct; that ought to make a mint Mint vm.
The fact that there are some Cross files installed makes some sense, since many components shared by linux are probably there.
Yes-ish. The Cross directory is for VM & plugin files common to all (or at least most) platforms. Then the OS/platform specific directories can over-ride if needed. I *think* we don't actually have any such cases. The structure goes all the way back to my original VMMaker project circa 2000 and I suspect we could come up with something better these days, now that all(?) platforms can handle file & directory links.
Still, it's what we have and we deal with it.
If I am also trying to compile windows stuff, then that's probably a problem with my setup. As @EliotMiranda mentioned above, there is probably an issue with either the pre-proccessor directives and/or the order files are being handled. (which in turn leads to conditional directives missing their chance to trigger)
Eliot's point about setting the compiler option '-E' to get the preprocessed output would probably help a lot; it should make clear what path the various defines and tests are causing. Is there a good debug/trace output option for the makefile? '-d' might dump too much for clarity but it should get everything out there.
If you have any idea of what could be wrong, please let me know. Later this week I'll try to investigate a bit deeper on my own and see if I can find anything else. Thank you for your time.
I suspect this is just going to require some patient trawling through logs. Oh, and it appears that using '-dM' (or perhaps '-dD') with the compiler will make sure all the macro definitions get printed to the log. I have faint memories of having used that more years ago than is comfortable...
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Klingon Code Warrior:- 7) "You question the worthiness of my Code?! I should kill you where you stand!"
Hi Everybody,
Thank you for all your help. After a whole week of failure and set-backs, I decided that to refocus my work and just install an Ubuntu VM like @nmsarfati suggested. However, even with a fresh Ubuntu install, I am still getting a similar issue. (compiler is complaining about missing definitions) I understand Ubuntu is one of the Distros that has been thoroughly tested, so I am starting to suspect there is something in the way I am doing things which is wrong.
Just to summarize my steps:
- Run scripts/updateSCCSVersions - Install gcc, clang, build-essentials, and the packages which appear in the HowToBuild. *(sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev)* - Create an image of VMMaker using image/buildspurtrunkvmmaker64image.sh. - Use my Squeak6 (https://squeak.org) with the VMMaker image to build the src files via the following commands: - [VMMaker generateSqueakSpurCog64VM] valueSupplyingAnswer: false. - VMMaker generateVMPlugins. - CD to building/linux64x64/squeak.cog.spur/build and run ./mvm - Log errors.
Will upload the whole log, but here you have the excerpt I consider important:
/home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:14:
error: call to undeclared function 'lookupSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:29: error: call to undeclared function 'class'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: error: call to undeclared function 'methodClass'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: note: did you mean 'methodClassOf'? /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:1588:14: note: 'methodClassOf' declared here 1588 | extern sqInt methodClassOf(sqInt methodPointer); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:34: error: use of undeclared identifier 'SpurMemoryManager' 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59846:3: error: call to undeclared function 'basicRemoveSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59846 | basicRemoveSelector(methodClass(theMethod), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59848:9: error: call to undeclared function 'ensure'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59848 | return ensure(aBlock, (!(theMethod == null) /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59849:5: error: call to undeclared function 'basicAddSelectorwithMethod'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59849 | ? basicAddSelectorwithMethod(methodClass(theMethod), fetchPointerofObject, theMethod) 22 warnings and 7 errors generated. make[1]: *** [Makefile:236: gcc3x-cointerp.o] Error 1 make: *** [Makefile:413: vm/vm.a] Error 2
What's weird is that I did check the src folder and I did not find any declaration of the function lookupSelector in there. Again, C is not my strong suit, so it might be something that gets imported from a standard library. However, in case it's not, I am simply missing files which could indicate I am not building the right thing.
Once again, thank you for your time, and your infinite patience.
Kind regards, Ignacio Truffat.
On Wed, May 1, 2024 at 2:47 AM Tim Rowledge tim@rowledge.org wrote:
On 2024-04-29, at 10:22 PM, Ignacio Truffat imtruffat@gmail.com wrote: I am happy to build for Mint Linux exclusively. As far as I understand
it, I am compiling for this machine and not doing anything Cross. The way I do it is first build the sources in VMMaker, and then run building/linux64x64/squeak.cog.spur/build/mvm with CLang. Nothing in those steps should trigger a Cross compilation.
Correct; that ought to make a mint Mint vm.
The fact that there are some Cross files installed makes some sense,
since many components shared by linux are probably there.
Yes-ish. The Cross directory is for VM & plugin files common to all (or at least most) platforms. Then the OS/platform specific directories can over-ride if needed. I *think* we don't actually have any such cases. The structure goes all the way back to my original VMMaker project circa 2000 and I suspect we could come up with something better these days, now that all(?) platforms can handle file & directory links.
Still, it's what we have and we deal with it.
If I am also trying to compile windows stuff, then that's probably a
problem with my setup. As @EliotMiranda mentioned above, there is probably an issue with either the pre-proccessor directives and/or the order files are being handled. (which in turn leads to conditional directives missing their chance to trigger)
Eliot's point about setting the compiler option '-E' to get the preprocessed output would probably help a lot; it should make clear what path the various defines and tests are causing. Is there a good debug/trace output option for the makefile? '-d' might dump too much for clarity but it should get everything out there.
If you have any idea of what could be wrong, please let me know. Later
this week I'll try to investigate a bit deeper on my own and see if I can find anything else. Thank you for your time.
I suspect this is just going to require some patient trawling through logs. Oh, and it appears that using '-dM' (or perhaps '-dD') with the compiler will make sure all the macro definitions get printed to the log. I have faint memories of having used that more years ago than is comfortable...
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Klingon Code Warrior:- 7) "You question the worthiness of my Code?! I should kill you where you stand!"
On 2024-05-10, at 5:03 AM, Ignacio Truffat imtruffat@gmail.com wrote: I understand Ubuntu is one of the Distros that has been thoroughly tested, so I am starting to suspect there is something in the way I am doing things which is wrong.
Have you successfully done a VM build simply from the pre-made sources on github? No fiddling with VMMaker, just clone the directory tree and build. If *that* fails* then clearly sometihng is wrong with what you have managed to install.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Fractured Idiom:- MONAGE A TROIS - I am three years old
Hi,
As Tim suggests the following should work and is simplier then regening the VM.
I'm on Linux Mint 21.3 which is Ubuntu 22.04 based. Ubuntu 24.04 should be similar.
I install the following packages:
sudo apt install git fossil gcc make
sudo apt install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev
sudo apt install libgl1-mesa-glx libssl-dev libevdev-dev m4 libpulse-dev
sudo apt install libxrandr-dev
sudo apt install freeglut3-dev libglfw3 vim
NB: No clang, just gcc. I have not tried with clang. Not saying it does not work, just haven't tried.
NB2: This is not necessarily a minimal set.
git clone https://github.com/OpenSmalltalk/opensmalltalk-vm.git
./opensmalltalk-vm/scripts/updateSCCSVersions
opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build [http://squeak.cog.spur/build]
./mvm
y
and it should build.
Does it?
Thanks.
bruce
On 2024-05-10T14:03:51.000+02:00, Ignacio Truffat imtruffat@gmail.com wrote:
------------------------- Hi Everybody, Thank you for all your help. After a whole week of failure and set-backs, I decided that to refocus my work and just install an Ubuntu VM like @nmsarfati suggested. However, even with a fresh Ubuntu install, I am still getting a similar issue. (compiler is complaining about missing definitions) I understand Ubuntu is one of the Distros that has been thoroughly tested, so I am starting to suspect there is something in the way I am doing things which is wrong. Just to summarize my steps: * Run scripts/updateSCCSVersions * Install gcc, clang, build-essentials, and the packages which appear in the HowToBuild. _(sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev)_ * Create an image of VMMaker using image/buildspurtrunkvmmaker64image.sh [http://buildspurtrunkvmmaker64image.sh]. * Use my Squeak6 (https://squeak.org)%C2%A0with%C2%A0the%C2%A0VMMaker%C2%A0image%C2%A0to build the src files via the following commands: * [VMMaker generateSqueakSpurCog64VM] valueSupplyingAnswer: false. * VMMaker generateVMPlugins. * CD to building/linux64x64/squeak.cog.spur/build and run ./mvm * Log errors. Will upload the whole log, but here you have the excerpt I consider important:
/home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:14: error: call to undeclared function 'lookupSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:29: error: call to undeclared function 'class'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: error: call to undeclared function 'methodClass'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: note: did you mean 'methodClassOf'? /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:1588:14: note: 'methodClassOf' declared here 1588 | extern sqInt methodClassOf(sqInt methodPointer); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:34: error: use of undeclared identifier 'SpurMemoryManager' 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59846:3: error: call to undeclared function 'basicRemoveSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59846 | basicRemoveSelector(methodClass(theMethod), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59848:9: error: call to undeclared function 'ensure'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59848 | return ensure(aBlock, (!(theMethod == null) /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59849:5: error: call to undeclared function 'basicAddSelectorwithMethod'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59849 | ? basicAddSelectorwithMethod(methodClass(theMethod), fetchPointerofObject, theMethod) 22 warnings and 7 errors generated. make[1]: *** [Makefile:236: gcc3x-cointerp.o] Error 1 make: *** [Makefile:413: vm/vm.a] Error 2
What's weird is that I did check the src folder and I did not find any declaration of the function lookupSelector in there. Again, C is not my strong suit, so it might be something that gets imported from a standard library. However, in case it's not, I am simply missing files which could indicate I am not building the right thing. Once again, thank you for your time, and your infinite patience. Kind regards, Ignacio Truffat. On Wed, May 1, 2024 at 2:47 AM Tim Rowledge tim@rowledge.org wrote:
On 2024-04-29, at 10:22 PM, Ignacio Truffat
imtruffat@gmail.com wrote:
I am happy to build for Mint Linux exclusively. As far as I
understand it, I am compiling for this machine and not doing anything Cross. The way I do it is first build the sources in VMMaker, and then run building/linux64x64/squeak.cog.spur/build/mvm with CLang. Nothing in those steps should trigger a Cross compilation. Correct; that ought to make a mint Mint vm.
The fact that there are some Cross files installed makes some
sense, since many components shared by linux are probably there. Yes-ish. The Cross directory is for VM & plugin files common to all (or at least most) platforms. Then the OS/platform specific directories can over-ride if needed. I *think* we don't actually have any such cases. The structure goes all the way back to my original VMMaker project circa 2000 and I suspect we could come up with something better these days, now that all(?) platforms can handle file & directory links. Still, it's what we have and we deal with it.
If I am also trying to compile windows stuff, then that's
probably a problem with my setup. As @EliotMiranda mentioned above, there is probably an issue with either the pre-proccessor directives and/or the order files are being handled. (which in turn leads to conditional directives missing their chance to trigger) Eliot's point about setting the compiler option '-E' to get the preprocessed output would probably help a lot; it should make clear what path the various defines and tests are causing. Is there a good debug/trace output option for the makefile? '-d' might dump too much for clarity but it should get everything out there.
If you have any idea of what could be wrong, please let me know.
Later this week I'll try to investigate a bit deeper on my own and see if I can find anything else. Thank you for your time. I suspect this is just going to require some patient trawling through logs. Oh, and it appears that using '-dM' (or perhaps '-dD') with the compiler will make sure all the macro definitions get printed to the log. I have faint memories of having used that more years ago than is comfortable... tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Klingon Code Warrior:- 7) "You question the worthiness of my Code?! I should kill you where you stand!"
Hi TimRowledge/BruceONeel,
Thank you very much for your replies.
I never thought about discarding the possibility of building the sources without any modifications. The good news (maybe bad news?) is that I can build the default sources without any major issues as long as I don't modify the source. That's the case for both for my LinuxMint as well as for my UbuntuVM, so it seems that somewhere after VMMaker makes changes to the src that things break down.
I noticed that I was building my VMMaker image and then running it with what might be different versions of Squeak. (not 100% sure, the build scripts download the latest version from squeak but also try to do so from the github, "squeak --version" does not seem to return the correct version of squeak). What's interesting here is that I get different set of errors if I use the same squeak instance the script downloaded (which is probably what most people use). *And perhaps more telling, those errors are consistent between my LinuxMint and my UbuntuVM. *So I might be getting closer.
This time, the main issue seems to that ioHighResClock variable, which is probably defined in SOME C library. (so I am probably missing some dependency) Looking forward to anyone with insight about that, otherwise I'll keep looking myself. Once again, I am copying the relevant part of the logs here, with the whole logs attached:
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:
In function ‘initializeSimulationIOHighResClockForProfiling’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:8295:9: error: ‘ioHighResClock’ undeclared (first use in this function) 8295 | ioHighResClock = outputInstructionsForGeneratedRuntimeAt(codeBase - ((machineCodeBytes(backEnd)) * 2)); In file included from /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogit.c:15: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c: In function ‘genStoreTrampolineCalledinstVarIndex’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19642:9: error: ‘l2’ undeclared (first use in this function) 19642 | l2: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19642:11: error: expected ‘)’ before ‘:’ token 19642 | l2: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19638:27: note: to match this ‘(’ 19638 | ? (/* begin trampolineArgConstant: */ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:9: error: ‘l6’ undeclared (first use in this function) 19662 | l6: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token 19662 | l6: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19658:27: note: to match this ‘(’ 19658 | ? (/* begin trampolineArgConstant: */ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c: In function ‘dispatchConcretize’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:21763:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 21763 | offset1 = (((int) jumpTarget)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:21856:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 21856 | offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 2))); /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:21864:29: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 21864 | offset2 = (((int) jumpTarget1)) - (((int) (((self_in_dispatchConcretize->address)) + 5))); /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c: In function ‘generateSendTrampolines’: /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30085:9: error: ‘l1’ undeclared (first use in this function) 30085 | l1: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30085:11: error: expected ‘)’ before ‘:’ token 30085 | l1: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30081:11: note: to match this ‘(’ 30081 | ? (/* begin trampolineArgConstant: */ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30094:9: error: ‘l2’ undeclared (first use in this function) 30094 | l2: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30094:11: error: expected ‘)’ before ‘:’ token 30094 | l2: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30090:11: note: to match this ‘(’ 30090 | ? (/* begin trampolineArgConstant: */ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30101:9: error: ‘l3’ undeclared (first use in this function) 30101 | l3: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30101:11: error: expected ‘)’ before ‘:’ token 30101 | l3: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30097:11: note: to match this ‘(’ 30097 | ? (/* begin trampolineArgConstant: */ /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30110:9: error: ‘l4’ undeclared (first use in this function) 30110 | l4: /* end trampolineArgConstant: */) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30110:11: error: expected ‘)’ before ‘:’ token 30110 | l4: /* end trampolineArgConstant: */) | ) /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:30106:11: note: to match this ‘(’ 30106 | ? (/* begin trampolineArgConstant: */ make[1]: *** [Makefile:218: cogit.o] Error 1 make: *** [Makefile:413: vm/vm.a] Error 2
Thank you everybody, and I apologize for the continued barrage of compilation logs. Kind regards,
Ignacio Truffat.
On Sat, May 11, 2024 at 3:08 AM Bruce O'Neel bruce.oneel@pckswarms.ch wrote:
Hi,
As Tim suggests the following should work and is simplier then regening the VM.
I'm on Linux Mint 21.3 which is Ubuntu 22.04 based. Ubuntu 24.04 should be similar.
I install the following packages:
sudo apt install git fossil gcc make sudo apt install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev sudo apt install libgl1-mesa-glx libssl-dev libevdev-dev m4 libpulse-dev sudo apt install libxrandr-dev sudo apt install freeglut3-dev libglfw3 vim
NB: No clang, just gcc. I have not tried with clang. Not saying it does not work, just haven't tried. NB2: This is not necessarily a minimal set.
git clone https://github.com/OpenSmalltalk/opensmalltalk-vm.git ./opensmalltalk-vm/scripts/updateSCCSVersions opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build ./mvm y
and it should build.
Does it?
Thanks.
bruce
On 2024-05-10T14:03:51.000+02:00, Ignacio Truffat imtruffat@gmail.com wrote:
Hi Everybody,
Thank you for all your help. After a whole week of failure and set-backs, I decided that to refocus my work and just install an Ubuntu VM like @nmsarfati suggested. However, even with a fresh Ubuntu install, I am still getting a similar issue. (compiler is complaining about missing definitions) I understand Ubuntu is one of the Distros that has been thoroughly tested, so I am starting to suspect there is something in the way I am doing things which is wrong.
Just to summarize my steps:
- Run scripts/updateSCCSVersions
- Install gcc, clang, build-essentials, and the packages which appear
in the HowToBuild. *(sudo apt-get install uuid-dev libcairo2-dev libpango1.0-dev libgl1-mesa-dev libgl1-mesa-glx libssl-dev)*
- Create an image of VMMaker using image/
buildspurtrunkvmmaker64image.sh.
- Use my Squeak6 (https://squeak.org) with the VMMaker image to build
the src files via the following commands: - [VMMaker generateSqueakSpurCog64VM] valueSupplyingAnswer: false. - VMMaker generateVMPlugins.
- CD to building/linux64x64/squeak.cog.spur/build and run ./mvm
- Log errors.
Will upload the whole log, but here you have the excerpt I consider important:
/home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:14: error: call to undeclared function 'lookupSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59840:29: error: call to undeclared function 'class'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59840 | theMethod = lookupSelector(class(), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: error: call to undeclared function 'methodClass'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:7: note: did you mean 'methodClassOf'? /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:1588:14: note: 'methodClassOf' declared here 1588 | extern sqInt methodClassOf(sqInt methodPointer); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59842:34: error: use of undeclared identifier 'SpurMemoryManager' 59842 | if ((methodClass(theMethod)) == SpurMemoryManager) { /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59846:3: error: call to undeclared function 'basicRemoveSelector'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59846 | basicRemoveSelector(methodClass(theMethod), fetchPointerofObject); /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59848:9: error: call to undeclared function 'ensure'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59848 | return ensure(aBlock, (!(theMethod == null) /home/ubuntu/Documents/opensmalltalk-vm/src/spur64.cog/gcc3x-cointerp.c:59849:5: error: call to undeclared function 'basicAddSelectorwithMethod'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 59849 | ? basicAddSelectorwithMethod(methodClass(theMethod), fetchPointerofObject, theMethod) 22 warnings and 7 errors generated. make[1]: *** [Makefile:236: gcc3x-cointerp.o] Error 1 make: *** [Makefile:413: vm/vm.a] Error 2
What's weird is that I did check the src folder and I did not find any declaration of the function lookupSelector in there. Again, C is not my strong suit, so it might be something that gets imported from a standard library. However, in case it's not, I am simply missing files which could indicate I am not building the right thing.
Once again, thank you for your time, and your infinite patience.
Kind regards, Ignacio Truffat.
On Wed, May 1, 2024 at 2:47 AM Tim Rowledge tim@rowledge.org wrote:
On 2024-04-29, at 10:22 PM, Ignacio Truffat imtruffat@gmail.com wrote: I am happy to build for Mint Linux exclusively. As far as I understand
it, I am compiling for this machine and not doing anything Cross. The way I do it is first build the sources in VMMaker, and then run building/linux64x64/squeak.cog.spur/build/mvm with CLang. Nothing in those steps should trigger a Cross compilation.
Correct; that ought to make a mint Mint vm.
The fact that there are some Cross files installed makes some sense,
since many components shared by linux are probably there.
Yes-ish. The Cross directory is for VM & plugin files common to all (or at least most) platforms. Then the OS/platform specific directories can over-ride if needed. I *think* we don't actually have any such cases. The structure goes all the way back to my original VMMaker project circa 2000 and I suspect we could come up with something better these days, now that all(?) platforms can handle file & directory links.
Still, it's what we have and we deal with it.
If I am also trying to compile windows stuff, then that's probably a
problem with my setup. As @EliotMiranda mentioned above, there is probably an issue with either the pre-proccessor directives and/or the order files are being handled. (which in turn leads to conditional directives missing their chance to trigger)
Eliot's point about setting the compiler option '-E' to get the preprocessed output would probably help a lot; it should make clear what path the various defines and tests are causing. Is there a good debug/trace output option for the makefile? '-d' might dump too much for clarity but it should get everything out there.
If you have any idea of what could be wrong, please let me know. Later
this week I'll try to investigate a bit deeper on my own and see if I can find anything else. Thank you for your time.
I suspect this is just going to require some patient trawling through logs. Oh, and it appears that using '-dM' (or perhaps '-dD') with the compiler will make sure all the macro definitions get printed to the log. I have faint memories of having used that more years ago than is comfortable...
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Klingon Code Warrior:- 7) "You question the worthiness of my Code?! I should kill you where you stand!"
On 2024-05-10, at 3:00 PM, Ignacio Truffat imtruffat@gmail.com wrote:
This time, the main issue seems to that ioHighResClock variable, which is probably defined in SOME C library. (so I am probably missing some dependency)
Not (normally) a variable - a function defined in the various platforms/{platform name}/vm/sq{platform name}Heartbeat.c
for example - in platforms/unix/vm/sqUnixITimerHeartbeat.c ==================================== sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0;
#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__)) __asm__ __volatile__ ("rdtsc" : "=A"(value)); #elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) __asm__ __volatile__ ("rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. : "=a" (value) : : "rdx"); #elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) __asm__ __volatile__ ("MRS X0, CNTVCT_EL0"); #elif defined(__arm__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__)) /* tpr - do nothing for now; needs input from eliot to decide further */ /* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-) */ #elif defined(__riscv64__) __asm__ __volatile__ ("rdcycle a0" : "=r"(value)); #else # error "no high res clock defined" #endif return value; }
================================
Hmm, that's interesting, apparently I still owe Eliot info on a high-res clock for ARM64. :-)
The function can just return 0 if you can't work out anything better.
Now it looks like your specific copy of cogitX64SysV.c is very different to the standard one, which makes sense if I correctly remember anything at all about what you are trying to do.
Somewhere you have to declare that variable in a suitable for to assign a... what? Is 'initializeSimulationIOHighResClockForProfiling()' returning a function pointer?
More generally it looks like the C code being generated is not quite correct syntactically either. ======= /home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token 19662 | l6: /* end trampolineArgConstant: */) | ) ===========
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BH: Branch and Hang
Hi Tim, Hi Ignacio,
Re initializeSimulationIOHighResClockForProfiling, it’s simulation time only and shouldn’t be generated. This is fixed in my latest commits.
Ignacio, I’m curious why you want your generate your own sources (and support you in doing so). Realise that Slang is a hack that has grown (metastasized??) over time. My attitude towards it is that it is better to suffer it and fix it while getting proper work done rather than rewriting it from scratch (in moving from 32 to 64 bits I had to do a lot of type inference work). So I apologise for its quality; at the moment it is part of the cost of doing business.
_,,,^..^,,,_ (phone)
On May 10, 2024, at 3:55 PM, Tim Rowledge tim@rowledge.org wrote:
On 2024-05-10, at 3:00 PM, Ignacio Truffat imtruffat@gmail.com wrote:
This time, the main issue seems to that ioHighResClock variable, which is probably defined in SOME C library. (so I am probably missing some dependency)
Not (normally) a variable - a function defined in the various platforms/{platform name}/vm/sq{platform name}Heartbeat.c
for example - in platforms/unix/vm/sqUnixITimerHeartbeat.c ==================================== sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0;
#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) || defined(__i386) || defined(__i386__)) __asm__ __volatile__ ("rdtsc" : "=A"(value)); #elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) || defined(__x86_64) || defined (__x86_64__)) __asm__ __volatile__ ("rdtsc\n\t" // Returns the time in EDX:EAX. "shl $32, %%rdx\n\t" // Shift the upper bits left. "or %%rdx, %0" // 'Or' in the lower bits. : "=a" (value) : : "rdx"); #elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) __asm__ __volatile__ ("MRS X0, CNTVCT_EL0"); #elif defined(__arm__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_7A__)) /* tpr - do nothing for now; needs input from eliot to decide further */ /* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-) */ #elif defined(__riscv64__) __asm__ __volatile__ ("rdcycle a0" : "=r"(value)); #else # error "no high res clock defined" #endif return value; }
================================
Hmm, that's interesting, apparently I still owe Eliot info on a high-res clock for ARM64. :-)
The function can just return 0 if you can't work out anything better.
Now it looks like your specific copy of cogitX64SysV.c is very different to the standard one, which makes sense if I correctly remember anything at all about what you are trying to do.
Somewhere you have to declare that variable in a suitable for to assign a... what? Is 'initializeSimulationIOHighResClockForProfiling()' returning a function pointer?
More generally it looks like the C code being generated is not quite correct syntactically either.
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token 19662 | l6: /* end trampolineArgConstant: */) | ) ===========
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BH: Branch and Hang
Hi Eliot! Ignacio is doing his master thesis with me. His research topic is connected with LiveTyping and it is about collecting the class of block's parameters and variables, something that is not supported by LiveTyping right now. One of the first things I ask the students that are working with the VM is to compile it from scratch, that is, generating the source code with the VMMaker image, then compile it, etc. It is important to have that working because it means the environment setup is correct, also because it helps to understand how everything works. The second step is to play with the simulator, and so on. Ignacio is working on that right now (something Ines Sosa started but could not finished) and Nicolas is working on a crazy idea I shared with some VM guys at ESUG 2019 (sadly you were not there) and that is to generate the PIC at compile time using the type info LiveTyping collected. (We know the performance impact is not going to be that much, but it is an interesting research topic). Angel did his master's thesis porting my code of LiveTyping that worked on the Stack VM to the "JIT VM", maybe you remember he asked some questions about trampolines and so on. He did a great job. Anyway, from time to time I have some crazy students that want to swing into the VM watters. I promise I have nothing to do with it :-)
Cheers! Hernan.
On Sun, May 12, 2024 at 3:42 PM Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Tim, Hi Ignacio,
Re initializeSimulationIOHighResClockForProfiling, it’s simulation time only and shouldn’t be generated. This is fixed in my latest commits.
Ignacio, I’m curious why you want your generate your own sources (and support you in doing so). Realise that Slang is a hack that has grown (metastasized??) over time. My attitude towards it is that it is better to suffer it and fix it while getting proper work done rather than rewriting it from scratch (in moving from 32 to 64 bits I had to do a lot of type inference work). So I apologise for its quality; at the moment it is part of the cost of doing business.
_,,,^..^,,,_ (phone)
On May 10, 2024, at 3:55 PM, Tim Rowledge tim@rowledge.org wrote:
On 2024-05-10, at 3:00 PM, Ignacio Truffat imtruffat@gmail.com wrote:
This time, the main issue seems to that ioHighResClock variable, which
is probably defined in SOME C library. (so I am probably missing some dependency)
Not (normally) a variable - a function defined in the various
platforms/{platform name}/vm/sq{platform name}Heartbeat.c
for example - in platforms/unix/vm/sqUnixITimerHeartbeat.c ==================================== sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0;
#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) ||
defined(__i386) || defined(__i386__))
__asm__ __volatile__ ("rdtsc" : "=A"(value)); #elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) ||
defined(__x86_64) || defined (__x86_64__))
__asm__ __volatile__ ("rdtsc\n\t" // Returns the time in
EDX:EAX.
"shl $32, %%rdx\n\t" // Shift the upper bits
left.
"or %%rdx, %0" // 'Or' in the lower
bits.
: "=a" (value) : : "rdx");
#elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) __asm__ __volatile__ ("MRS X0, CNTVCT_EL0"); #elif defined(__arm__) && (defined(__ARM_ARCH_6__) ||
defined(__ARM_ARCH_7A__))
/* tpr - do nothing for now; needs input from eliot to decide further
*/
/* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-) */ #elif defined(__riscv64__) __asm__ __volatile__ ("rdcycle a0" : "=r"(value)); #else # error "no high res clock defined" #endif return value; }
================================
Hmm, that's interesting, apparently I still owe Eliot info on a high-res
clock for ARM64. :-)
The function can just return 0 if you can't work out anything better.
Now it looks like your specific copy of cogitX64SysV.c is very different
to the standard one, which makes sense if I correctly remember anything at all about what you are trying to do.
Somewhere you have to declare that variable in a suitable for to assign
a... what? Is 'initializeSimulationIOHighResClockForProfiling()' returning a function pointer?
More generally it looks like the C code being generated is not quite
correct syntactically either.
=======
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token
19662 | l6: /* end trampolineArgConstant: */) | ) ===========
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BH: Branch and Hang
HI everybody,
@ElliotMiranda No need to apologize, just by looking at the github-repo I can see the colossal amount of work that went into that. On the contrary, I am trying to understand the building process as much as I can, so as to reduce the risk of finding a building error later on. (when I have made changes to the codebase) That's probably going to make debugging a lot easier, since I will be 99.99% sure the new bugs are something I introduced myself.
The good news is that I just tried to build an imagine with your recent change on my LinuxMint machine, and it seems to have worked! Don't want to jinx it, so I'll test this further before saying anything conclusive, but things seem to be going great for now! Finally I have a working sqcogspur64linuxht built from scratch after using ImageMaker to build the sources.
All and all, thank you very much for your swift response and fixes!
@TimeRowledge. You were correct, it seems that my machine was creating flaky code.
I was able to fix the clock issue (even before @ElliotMiranda's fix) by giving Squeak permission to run multi-threaded (explained here https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/r3732#linux), but then I kept making bad C code. In particular, The file cogitX64SysV.c was generated with invalid syntax, making labels appear within Ternary Conditional Operators.
for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
directedSuperSendTrampolines[numArgs] = (
genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2)? ( /* begin trampolineArgConstant: */ null, assert(numArgs >= 0), -2 - numArgs, l2: /* end trampolineArgConstant: */ ) : SendNumArgsReg)));
Found those bugs really interesting. I had never though much about the syntax of C itself (and how it was parsed), but it's true that labels are probably a very special case. I can upload those C files in case anybody finds this interesting to look into. However, looking further into those is not necessary as @ElliotMirandas's recent change has been able to skip the issue all together.
Kind regards, Ignacio Truffat
On Mon, May 13, 2024 at 4:42 AM Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Tim, Hi Ignacio,
Re initializeSimulationIOHighResClockForProfiling, it’s simulation time only and shouldn’t be generated. This is fixed in my latest commits.
Ignacio, I’m curious why you want your generate your own sources (and support you in doing so). Realise that Slang is a hack that has grown (metastasized??) over time. My attitude towards it is that it is better to suffer it and fix it while getting proper work done rather than rewriting it from scratch (in moving from 32 to 64 bits I had to do a lot of type inference work). So I apologise for its quality; at the moment it is part of the cost of doing business.
_,,,^..^,,,_ (phone)
On May 10, 2024, at 3:55 PM, Tim Rowledge tim@rowledge.org wrote:
On 2024-05-10, at 3:00 PM, Ignacio Truffat imtruffat@gmail.com wrote:
This time, the main issue seems to that ioHighResClock variable, which
is probably defined in SOME C library. (so I am probably missing some dependency)
Not (normally) a variable - a function defined in the various
platforms/{platform name}/vm/sq{platform name}Heartbeat.c
for example - in platforms/unix/vm/sqUnixITimerHeartbeat.c ==================================== sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0;
#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) ||
defined(__i386) || defined(__i386__))
__asm__ __volatile__ ("rdtsc" : "=A"(value)); #elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) ||
defined(__x86_64) || defined (__x86_64__))
__asm__ __volatile__ ("rdtsc\n\t" // Returns the time in
EDX:EAX.
"shl $32, %%rdx\n\t" // Shift the upper bits
left.
"or %%rdx, %0" // 'Or' in the lower
bits.
: "=a" (value) : : "rdx");
#elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) __asm__ __volatile__ ("MRS X0, CNTVCT_EL0"); #elif defined(__arm__) && (defined(__ARM_ARCH_6__) ||
defined(__ARM_ARCH_7A__))
/* tpr - do nothing for now; needs input from eliot to decide further
*/
/* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-) */ #elif defined(__riscv64__) __asm__ __volatile__ ("rdcycle a0" : "=r"(value)); #else # error "no high res clock defined" #endif return value; }
================================
Hmm, that's interesting, apparently I still owe Eliot info on a high-res
clock for ARM64. :-)
The function can just return 0 if you can't work out anything better.
Now it looks like your specific copy of cogitX64SysV.c is very different
to the standard one, which makes sense if I correctly remember anything at all about what you are trying to do.
Somewhere you have to declare that variable in a suitable for to assign
a... what? Is 'initializeSimulationIOHighResClockForProfiling()' returning a function pointer?
More generally it looks like the C code being generated is not quite
correct syntactically either.
=======
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token
19662 | l6: /* end trampolineArgConstant: */) | ) ===========
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BH: Branch and Hang
Yes -
On 2024-05-13, at 8:54 AM, Ignacio Truffat imtruffat@gmail.com wrote:
On the contrary, I am trying to understand the building process as much as I can, so as to reduce the risk of finding a building error later on. (when I have made changes to the codebase) That's probably going to make debugging a lot easier, since I will be 99.99% sure the new bugs are something I introduced myself.
That's really important. Having a stable base to build on is at least as important in the software world as it is in house building. Make sure you have really extensive notes on what you did to get the stable base so you can replicate it in 6 months time when something is driving you utterly mad with confusion and you feel sure it is the CPU has morphed into a sentient nightmare out to get you. Because they do that, as everyone old enough will tell you.
At least git and whatever other source control systems you use (you do, don't you) should help with finding when you accidentally dropped an entire Dr Who script into the make file.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim "How many Motie Warriors does it take to change a lightbulb?” "None. One of the dead ones will do it."
On Mon, May 13, 2024 at 8:54 AM Ignacio Truffat imtruffat@gmail.com wrote:
HI everybody,
@ElliotMiranda No need to apologize, just by looking at the github-repo I can see the colossal amount of work that went into that. On the contrary, I am trying to understand the building process as much as I can, so as to reduce the risk of finding a building error later on. (when I have made changes to the codebase) That's probably going to make debugging a lot easier, since I will be 99.99% sure the new bugs are something I introduced myself.
The good news is that I just tried to build an imagine with your recent change on my LinuxMint machine, and it seems to have worked! Don't want to jinx it, so I'll test this further before saying anything conclusive, but things seem to be going great for now! Finally I have a working sqcogspur64linuxht built from scratch after using ImageMaker to build the sources.
All and all, thank you very much for your swift response and fixes!
@TimeRowledge. You were correct, it seems that my machine was creating flaky code.
I was able to fix the clock issue (even before @ElliotMiranda's fix) by giving Squeak permission to run multi-threaded (explained here https://github.com/OpenSmalltalk/opensmalltalk-vm/releases/tag/r3732#linux), but then I kept making bad C code. In particular, The file cogitX64SysV.c was generated with invalid syntax, making labels appear within Ternary Conditional Operators.
for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
directedSuperSendTrampolines[numArgs] = (
genSendTrampolineFornumArgscalledargargargarg(ceSendabovetonumArgs, numArgs, trampolineNamenumArgs("ceDirectedSuperSend", numArgs), ClassReg, TempReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2)? ( /* begin trampolineArgConstant: */ null, assert(numArgs >= 0), -2 - numArgs, l2: /* end trampolineArgConstant: */ ) : SendNumArgsReg)));
Found those bugs really interesting. I had never though much about the syntax of C itself (and how it was parsed), but it's true that labels are probably a very special case. I can upload those C files in case anybody finds this interesting to look into. However, looking further into those is not necessary as @ElliotMirandas's recent change has been able to skip the issue all together.
This is all to do with a rather flakey inliner. If you're interested look at TMethod>>#inlineSend:directReturn:exitVar:in: and other methods in the same protocol.
To investigate inlining in slang one can use the CCodeGenerator's inlining breakpoints. Seeimage/Slang Test Workspace.text
For example, to test that method you'd build a VMMaker for the Cogit and set the source breakpoint the the function being inlined (trampolineArgConstant:) and the destination to the method in which it's being inlined, generateSendTrampolines, so...
Transcript show: [| sel s vmm cg | sel *:=* #generateSendTrampolines. vmm *:=* VMMaker forPlatform: 'Cross'. cg *:=* [vmm interpreterClass: CoInterpreter; options: {#Cogit. Cogit chooseCogitClass name}; buildCodeGeneratorForCogit] on: Notification do: [:ex| ex tag == #getVMMaker ifTrue: [ex resume: vmm] ifFalse: [ex pass]].
*"to break at inlining decisions or type inference uncomment the following. If src & dest are different selectors, breaks on inlining. If src & dest are the same selector, breaks on type inference in sel."* cg breakSrcInlineSelector: #trampolineArgConstant:; breakDestInlineSelector: sel; breakOnInline: true. cg vmClass preGenerationHook: cg. cg inferTypesForImplicitlyTypedVariablesAndMethods. cg retainMethods: { sel }. cg prepareMethods. cg doInlining: cg vmClass doInlining. s *:=* ReadWriteStream on: String new. (cg methodNamed: sel) halt; emitCCodeOn: s generator: cg. s contents] value
This will break in the debugger when the code generator is deciding whether to inline trampolineArgConstant: into generateSendTrampolines:.
There are similar templates for interpreter methods, plugins, etc. Replacing hacky code with better, more comprehensible, more predictable, more stable code is of course a good thing, and I'm happy to work directly with people who want to work on Slang.
Kind regards, Ignacio Truffat
On Mon, May 13, 2024 at 4:42 AM Eliot Miranda eliot.miranda@gmail.com wrote:
Hi Tim, Hi Ignacio,
Re initializeSimulationIOHighResClockForProfiling, it’s simulation time only and shouldn’t be generated. This is fixed in my latest commits.
Ignacio, I’m curious why you want your generate your own sources (and support you in doing so). Realise that Slang is a hack that has grown (metastasized??) over time. My attitude towards it is that it is better to suffer it and fix it while getting proper work done rather than rewriting it from scratch (in moving from 32 to 64 bits I had to do a lot of type inference work). So I apologise for its quality; at the moment it is part of the cost of doing business.
_,,,^..^,,,_ (phone)
On May 10, 2024, at 3:55 PM, Tim Rowledge tim@rowledge.org wrote:
On 2024-05-10, at 3:00 PM, Ignacio Truffat imtruffat@gmail.com
wrote:
This time, the main issue seems to that ioHighResClock variable, which
is probably defined in SOME C library. (so I am probably missing some dependency)
Not (normally) a variable - a function defined in the various
platforms/{platform name}/vm/sq{platform name}Heartbeat.c
for example - in platforms/unix/vm/sqUnixITimerHeartbeat.c ==================================== sqLong ioHighResClock(void) { /* return the value of the high performance counter */ sqLong value = 0;
#if (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(i386) ||
defined(__i386) || defined(__i386__))
__asm__ __volatile__ ("rdtsc" : "=A"(value)); #elif (defined(__GNUC__) || defined(__SUNPRO_C)) && (defined(x86_64) ||
defined(__x86_64) || defined (__x86_64__))
__asm__ __volatile__ ("rdtsc\n\t" // Returns the time in
EDX:EAX.
"shl $32, %%rdx\n\t" // Shift the upper bits
left.
"or %%rdx, %0" // 'Or' in the lower
bits.
: "=a" (value) : : "rdx");
#elif defined(__arm64__) || defined(__aarch64__) || defined(ARM64) __asm__ __volatile__ ("MRS X0, CNTVCT_EL0"); #elif defined(__arm__) && (defined(__ARM_ARCH_6__) ||
defined(__ARM_ARCH_7A__))
/* tpr - do nothing for now; needs input from eliot to decide
further */
/* Tim, not sure I have input beyond: Is there a 64-bit clock on ARM? If so, access it here :-) */ #elif defined(__riscv64__) __asm__ __volatile__ ("rdcycle a0" : "=r"(value)); #else # error "no high res clock defined" #endif return value; }
================================
Hmm, that's interesting, apparently I still owe Eliot info on a
high-res clock for ARM64. :-)
The function can just return 0 if you can't work out anything better.
Now it looks like your specific copy of cogitX64SysV.c is very
different to the standard one, which makes sense if I correctly remember anything at all about what you are trying to do.
Somewhere you have to declare that variable in a suitable for to assign
a... what? Is 'initializeSimulationIOHighResClockForProfiling()' returning a function pointer?
More generally it looks like the C code being generated is not quite
correct syntactically either.
=======
/home/mint2/Desktop/tesis/repo/opensmalltalk-vm/src/spur64.cog/cogitX64SysV.c:19662:11: error: expected ‘)’ before ‘:’ token
19662 | l6: /* end trampolineArgConstant: */) | ) ===========
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: BH: Branch and Hang
vm-dev@lists.squeakfoundation.org