Compiling the Squeak Stack vm in FreeBSD

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

Compiling the Squeak Stack vm in FreeBSD

Edwin Ancaer
Hello all,

thanks once more for helping me getting the compilation of the squeak Stack Vm running.
I will need your help once more. I run into a compilation error:

/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode);

  bytecodeDispatchDebugHook();

 VM_LABEL(bytecodeDispatch);
 switch (currentBytecode) {
   CASE(0)
     CASE(256) /*0*/
/* pushReceiverVariableBytecode */
     {
sqInt object;

VM_LABEL(pushReceiverVariableBytecode);  <------ line with error
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);

I found some indications that this could be due to a difference between gcc (as in the name of the file), and clang, that is the standard compiler of FreeBsd.
I went tot the mvm-script and changed the line CC=clang to CC=gcc.
Issue solved.

OK, then I got the libiconv-errors when linking libtool
 
libtool: link: gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wl,-z -Wl,now -o squeak disabledPlugins.o version.o -Wl,--export-dynamic  -L/usr/local/lib vm/vm.a ADPCMCodecPlugin/ADPCMCodecPlugin.a AioPlugin/AioPlugin.a AsynchFilePlugin/AsynchFilePlugin.a B2DPlugin/B2DPlugin.a BitBltPlugin/BitBltPlugin.a BMPReadWriterPlugin/BMPReadWriterPlugin.a CroquetPlugin/CroquetPlugin.a HostWindowPlugin/HostWindowPlugin.a ZipPlugin/ZipPlugin.a DropPlugin/DropPlugin.a DSAPrims/DSAPrims.a FFTPlugin/FFTPlugin.a FileCopyPlugin/FileCopyPlugin.a FilePlugin/FilePlugin.a FloatArrayPlugin/FloatArrayPlugin.a FloatMathPlugin/FloatMathPlugin.a IA32ABI/IA32ABI.a JoystickTabletPlugin/JoystickTabletPlugin.a JPEGReaderPlugin/JPEGReaderPlugin.a JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.a Klatt/Klatt.a LargeIntegers/LargeIntegers.a Matrix2x3Plugin/Matrix2x3Plugin.a MIDIPlugin/MIDIPlugin.a MiscPrimitivePlugin/MiscPrimitivePlugin.a Mpeg3Plugin/Mpeg3Plugin.a RePlugin/RePlugin.a SecurityPlugin/SecurityPlugin.a SerialPlugin/SerialPlugin.a SocketPlugin/SocketPlugin.a SoundCodecPrims/SoundCodecPrims.a SoundGenerationPlugin/SoundGenerationPlugin.a SoundPlugin/SoundPlugin.a StarSqueakPlugin/StarSqueakPlugin.a SurfacePlugin/SurfacePlugin.a VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.a -luuid -lutil -lpulse-simple /usr/local/lib/libasound.so -lexecinfo -lm vm/vm.a -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
/usr/local/bin/ld: vm/vm.a(sqUnixCharConv.o): in function `convertChars':
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:276: undefined reference to `libiconv_close'
/usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:278: undefined reference to `libiconv_open'
/usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:290: undefined reference to `libiconv'
collect2: error: ld returned 1 exit status

Here I cheated, as I had no idea how to add the library libiconv to the linker. I went to the Makefile in the directory ..../opensmaltalk-vm/build.linux64x64/squeak.stack.spur/build an added  iconv to the LIBS-statement:

LIBS= -luuid -lutil -lpulse-simple -lasound  -lexecinfo -lm -liconv

Don't know if that was allowed, but the  libiconv-problem was solved.
But now I am at the end of my wits. I stumbled upon:

ibtool: compile:  gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-u                                                 nused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -DHAVE_CONFIG_H -I/home/edwin/Smalltal                                                 k5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/b                                                 uild -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin                                                 /Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/usr/local/include -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-un                                                 used-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix                                                 /vm-sound-ALSA/sqUnixSoundALSA.c  -fPIC -DPIC -o .libs/sqUnixSoundALSA.o                                                                                                                    
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:951:13: error: 'devname' redeclared as different kin                                                 d of symbol                                                                                                                                                                            
  951 | static char devname[MAX_NAME_LEN];                                                                                                                                                  
      |             ^~~~~~~                                                                                                                                                                
In file included from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm/sq.h:20,                                                                                                  
                 from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:31:                                                                            
/usr/include/stdlib.h:277:7: note: previous declaration of 'devname' was here                                                                                                              
  277 | char *devname(__dev_t, __mode_t);                      
                                                                                


Does anybody have an idea for a quick cheat to get trough the compilation, besides starting to rewrite parts of the code?

Kind regards,

Edwin Ancaer


Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Tobias Pape
Hi

> On 07.04.2020, at 17:24, Edwin Ancaer <[hidden email]> wrote:
>
> Hello all,
>
> thanks once more for helping me getting the compilation of the squeak Stack Vm running.
> I will need your help once more. I run into a compilation error:
>
> /home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
>                                 VM_LABEL(pushReceiverVariableBytecode);
>
>   bytecodeDispatchDebugHook();
>
>  VM_LABEL(bytecodeDispatch);
>  switch (currentBytecode) {
>    CASE(0)
>      CASE(256) /*0*/
> /* pushReceiverVariableBytecode */
>      {
> sqInt object;
>
> VM_LABEL(pushReceiverVariableBytecode);  <------ line with error
> /* begin fetchNextBytecode */
> currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
>
> I found some indications that this could be due to a difference between gcc (as in the name of the file), and clang, that is the standard compiler of FreeBsd.
> I went tot the mvm-script and changed the line CC=clang to CC=gcc.
> Issue solved.
>
> OK, then I got the libiconv-errors when linking libtool
>  
> libtool: link: gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wl,-z -Wl,now -o squeak disabledPlugins.o version.o -Wl,--export-dynamic  -L/usr/local/lib vm/vm.a ADPCMCodecPlugin/ADPCMCodecPlugin.a AioPlugin/AioPlugin.a AsynchFilePlugin/AsynchFilePlugin.a B2DPlugin/B2DPlugin.a BitBltPlugin/BitBltPlugin.a BMPReadWriterPlugin/BMPReadWriterPlugin.a CroquetPlugin/CroquetPlugin.a HostWindowPlugin/HostWindowPlugin.a ZipPlugin/ZipPlugin.a DropPlugin/DropPlugin.a DSAPrims/DSAPrims.a FFTPlugin/FFTPlugin.a FileCopyPlugin/FileCopyPlugin.a FilePlugin/FilePlugin.a FloatArrayPlugin/FloatArrayPlugin.a FloatMathPlugin/FloatMathPlugin.a IA32ABI/IA32ABI.a JoystickTabletPlugin/JoystickTabletPlugin.a JPEGReaderPlugin/JPEGReaderPlugin.a JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.a Klatt/Klatt.a LargeIntegers/LargeIntegers.a Matrix2x3Plugin/Matrix2x3Plugin.a MIDIPlugin/MIDIPlugin.a MiscPrimitivePlugin/MiscPrimitivePlugin.a Mpeg3Plugin/Mpeg3Plugin.a RePlugin/RePlugin.a SecurityPlugin/SecurityPlugin.a SerialPlugin/SerialPlugin.a SocketPlugin/SocketPlugin.a SoundCodecPrims/SoundCodecPrims.a SoundGenerationPlugin/SoundGenerationPlugin.a SoundPlugin/SoundPlugin.a StarSqueakPlugin/StarSqueakPlugin.a SurfacePlugin/SurfacePlugin.a VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.a -luuid -lutil -lpulse-simple /usr/local/lib/libasound.so -lexecinfo -lm vm/vm.a -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
> /usr/local/bin/ld: vm/vm.a(sqUnixCharConv.o): in function `convertChars':
> /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:276: undefined reference to `libiconv_close'
> /usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:278: undefined reference to `libiconv_open'
> /usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:290: undefined reference to `libiconv'
> collect2: error: ld returned 1 exit status
>
> Here I cheated, as I had no idea how to add the library libiconv to the linker. I went to the Makefile in the directory ..../opensmaltalk-vm/build.linux64x64/squeak.stack.spur/build an added  iconv to the LIBS-statement:
>
> LIBS= -luuid -lutil -lpulse-simple -lasound  -lexecinfo -lm -liconv
>
> Don't know if that was allowed, but the  libiconv-problem was solved.

I'm onto that one.

> But now I am at the end of my wits. I stumbled upon:
>
> ibtool: compile:  gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-u                                                 nused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -DHAVE_CONFIG_H -I/home/edwin/Smalltal                                                 k5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/b                                                 uild -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin                                                 /Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/usr/local/include -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-un                                                 used-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix                                                 /vm-sound-ALSA/sqUnixSoundALSA.c  -fPIC -DPIC -o .libs/sqUnixSoundALSA.o                                                                                                                    
> /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:951:13: error: 'devname' redeclared as different kin                                                 d of symbol                                                                                                                                                                            
>   951 | static char devname[MAX_NAME_LEN];                                                                                                                                                  
>       |             ^~~~~~~                                                                                                                                                                
> In file included from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm/sq.h:20,                                                                                                  
>                  from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:31:                                                                            
> /usr/include/stdlib.h:277:7: note: previous declaration of 'devname' was here                                                                                                              
>   277 | char *devname(__dev_t, __mode_t);                                                                                                        
>
>
> Does anybody have an idea for a quick cheat to get trough the compilation, besides starting to rewrite parts of the code?

I don't think ALSA will work on Sun, it's Linux only, IIRC.
Configure should figure that out and disable the plugin, tho.

You could cheat around by removing alsa-related files and remove the references.
I am looking into the FreeBSD stuff and maybe have something ready soon.

Best regards
        -Tobias

>
> Kind regards,
>
> Edwin Ancaer
>



Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Tobias Pape
In reply to this post by Edwin Ancaer
Hi all, Hi Edwin,

On 07.04.2020, at 17:24, Edwin Ancaer <[hidden email]> wrote:

Hello all, 

I have the cog-vm running (see attached screenshot).

I'll look at the stackvm and the strange ALSA issue now.

Best regards
-Tobias


thanks once more for helping me getting the compilation of the squeak Stack Vm running.
I will need your help once more. I run into a compilation error: 

/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode);

  bytecodeDispatchDebugHook();

 VM_LABEL(bytecodeDispatch);
 switch (currentBytecode) {
   CASE(0)
     CASE(256) /*0*/
/* pushReceiverVariableBytecode */
     {
sqInt object;

VM_LABEL(pushReceiverVariableBytecode);  <------ line with error
/* begin fetchNextBytecode */
currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);

I found some indications that this could be due to a difference between gcc (as in the name of the file), and clang, that is the standard compiler of FreeBsd. 
I went tot the mvm-script and changed the line CC=clang to CC=gcc. 
Issue solved. 

OK, then I got the libiconv-errors when linking libtool
 
libtool: link: gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wl,-z -Wl,now -o squeak disabledPlugins.o version.o -Wl,--export-dynamic  -L/usr/local/lib vm/vm.a ADPCMCodecPlugin/ADPCMCodecPlugin.a AioPlugin/AioPlugin.a AsynchFilePlugin/AsynchFilePlugin.a B2DPlugin/B2DPlugin.a BitBltPlugin/BitBltPlugin.a BMPReadWriterPlugin/BMPReadWriterPlugin.a CroquetPlugin/CroquetPlugin.a HostWindowPlugin/HostWindowPlugin.a ZipPlugin/ZipPlugin.a DropPlugin/DropPlugin.a DSAPrims/DSAPrims.a FFTPlugin/FFTPlugin.a FileCopyPlugin/FileCopyPlugin.a FilePlugin/FilePlugin.a FloatArrayPlugin/FloatArrayPlugin.a FloatMathPlugin/FloatMathPlugin.a IA32ABI/IA32ABI.a JoystickTabletPlugin/JoystickTabletPlugin.a JPEGReaderPlugin/JPEGReaderPlugin.a JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.a Klatt/Klatt.a LargeIntegers/LargeIntegers.a Matrix2x3Plugin/Matrix2x3Plugin.a MIDIPlugin/MIDIPlugin.a MiscPrimitivePlugin/MiscPrimitivePlugin.a Mpeg3Plugin/Mpeg3Plugin.a RePlugin/RePlugin.a SecurityPlugin/SecurityPlugin.a SerialPlugin/SerialPlugin.a SocketPlugin/SocketPlugin.a SoundCodecPrims/SoundCodecPrims.a SoundGenerationPlugin/SoundGenerationPlugin.a SoundPlugin/SoundPlugin.a StarSqueakPlugin/StarSqueakPlugin.a SurfacePlugin/SurfacePlugin.a VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.a -luuid -lutil -lpulse-simple /usr/local/lib/libasound.so -lexecinfo -lm vm/vm.a -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
/usr/local/bin/ld: vm/vm.a(sqUnixCharConv.o): in function `convertChars':
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:276: undefined reference to `libiconv_close'
/usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:278: undefined reference to `libiconv_open'
/usr/local/bin/ld: /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqUnixCharConv.c:290: undefined reference to `libiconv'
collect2: error: ld returned 1 exit status

Here I cheated, as I had no idea how to add the library libiconv to the linker. I went to the Makefile in the directory ..../opensmaltalk-vm/build.linux64x64/squeak.stack.spur/build an added  iconv to the LIBS-statement: 

LIBS= -luuid -lutil -lpulse-simple -lasound  -lexecinfo -lm -liconv

Don't know if that was allowed, but the  libiconv-problem was solved. 
But now I am at the end of my wits. I stumbled upon: 

ibtool: compile:  gcc -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-u                                                 nused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -DHAVE_CONFIG_H -I/home/edwin/Smalltal                                                 k5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/b                                                 uild -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin                                                 /Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/usr/local/include -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-un                                                 used-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -c /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix                                                 /vm-sound-ALSA/sqUnixSoundALSA.c  -fPIC -DPIC -o .libs/sqUnixSoundALSA.o                                                                                                                    
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:951:13: error: 'devname' redeclared as different kin                                                 d of symbol                                                                                                                                                                             
  951 | static char devname[MAX_NAME_LEN];                                                                                                                                                  
      |             ^~~~~~~                                                                                                                                                                 
In file included from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm/sq.h:20,                                                                                                   
                 from /home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:31:                                                                            
/usr/include/stdlib.h:277:7: note: previous declaration of 'devname' was here                                                                                                               
  277 | char *devname(__dev_t, __mode_t);                                                                                                        


Does anybody have an idea for a quick cheat to get trough the compilation, besides starting to rewrite parts of the code?

Kind regards,

Edwin Ancaer




Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Tobias Pape
Hi Edwin,

> On 07.04.2020, at 22:54, Tobias Pape <[hidden email]> wrote:
>
> Hi all, Hi Edwin,
>
>> On 07.04.2020, at 17:24, Edwin Ancaer <[hidden email]> wrote:
>>
>> Hello all,
>
> I have the cog-vm running (see attached screenshot).
>
> I'll look at the stackvm and the strange ALSA issue now.

I have looked at the stackvm issue.
On FreeBSD 11/clang 6, this does not occur. What clang version do you have?

Also, I don't think we need to bother with alsa too much.
OSS should work, the rest _is_ work :)

I have made a pull request for the VM, I hope that helps.

Best regards
        -Tobias


Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Edwin Ancaer
Tobias,

thanks for helping out.

My version of clang is 8.0.1

$ clang -vat with squeak
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin

Should I be able to checkout now and compile?

I ask because just did that, and I still have the libiconv issue in squeak.cogs.spur.
Hope it was just me being impatient.

Thanks a lot,

Op di 7 apr. 2020 om 23:43 schreef Tobias Pape <[hidden email]>:
Hi Edwin,eing impatioent
> On 07.04.2020, at 22:54, Tobias Pape <[hidden email]> wrote:
>
> Hi all, Hi Edwin,
>
>> On 07.04.2020, at 17:24, Edwin Ancaer <[hidden email]> wrote:
>>
>> Hello all,
>
> I have the cog-vm running (see attached screenshot).
>
> I'll look at the stackvm and the strange ALSA issue now.

I have looked at the stackvm issue.
On FreeBSD 11/clang 6, this does not occur. What clang version do you have?

Also, I don't think we need to bother with alsa too much.
OSS should work, the rest _is_ work :)

I have made a pull request for the VM, I hope that helps.

Best regards
        -Tobias




Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Edwin Ancaer
Hello,

consider it due to the late hour, but I used the wrong branch.
I' ll give it a new try.

Sorry,

Edwin Ancaer


Op wo 8 apr. 2020 om 00:52 schreef Edwin Ancaer <[hidden email]>:
Tobias,

thanks for helping out.

My version of clang is 8.0.1

$ clang -vat with squeak
FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581) (based on LLVM 8.0.1)
Target: x86_64-unknown-freebsd12.1
Thread model: posix
InstalledDir: /usr/bin

