Well, I think there are no secrets in it, so here it is.


Op za 2 mrt 2024 om 21:17 schreef Tobias Pape via Squeak-dev <squeak-dev@lists.squeakfoundation.org>:
Hi Edwin

> On 2. Mar 2024, at 20:50, Edwin Ancaer <eancaer@gmail.com> wrote:
>
> Tobias,
>
> I had some problems generating that file. Apparently, I had to completely remove the "-o sqUnixSoundALSA.i" and redirect the output.
> So finally, ypu can find it in attachment. I hope it helps.

Yes, great!


>
I think I found it.

devname is a stdlib-function _on BSDs_ such as FreeBSD or macOS
see
        https://man.freebsd.org/cgi/man.cgi?query=devname&apropos=0&sektion=0&manpath=FreeBSD+14.0-RELEASE+and+Ports&arch=default&format=html

On linux, this does not exist (and I think it is Not posix, either).

BUT: this is in ALSA, which you most probably do not want on FreeBSD, because it is Linux Sound stuff.

We _could_ rename "devname" in sqUnixSoundALSA.c, but I first would like to see your configure log :)

Best regards
        -Tobias

> Thanks a lot,
>
> Edwin 
>
>
>
>
>
> *;
>
>
> Op za 2 mrt 2024 om 11:01 schreef Tobias Pape <Das.Linux@gmx.de>:
> Hi Edwin
>
> > On 2. Mar 2024, at 10:15, Edwin Ancaer <eancaer@gmail.com> wrote:
> >
> > Tobias,
> >
> > you mean this:
> > /bin/sh /home/edwin/Squeak/opensmalltalk-vm/building/freebsd64/squeak.cog.spur/build/libtool --mode=compile  clang -Wall  -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -I/usr/local/include -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion -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   -I/home/edwin/Squeak/opensmalltalk-vm/building/freebsd64/squeak.cog.spur/build -I/home/edwin/Squeak/opensmalltalk-vm/building/freebsd64/squeak.cog.spur/build -I/home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Squeak/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Squeak/opensmalltalk-vm/src/spur64.cog  -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable   -E -o sqUnixSoundALSA.lo /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c
> >
> > It does not give any errors, but I do not find a file sqUnixSoundALSA.i
>
> Yes, sorry, you also have to replace "-o sqUnixSoundALSA.lo" by "-o sqUnixSoundALSA.i"
>
> Best regards
>         -Tobias
> >
> > [edwin@ottopedi ~/Squeak]$ find . -name sqUnixSoundALSA.*
> > ./opensmalltalk-vm/building/freebsd64/squeak.cog.spur/build/.libs/sqUnixSoundALSA.o
> > ./opensmalltalk-vm/building/freebsd64/squeak.cog.spur/build/sqUnixSoundALSA.lo
> > ./opensmalltalk-vm/building/freebsd64/squeak.cog.spur/.libs/sqUnixSoundALSA.o
> > ./opensmalltalk-vm/building/freebsd64/squeak.cog.spur/sqUnixSoundALSA.lo
> > ./opensmalltalk-vm/building/freebsd64/.libs/sqUnixSoundALSA.o
> > ./opensmalltalk-vm/building/freebsd64/sqUnixSoundALSA.lo
> > ./opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c
> >
> > Nor any .i file:
> >
> > [edwin@ottopedi ~/Squeak]$ find . -name *.i
> > [edwin@ottopedi ~/Squeak]$
> >
> > If you could updtate the command, in case it is not correct, i will be happy to re execute it.
> >
> > I'm wondering, if nobody else has this problem, or nobody is running Squeak on FreeBSD, or there is something seriously wrong on my side.
> > As I said, I'm on a freshly installed FreeBSD:
> >  [edwin@ottopedi ~/Squeak]$ uname -a
> > FreeBSD ottopedi 14.0-RELEASE FreeBSD 14.0-RELEASE #0 releng/14.0-n265380-f9716eee8ab4: Fri Nov 10 05:57:23 UTC 2023     root@releng1.nyi.freebsd.org:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64
> >
> > with a version of clang:
> > [edwin@ottopedi ~/Squeak]$ clang -v
> > FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
> > Target: x86_64-unknown-freebsd14.0
> > Thread model: posix
> > InstalledDir: /usr/bin
> >
> > Kind regards,
> >
> > Edwin Ancaer
> >
> > *;
> >
> >
> > Op za 2 mrt 2024 om 09:01 schreef Tobias Pape via Squeak-dev <squeak-dev@lists.squeakfoundation.org>:
> > Hi Edwin
> >
> > > On 1. Mar 2024, at 23:43, Edwin Ancaer <eancaer@gmail.com> wrote:
> > >
> > > Eliot,
> > >
> > > thanks for the help.
> > >
> > > There was another warning turned into error since clang 15, that was also solved by turning the error in a warning. :
> > >
> > >
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/plugins/SoundPlugin/sqUnixSound.c:194:62: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
> > > char *getDefaultSoundPlayer(void)                   { return -1; }
> > >                                                              ^~
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/plugins/SoundPlugin/sqUnixSound.c:195:62: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
> > > char *getDefaultSoundRecorder(void)                 { return -1; }
> > >                                                              ^~
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/plugins/SoundPlugin/sqUnixSound.c:196:62: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
> > > char *getSoundPlayerDeviceName(sqInt i)             { return -1; }
> > >                                                              ^~
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/plugins/SoundPlugin/sqUnixSound.c:197:62: error: incompatible integer to pointer conversion returning 'int' from a function with result type 'char *' [-Wint-conversion]
> > > char *getSoundRecorderDeviceName(sqInt i)           { return -1; }
> > >                                                              ^~
> > > 4 errors generated.
> >
> >
> > Yeah, -1 isn't a char* anyway, and the plugin actually checks for NULL:
> >   https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/src/plugins/SoundPlugin/SoundPlugin.c#L198
> > I changed it here https://github.com/OpenSmalltalk/opensmalltalk-vm/commit/0084f9f3e4b34dc39af23febfbb8c70cd0ef7bfa
> >
> >
> > >
> > > But now I have the following, which I see no way  to solve:
> > >
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm-sound-ALSA/sqUnixSoundALSA.c:951:13: error: redefinition of 'devname' as different kind of symbol
> > > static char devname[MAX_NAME_LEN];
> > >             ^
> > > /usr/include/stdlib.h:289:7: note: previous definition is here
> > > char    *devname(__dev_t, __mode_t);
> > >
> > > Any help is welcome....
> >
> > Ok this is very strange.
> > Yes, devname is declared in stdlib, but sqUnixSoundALSA.c does not include stdlib.h (nor does anything I know of)
> >
> > can you generate the .i file? (that is, replacing `-c` in the compilation process of sqUnixSoundALSA.c with `-E`)
> >
> > Best regards
> >         -Tobias
> >
> > >
> > > Edwin Ancaer
> > > Op vr 1 mrt 2024 om 07:17 schreef Eliot Miranda <eliot.miranda@gmail.com>:
> > > Hi Edwin,
> > >
> > > On Thu, Feb 29, 2024 at 3:10 PM Edwin Ancaer <eancaer@gmail.com> wrote:
> > >
> > > Hello,
> > >
> > > I recently upgraded to FreeBSD 14, with clang version 'FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)'
> > >
> > > If I understand correctly, Clang promoted some warnings to errors and in special the warning Wincompatible-function-pointer-types. It looks as if this prevents me to compile the linux-cog-spur virtual machine:
> > >
> > > clang -Wall  -g -O2 -DNDEBUG -DDEBUGVM=0 -msse2 -DCOGMTVM=0 -pthread -DLSB_FIRST=1 -m64 -Wno-missing-braces -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-label -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable  -DHAVE_CONFIG_H  -DSQUEAK_BUILTIN_PLUGIN  -I/home/edwin/Squeak/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/edwin/Squeak/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build -I/home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Squeak/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Squeak/opensmalltalk-vm/src/spur64.cog -I/home/edwin/Squeak/opensmalltalk-vm/platforms/Cross/vm -I/home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm -I/home/edwin/Squeak/opensmalltalk-vm/src/spur64.cog   -I/home/edwin/Squeak/opensmalltalk-vm/platforms/Cross/plugins/FilePlugin  -I/home/edwin/Squeak/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 -Wno-unused-but-set-variable   -c -o sqUnixMain.o /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1832:10: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
> > >                 printf(optionStrings[count]);
> > >                        ^~~~~~~~~~~~~~~~~~~~
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:1832:10: note: treat the string as an argument to avoid this
> > >                 printf(optionStrings[count]);
> > >                        ^
> > >                        "%s",
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2324:38: error: incompatible function pointer types assigning to 'void (*)(int, struct __siginfo *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, struct __siginfo *, struct __ucontext *)') [-Wincompatible-function-pointer-types]
> > >         sigsegv_handler_action.sa_sigaction = sigsegv;
> > >                                             ^ ~~~~~~~
> > > /home/edwin/Squeak/opensmalltalk-vm/platforms/unix/vm/sqUnixMain.c:2331:38: error: incompatible function pointer types assigning to 'void (*)(int, struct __siginfo *, void *)' from 'void (int, siginfo_t *, ucontext_t *)' (aka 'void (int, struct __siginfo *, struct __ucontext *)') [-Wincompatible-function-pointer-types]
> > >         sigusr1_handler_action.sa_sigaction = sigusr1;
> > >                                             ^ ~~~~~~~
> > > 1 warning and 2 errors generated.
> > > *** Error code 1
> > >
> > > Stop.
> > > make[1]: stopped in /home/edwin/Squeak/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build/vm
> > > *** Error code 1
> > >
> > > Stop.
> > > make: stopped in /home/edwin/Squeak/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build
> > > [edwin@ottopedi ~/Squeak/opensmalltalk-vm/building/linux64x64/squeak.cog.spur/build]$
> > >
> > > If my assumption is correct, the 'solution seems to downgrade the error to a warning with a compiler option:   -Wno-error=, but I have no idea how to do this in the whole configuration and compilation process.
> > > Can someone tell how this should be done, or is it better to signal this as an error and wait until it gets corrected.
> > >
> > > Ugh, this is such an annoying warning, and now error.  Why isn't there a define for the type of sa_sigaction so that one can cast a function to it?  I've been looking for an acceptable cross-platform way to eliminate the warning for years.  I'm open to any suggestion.  As far as adding -Wno-error=incompatible-function-pointer-types, can't you do it by making a build directory that contains an mvm file that adds it to the compiler command line? You could add, say, building/freebsd64x64/squeak.cog.spur/{build,buildast,builddbg} can't mvms that contain
> > >
> > > CFLAGS="$CFLAGS -I/usr/local/include -Wno-error=incompatible-function-pointer-types"
> > >
> > > or you could extend the existing linux64x64 mvms with a test for clang, etc.  But basically the mvm is the most convenient place to add hacks like this, and the building directory is a convenient place to put configuration files that hack around annoying issues like this.
> > >
> > >
> > > Kind regards
> > >
> > > Edwin Ancaer
> > >
> > > Good luck man!
> > >
> > > _,,,^..^,,,_
> > > best, Eliot
> > >
> > >
> >
> >
>
> <preprocessor.out>