Open PatrickM-ZS opened 2 months ago
In Msys2 the change in src/idl/src/file.h is required for it to build.
#ifdef _MSC_VER
# include <basetsd.h>
typedef SSIZE_T ssize_t;
#endif
Otherwise it fails with this error:
[246/284] Building C object src/idl/CMakeFiles/idl.dir/src/directive.c.obj
FAILED: src/idl/CMakeFiles/idl.dir/src/directive.c.obj
C:\tools\msys64\mingw32\bin\cc.exe -DNTDDI_VERSION=NTDDI_WIN7 -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -D__USE_MINGW_ANSI_STDIO=1 -Didl_EXPORTS -IC:/dev/cyclonedds/src/idl/include -IC:/dev/cyclonedds/src/idl/src -IC:/dev/cyclonedds/build/src/idl/include -IC:/dev/cyclonedds/build/src/idl -IC:/dev/cyclonedds/src/idl/../core/ddsi/include -IC:/dev/cyclonedds/src/idl/../core/cdr/include -IC:/dev/cyclonedds/src/security/api/include -IC:/dev/cyclonedds/build/src/security/api/include -IC:/dev/cyclonedds/src/security/api/../../core/ddsi/include -IC:/dev/cyclonedds/src/security/api/../../core/cdr/include -IC:/dev/cyclonedds/build/src/core -IC:/dev/cyclonedds/build/src/core/include -IC:/dev/cyclonedds/src/core/ddsc/include -IC:/dev/cyclonedds/src/ddsrt/include -IC:/dev/cyclonedds/src/ddsrt/src -IC:/dev/cyclonedds/build/src/ddsrt/include -O2 -g -DNDEBUG -std=gnu99 -Wall -Wextra -Wconversion -Wmissing-prototypes -fdiagnostics-color=always -MD -MT src/idl/CMakeFiles/idl.dir/src/directive.c.obj -MF src\idl\CMakeFiles\idl.dir\src\directive.c.obj.d -o src/idl/CMakeFiles/idl.dir/src/directive.c.obj -c C:/dev/cyclonedds/src/idl/src/directive.c
In file included from C:/dev/cyclonedds/src/idl/src/directive.c:23:
C:/dev/cyclonedds/src/idl/src/file.h:23:17: error: conflicting types for 'ssize_t'; have 'SSIZE_T' {aka 'long int'}
23 | typedef SSIZE_T ssize_t;
| ^~~~~~~
In file included from C:/tools/msys64/mingw32/include/crtdefs.h:10,
from C:/tools/msys64/mingw32/include/assert.h:15,
from C:/dev/cyclonedds/src/idl/src/directive.c:11:
C:/tools/msys64/mingw32/include/corecrt.h:47:13: note: previous declaration of 'ssize_t' with type 'ssize_t' {aka 'int'}
47 | typedef int ssize_t;
| ^~~~~~~
[248/284] Building C object src/idl/CMakeFiles/idl.dir/src/tree.c.obj
FAILED: src/idl/CMakeFiles/idl.dir/src/tree.c.obj
C:\tools\msys64\mingw32\bin\cc.exe -DNTDDI_VERSION=NTDDI_WIN7 -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -D__USE_MINGW_ANSI_STDIO=1 -Didl_EXPORTS -IC:/dev/cyclonedds/src/idl/include -IC:/dev/cyclonedds/src/idl/src -IC:/dev/cyclonedds/build/src/idl/include -IC:/dev/cyclonedds/build/src/idl -IC:/dev/cyclonedds/src/idl/../core/ddsi/include -IC:/dev/cyclonedds/src/idl/../core/cdr/include -IC:/dev/cyclonedds/src/security/api/include -IC:/dev/cyclonedds/build/src/security/api/include -IC:/dev/cyclonedds/src/security/api/../../core/ddsi/include -IC:/dev/cyclonedds/src/security/api/../../core/cdr/include -IC:/dev/cyclonedds/build/src/core -IC:/dev/cyclonedds/build/src/core/include -IC:/dev/cyclonedds/src/core/ddsc/include -IC:/dev/cyclonedds/src/ddsrt/include -IC:/dev/cyclonedds/src/ddsrt/src -IC:/dev/cyclonedds/build/src/ddsrt/include -O2 -g -DNDEBUG -std=gnu99 -Wall -Wextra -Wconversion -Wmissing-prototypes -fdiagnostics-color=always -MD -MT src/idl/CMakeFiles/idl.dir/src/tree.c.obj -MF src\idl\CMakeFiles\idl.dir\src\tree.c.obj.d -o src/idl/CMakeFiles/idl.dir/src/tree.c.obj -c C:/dev/cyclonedds/src/idl/src/tree.c
In file included from C:/dev/cyclonedds/src/idl/src/tree.c:21:
C:/dev/cyclonedds/src/idl/src/file.h:23:17: error: conflicting types for 'ssize_t'; have 'SSIZE_T' {aka 'long int'}
23 | typedef SSIZE_T ssize_t;
| ^~~~~~~
In file included from C:/tools/msys64/mingw32/include/crtdefs.h:10,
from C:/tools/msys64/mingw32/include/assert.h:15,
from C:/dev/cyclonedds/src/idl/src/tree.c:11:
C:/tools/msys64/mingw32/include/corecrt.h:47:13: note: previous declaration of 'ssize_t' with type 'ssize_t' {aka 'int'}
47 | typedef int ssize_t;
| ^~~~~~~
[259/284] Building C object src/idl/CMakeFiles/idl.dir/src/file.c.obj
FAILED: src/idl/CMakeFiles/idl.dir/src/file.c.obj
C:\tools\msys64\mingw32\bin\cc.exe -DNTDDI_VERSION=NTDDI_WIN7 -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -D__USE_MINGW_ANSI_STDIO=1 -Didl_EXPORTS -IC:/dev/cyclonedds/src/idl/include -IC:/dev/cyclonedds/src/idl/src -IC:/dev/cyclonedds/build/src/idl/include -IC:/dev/cyclonedds/build/src/idl -IC:/dev/cyclonedds/src/idl/../core/ddsi/include -IC:/dev/cyclonedds/src/idl/../core/cdr/include -IC:/dev/cyclonedds/src/security/api/include -IC:/dev/cyclonedds/build/src/security/api/include -IC:/dev/cyclonedds/src/security/api/../../core/ddsi/include -IC:/dev/cyclonedds/src/security/api/../../core/cdr/include -IC:/dev/cyclonedds/build/src/core -IC:/dev/cyclonedds/build/src/core/include -IC:/dev/cyclonedds/src/core/ddsc/include -IC:/dev/cyclonedds/src/ddsrt/include -IC:/dev/cyclonedds/src/ddsrt/src -IC:/dev/cyclonedds/build/src/ddsrt/include -O2 -g -DNDEBUG -std=gnu99 -Wall -Wextra -Wconversion -Wmissing-prototypes -fdiagnostics-color=always -MD -MT src/idl/CMakeFiles/idl.dir/src/file.c.obj -MF src\idl\CMakeFiles\idl.dir\src\file.c.obj.d -o src/idl/CMakeFiles/idl.dir/src/file.c.obj -c C:/dev/cyclonedds/src/idl/src/file.c
In file included from C:/dev/cyclonedds/src/idl/src/file.c:26:
C:/dev/cyclonedds/src/idl/src/file.h:23:17: error: conflicting types for 'ssize_t'; have 'SSIZE_T' {aka 'long int'}
23 | typedef SSIZE_T ssize_t;
| ^~~~~~~
In file included from C:/tools/msys64/mingw32/include/crtdefs.h:10,
from C:/tools/msys64/mingw32/include/assert.h:15,
from C:/dev/cyclonedds/src/idl/src/file.c:11:
C:/tools/msys64/mingw32/include/corecrt.h:47:13: note: previous declaration of 'ssize_t' with type 'ssize_t' {aka 'int'}
47 | typedef int ssize_t;
| ^~~~~~~
[263/284] Linking C executable bin\symbol_export_test.exe
ninja: build stopped: subcommand failed.
This isn't an issue in the Docker-build, because idlc is compiled natively, I guess.
This should fix #2051. Thanks to @e-tmplr!
I've added a Dockerfile for Linux with a cross-compile toolchain. It builds, but I've not had much success running the binaries through wine. 32-bit crashes with illegal memory access, 64-bit runs but complains about malformed packets and outputs some gibberish. Maybe due to wine bugs, bad configuration, or perhaps there's something more serious. But that could be fixed on a different PR.