Should I be able to checkout now and compile?

I ask because just did that, and I still have the libiconv issue in squeak.cogs.spur.
Hope it was just me being impatient.

Thanks a lot,

Op di 7 apr. 2020 om 23:43 schreef Tobias Pape <[hidden email]>:
Hi Edwin,eing impatioent
> On 07.04.2020, at 22:54, Tobias Pape <[hidden email]> wrote:
>
> Hi all, Hi Edwin,
>
>> On 07.04.2020, at 17:24, Edwin Ancaer <[hidden email]> wrote:
>>
>> Hello all,
>
> I have the cog-vm running (see attached screenshot).
>
> I'll look at the stackvm and the strange ALSA issue now.

I have looked at the stackvm issue.
On FreeBSD 11/clang 6, this does not occur. What clang version do you have?

Also, I don't think we need to bother with alsa too much.
OSS should work, the rest _is_ work :)

I have made a pull request for the VM, I hope that helps.

Best regards
        -Tobias




Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

K K Subbu
In reply to this post by Tobias Pape
On 08/04/20 3:13 AM, Tobias Pape wrote:
> I have looked at the stackvm issue.
> On FreeBSD 11/clang 6, this does not occur. What clang version do you have?
>
> Also, I don't think we need to bother with alsa too much.
> OSS should work, the rest_is_  work:)

