[oi-dev] cross/mingw-w64 failed to compile on SunOS

Hung Nguyen Gia gh_origin at zohomail.com
Tue Jan 19 10:14:01 UTC 2021


The SunOS variant I'm using is OpenIndiana.

I think it's better to contact the developers of it rather than doing our own patches to mingw-w64.




---- On Tue, 19 Jan 2021 17:08:49 +0700 Hung Nguyen Gia <gh_origin at zohomail.com> wrote ----

 > It has more than just SHARED. 
 >  
 > I edited deffilep.c and add #undef SHARED. 
 >  
 > Now it failed with WRITE in a similar way to SHARED: 
 >  
 > In file included from /usr/include/dlfcn.h:37, 
 >  from sysdep.h:80, 
 >  from deffilep.y:22: 
 > deffilep.c:234:5: error: expected identifier before numeric constant 
 >  234 |     WRITE = 277, 
 >  |     ^~~~~~ 
 > deffilep.c:265: warning: "SHARED" redefined 
 >  265 | #define WRITE 277 
 >  | 
 > In file included from /usr/include/dlfcn.h:37, 
 >  from sysdep.h:80, 
 >  from deffilep.y:22: 
 > /usr/include/sys/mman.h:105: note: this is the location of the previous definition 
 >  105 | #define SHARED  0x10 
 >  | 
 > gmake[4]: *** [Makefile:2148: deffilep.o] Error 1 
 > gmake[4]: *** Waiting for unfinished jobs.... 
 > gmake[5]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1/ld' 
 > gmake[5]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1/ld' 
 > mv -f .deps/pe-dll.Tpo .deps/pe-dll.Po 
 > gmake[4]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1/ld' 
 > gmake[3]: *** [Makefile:1751: all-recursive] Error 1 
 > gmake[3]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1/ld' 
 > gmake[2]: *** [Makefile:1035: all] Error 2 
 > gmake[2]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1/ld' 
 > gmake[1]: *** [Makefile:7213: all-ld] Error 2 
 > gmake[1]: Leaving directory '/export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils/work/binutils-2.35.1' 
 > gmake: *** [Makefile:853: all] Error 2 
 > *** Error code 2 
 >  
 > Stop. 
 > bmake[3]: stopped in /export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils 
 > *** Error code 1 
 >  
 > Stop. 
 > bmake[2]: stopped in /export/home/hung/pkgsrc/cross/mingw-w64-x86_64-binutils 
 > *** Error code 1 
 >  
 > Stop. 
 > bmake[1]: stopped in /export/home/hung/pkgsrc/cross/mingw-w64-x86_64-gcc 
 > *** Error code 1 
 >  
 > Stop. 
 > bmake: stopped in /export/home/hung/pkgsrc/cross/mingw-w64 
 >  
 >  
 >  
 >  
 > ---- On Tue, 19 Jan 2021 12:59:50 +0700 Roland Illig <roland.illig at gmx.de> wrote ---- 
 >  
 >  > On 19.01.2021 05:17, Hung Nguyen Gia wrote: 
 >  > > In file included from /usr/include/dlfcn.h:37, 
 >  > >                   from sysdep.h:80, 
 >  > >                   from deffilep.y:22: 
 >  > > deffilep.c:234:5: error: expected identifier before numeric constant 
 >  > >    234 |     SHARED = 279, 
 >  > >        |     ^~~~~~ 
 >  > > deffilep.c:265: warning: "SHARED" redefined 
 >  > >    265 | #define SHARED 279 
 >  > >        | 
 >  > > In file included from /usr/include/dlfcn.h:37, 
 >  > >                   from sysdep.h:80, 
 >  > >                   from deffilep.y:22: 
 >  > > /usr/include/sys/mman.h:105: note: this is the location of the previous definition 
 >  > >    105 | #define SHARED  0x10 
 >  > 
 >  > The error messages are quite clear in this case. 
 >  > 
 >  > <sys/mman.h> defines the preprocessor macro SHARED to 0x10. 
 >  > 
 >  > Since deffilep.c includes <sys/mman.h>, line 234 reads now: 
 >  > 
 >  >  0x10 = 279 
 >  > 
 >  > This doesn't make sense of course since an enumerator declaration must 
 >  > have a _name_, not a _number_, on the left-hand side of the '='. 
 >  > 
 >  > Later, deffilep.c redefines the preprocessor macro SHARED to 279, which 
 >  > adds an inconsistency. 
 >  > 
 >  > To fix this, either rename the token SHARED in deffilep.c or have a look 
 >  > at /usr/include/sys/mman.h to see in which circumstances the macro 
 >  > SHARED gets defined, and whether you can avoid that.  You cannot have 
 >  > both definitions for SHARED at the same time, since they contradict each 
 >  > other. 
 >  > 
 >  > Roland 
 >  > 
 > 



More information about the oi-dev mailing list