Tobias,

Please make pulse the default audio server. It has wrappers (padsp) to
handle legacy apps using for ALSA/OSS.

David Stes confirmed earlier that pulse audio works fine on his Solaris
port and provided the patches. Squeak VM does not work out of the box on
my Ubuntu 16.04 (64b). I have to patch squeak.sh to use -vm-audio-pulse
to get sound to work.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Tobias Pape
Hi Subbu

> On 08.04.2020, at 10:19, K K Subbu <[hidden email]> wrote:
>
> On 08/04/20 3:13 AM, Tobias Pape wrote:
>> I have looked at the stackvm issue.
>> On FreeBSD 11/clang 6, this does not occur. What clang version do you have?
>> Also, I don't think we need to bother with alsa too much.
>> OSS should work, the rest_is_  work:)
>
> Tobias,
>
> Please make pulse the default audio server. It has wrappers (padsp) to handle legacy apps using for ALSA/OSS.
>
> David Stes confirmed earlier that pulse audio works fine on his Solaris port and provided the patches. Squeak VM does not work out of the box on my Ubuntu 16.04 (64b). I have to patch squeak.sh to use -vm-audio-pulse to get sound to work.

This is a distinct thing.
My comments are about compilation problems of Alsa on FreeBSD.
I see that pulse is available in FreeBSD ports, but with a lot of dependencies, and
I do not think that at the moment it is a good idea to mingle with that.

For OpenBSD we have sndio, and if that also works for FreeBSD, at the moment I would go for that.

Apart from that, sure, Pulse seems a good option…

Best regards
        -Tobias


Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Edwin Ancaer
Tobias,

I recompiled the stack vm with clang60, on FreeBSD12 but I get the same problem with the definition of the VM_LABEL:. see printout below.
I ca compile this with gcc however.

But then it seems the changes for iconv are not in the stack vm yet. Is that correct?

As for ALSA  or polse or sndio, I think you should just take what works. 

Please note that I have not the intention of being pushy, I realise you spend some of your free time doing this, so that I can enjoy Squeak on FreeBSD.
Just ignore if it gets too much. 

Clang60 is version 6.0.1 here:
$ clang60 -v
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-portbld-freebsd12.0
Thread model: posix
InstalledDir: /usr/local/llvm60/bin


clang60 -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -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/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm   -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin  -I/home/edwin/Smalltalk5/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   -c -o gcc3x-interp.o /home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:38695:64: warning: format specifies type 'char *' but the argument has type 'sqInt' (aka 'long') [-Wformat]
        printf("\nClass %s does not have the required class index\n", className);
                        ~~                                            ^~~~~~~~~
                        %ld
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:49593:108: warning: passing 'usqInt *' (aka 'unsigned long *') to parameter of type 'sqInt *' (aka 'long *') converts between pointers to integer types w
ith different sign [-Wpointer-sign]
        segAddress = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(ammount, firstGapOfSizeAtLeast(ammount), (&allocatedSize));
...
...
...
                              ^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here
LpushReceiverVariableBytecode:
^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2544:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode1);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here




Op wo 8 apr. 2020 om 10:55 schreef Tobias Pape <[hidden email]>:
Hi Subbu
> On 08.04.2020, at 10:19, K K Subbu <[hidden email]> wrote:
>
> On 08/04/20 3:13 AM, Tobias Pape wrote:
>> I have looked at the stackvm issue.
>> On FreeBSD 11/clang 6, this does not occur. What clang version do you have?
>> Also, I don't think we need to bother with alsa too much.
>> OSS should work, the rest_is_  work:)
>
> Tobias,
>
> Please make pulse the default audio server. It has wrappers (padsp) to handle legacy apps using for ALSA/OSS.
>
> David Stes confirmed earlier that pulse audio works fine on his Solaris port and provided the patches. Squeak VM does not work out of the box on my Ubuntu 16.04 (64b). I have to patch squeak.sh to use -vm-audio-pulse to get sound to work.

This is a distinct thing.
My comments are about compilation problems of Alsa on FreeBSD.
I see that pulse is available in FreeBSD ports, but with a lot of dependencies, and
I do not think that at the moment it is a good idea to mingle with that.

For OpenBSD we have sndio, and if that also works for FreeBSD, at the moment I would go for that.

Apart from that, sure, Pulse seems a good option…

Best regards
        -Tobias




Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Eliot Miranda-2
Hi Edwin,

    VM_LABEL exists to plant a global label in the interpreter at various bytecodes so that in a vm profiler one can see where the time is spent.  Since you’re probably not interested in doing that you can simply change the makefiles to define VM_LABEL as zero, eg ‘-D VM_LABEL(foo)=0’ or -D VM_LABEL\(foo\)=0 (you may need to double the backslashes you pass the escape through make to the compiler invocation).

_,,,^..^,,,_ (phone)

On Apr 8, 2020, at 3:35 AM, Edwin Ancaer <[hidden email]> wrote:


Tobias,

I recompiled the stack vm with clang60, on FreeBSD12 but I get the same problem with the definition of the VM_LABEL:. see printout below.
I ca compile this with gcc however.

But then it seems the changes for iconv are not in the stack vm yet. Is that correct?

As for ALSA  or polse or sndio, I think you should just take what works. 

Please note that I have not the intention of being pushy, I realise you spend some of your free time doing this, so that I can enjoy Squeak on FreeBSD.
Just ignore if it gets too much. 

Clang60 is version 6.0.1 here:
$ clang60 -v
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-portbld-freebsd12.0
Thread model: posix
InstalledDir: /usr/local/llvm60/bin


clang60 -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -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/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm   -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin  -I/home/edwin/Smalltalk5/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   -c -o gcc3x-interp.o /home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:38695:64: warning: format specifies type 'char *' but the argument has type 'sqInt' (aka 'long') [-Wformat]
        printf("\nClass %s does not have the required class index\n", className);
                        ~~                                            ^~~~~~~~~
                        %ld
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:49593:108: warning: passing 'usqInt *' (aka 'unsigned long *') to parameter of type 'sqInt *' (aka 'long *') converts between pointers to integer types w
ith different sign [-Wpointer-sign]
        segAddress = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(ammount, firstGapOfSizeAtLeast(ammount), (&allocatedSize));
...
...
...
                              ^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here
LpushReceiverVariableBytecode:
^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2544:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode1);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here




Op wo 8 apr. 2020 om 10:55 schreef Tobias Pape <[hidden email]>:
Hi Subbu
> On 08.04.2020, at 10:19, K K Subbu <[hidden email]> wrote:
>
> On 08/04/20 3:13 AM, Tobias Pape wrote:
>> I have looked at the stackvm issue.
>> On FreeBSD 11/clang 6, this does not occur. What clang version do you have?
>> Also, I don't think we need to bother with alsa too much.
>> OSS should work, the rest_is_  work:)
>
> Tobias,
>
> Please make pulse the default audio server. It has wrappers (padsp) to handle legacy apps using for ALSA/OSS.
>
> David Stes confirmed earlier that pulse audio works fine on his Solaris port and provided the patches. Squeak VM does not work out of the box on my Ubuntu 16.04 (64b). I have to patch squeak.sh to use -vm-audio-pulse to get sound to work.

This is a distinct thing.
My comments are about compilation problems of Alsa on FreeBSD.
I see that pulse is available in FreeBSD ports, but with a lot of dependencies, and
I do not think that at the moment it is a good idea to mingle with that.

For OpenBSD we have sndio, and if that also works for FreeBSD, at the moment I would go for that.

Apart from that, sure, Pulse seems a good option…

Best regards
        -Tobias





Reply | Threaded
Open this post in threaded view
|

Re: Compiling the Squeak Stack vm in FreeBSD

Edwin Ancaer
Hello ,

thanks to all whose time I've been using: the stack VM compiled, and starts:

Image
-----
/usr/home/edwi
n/Smalltalk5/squeak.image
Squeak5.3
latest update:
#19431
Current Change Set: HomeProject
Image format 68021 (64 bit)

Virtual Machine
---------------
/usr/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak .stack.spur/build/squeak
Open Smalltalk Stack VM [StackInterpreterPrimitives VMMaker.oscog-eem.2736]
Unix built on Apr 10 2020 23:46:44 Compiler: 4.2.1 Compatible Clang 6.0.1 (tags/RELEASE_601/final)
platform sources revision VM: 202004072010-krono/freebsd-fixes edwin@ottopedi:/usr/home/edwin/Smalltalk5/opensmalltalk-vm Date: Tue Apr 7 22:10:08 2020 CommitHash: 3a6cb0094 Plugins: 202004072010-krono/freebsd-fixes edwin@ottopedi:/usr/home/edwin/Smalltalk5/opensmalltalk-vm
StackInterpreter VMMaker.oscog-eem.2736 uuid: 1dd4c38f-c0b4-4edd-9165-f4a54a988fe7 Apr 10 2020

A short status for now:
  1. The basic functionality is OK: creating classes, objects works fine, opening browsers, workspaces ed. all work.....
  2.  While running the tests, the VM is killed during #testOutOfMemorySignal.

For now, I choose to ignore the problem with the test, I will try to have some fun and  start my my project. Problems will be solved later on. 
I also would like to see if it is possible to the existing Smalltalk port updated to the latest version: there remained 2 manual interventions I had to do in the makefiles, so I don't know what can be done here.

Again, a big thank you for helping out.

A happy Smalltalk-user

Edwin Ancaer


Op do 9 apr. 2020 om 17:10 schreef Eliot Miranda <[hidden email]>:
Hi Edwin,

    VM_LABEL exists to plant a global label in the interpreter at various bytecodes so that in a vm profiler one can see where the time is spent.  Since you’re probably not interested in doing that you can simply change the makefiles to define VM_LABEL as zero, eg ‘-D VM_LABEL(foo)=0’ or -D VM_LABEL\(foo\)=0 (you may need to double the backslashes you pass the escape through make to the compiler invocation).

_,,,^..^,,,_ (phone)

On Apr 8, 2020, at 3:35 AM, Edwin Ancaer <[hidden email]> wrote:


Tobias,

I recompiled the stack vm with clang60, on FreeBSD12 but I get the same problem with the definition of the VM_LABEL:. see printout below.
I ca compile this with gcc however.

But then it seems the changes for iconv are not in the stack vm yet. Is that correct?

As for ALSA  or polse or sndio, I think you should just take what works. 

Please note that I have not the intention of being pushy, I realise you spend some of your free time doing this, so that I can enjoy Squeak on FreeBSD.
Just ignore if it gets too much. 

Clang60 is version 6.0.1 here:
$ clang60 -v
clang version 6.0.1 (tags/RELEASE_601/final)
Target: x86_64-portbld-freebsd12.0
Thread model: posix
InstalledDir: /usr/local/llvm60/bin


clang60 -g -O1 -DNDEBUG -DDEBUGVM=0 -msse2 -Wall -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/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/build.linux64x64/squeak.stack.spur/build -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm   -I/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin  -I/home/edwin/Smalltalk5/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   -c -o gcc3x-interp.o /home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:38695:64: warning: format specifies type 'char *' but the argument has type 'sqInt' (aka 'long') [-Wformat]
        printf("\nClass %s does not have the required class index\n", className);
                        ~~                                            ^~~~~~~~~
                        %ld
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:49593:108: warning: passing 'usqInt *' (aka 'unsigned long *') to parameter of type 'sqInt *' (aka 'long *') converts between pointers to integer types w
ith different sign [-Wpointer-sign]
        segAddress = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(ammount, firstGapOfSizeAtLeast(ammount), (&allocatedSize));
...
...
...
                              ^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2530:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here
LpushReceiverVariableBytecode:
^
/home/edwin/Smalltalk5/opensmalltalk-vm/spurstack64src/vm/gcc3x-interp.c:2544:5: error: invalid symbol redefinition
                                VM_LABEL(pushReceiverVariableBytecode1);
                                ^
/home/edwin/Smalltalk5/opensmalltalk-vm/platforms/unix/vm/sqPlatformSpecific.h:110:49: note: expanded from macro 'VM_LABEL'
#       define VM_LABEL(foo) asm("\n.globl L" #foo "\nL" #foo ":")
                                                      ^
<inline asm>:3:1: note: instantiated into assembly here




Op wo 8 apr. 2020 om 10:55 schreef Tobias Pape <[hidden email]>:
Hi Subbu
> On 08.04.2020, at 10:19, K K Subbu <[hidden email]> wrote:
>
> On 08/04/20 3:13 AM, Tobias Pape wrote:
>> I have looked at the stackvm issue.
>> On FreeBSD 11/clang 6, this does not occur. What clang version do you have?
>> Also, I don't think we need to bother with alsa too much.
>> OSS should work, the rest_is_  work:)
>
> Tobias,
>
> Please make pulse the default audio server. It has wrappers (padsp) to handle legacy apps using for ALSA/OSS.
>
> David Stes confirmed earlier that pulse audio works fine on his Solaris port and provided the patches. Squeak VM does not work out of the box on my Ubuntu 16.04 (64b). I have to patch squeak.sh to use -vm-audio-pulse to get sound to work.

This is a distinct thing.
My comments are about compilation problems of Alsa on FreeBSD.
I see that pulse is available in FreeBSD ports, but with a lot of dependencies, and
I do not think that at the moment it is a good idea to mingle with that.

For OpenBSD we have sndio, and if that also works for FreeBSD, at the moment I would go for that.

Apart from that, sure, Pulse seems a good option…

Best regards
        -Tobias