Bug #1292

1.8 compile time error with mingw gcc 4.3

Added by Roger Pack almost 3 years ago. Updated 9 months ago.

[ruby-core:22894]
Status:Closed Start date:03/15/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:build
Target version:Ruby 1.8.6
ruby -v:1.8.6p287

Description

I get this compiling 1.8.6p287

gcc -I. -I../.. -I../../../ruby_1_8 -I../../../ruby_1_8/ext/socket -DHAVE_SOCKADDR_STORAGE -DHAVE_INET_NTOA -DHAVE_GETSERVBYPORT -Dsocklen_t=int -DHAVE_WSACLEANUP -DHAVE_GETHOSTNAME -I.   -g -O2   -c ../../../ruby_1_8/ext/socket/socket.c
In file included from ../../../ruby_1_8/win32/win32.h:30,
                 from ../../../ruby_1_8/defines.h:183,
                 from ../../../ruby_1_8/ruby.h:37,
                 from ../../../ruby_1_8/ext/socket/socket.c:13:
c:\dev\rubyi_43\sandbox\mingw\bin\../lib/gcc/mingw32/4.3.3/../../../../include/ws2tcpip.h:272: error: two or more data types in declaration specifiers
make[1]: *** [socket.o] Error 1

surrounding the offending line [272] with an
#ifndef socklen_t
typedef int socklen_t;
#endif
seems to fix it.
Thanks!

History

Updated by Nobuyoshi Nakada almost 3 years ago

Hi,

At Sun, 15 Mar 2009 12:23:38 +0900,
Roger Pack wrote in [ruby-core:22894]:
> gcc -I. -I../.. -I../../../ruby_1_8 -I../../../ruby_1_8/ext/socket -DHAVE_SOCKADDR_STORAGE -DHAVE_INET_NTOA -DHAVE_GETSERVBYPORT -Dsocklen_t=int -DHAVE_WSACLEANUP -DHAVE_GETHOSTNAME -I.   -g -O2   -c ../../../ruby_1_8/ext/socket/socket.c
> In file included from ../../../ruby_1_8/win32/win32.h:30,
>                  from ../../../ruby_1_8/defines.h:183,
>                  from ../../../ruby_1_8/ruby.h:37,
>                  from ../../../ruby_1_8/ext/socket/socket.c:13:
> c:\dev\rubyi_43\sandbox\mingw\bin\../lib/gcc/mingw32/4.3.3/../../../../include/ws2tcpip.h:272: error: two or more data types in declaration specifiers
> make[1]: *** [socket.o] Error 1
> 
> surrounding the offending line [272] with an
> #ifndef socklen_t
> typedef int socklen_t;
> #endif
> seems to fix it.

Seems extconf.rb failed to detect socklen_t.  Could you show
the mkmf.log?

-- 
Nobu Nakada

Updated by Nobuyoshi Nakada almost 3 years ago

Hi,

At Sun, 15 Mar 2009 13:46:42 +0900,
Roger Pack wrote in [ruby-core:22898]:
> have_type: checking for socklen_t... -------------------- no

> /* begin */
> 1: #include <windows.h>
> 2: #include <winsock.h>

Testing with winsock 1, RbConfig::CONFIG["COMMON_HEADERS"]
should be "windows.h winsock.h", but


At Sun, 15 Mar 2009 12:23:38 +0900,
Roger Pack wrote in [ruby-core:22894]:
> gcc -I. -I../.. -I../../../ruby_1_8 -I../../../ruby_1_8/ext/socket -DHAVE_SOCKADDR_STORAGE -DHAVE_INET_NTOA -DHAVE_GETSERVBYPORT -Dsocklen_t=int -DHAVE_WSACLEANUP -DHAVE_GETHOSTNAME -I.   -g -O2   -c ../../../ruby_1_8/ext/socket/socket.c
> In file included from ../../../ruby_1_8/win32/win32.h:30,
>                  from ../../../ruby_1_8/defines.h:183,
>                  from ../../../ruby_1_8/ruby.h:37,
>                  from ../../../ruby_1_8/ext/socket/socket.c:13:
> c:\dev\rubyi_43\sandbox\mingw\bin\../lib/gcc/mingw32/4.3.3/../../../../include/ws2tcpip.h:272: error: two or more data types in declaration specifiers

Compiling with winsock 2.

How did you run configure.bat?

-- 
Nobu Nakada

Updated by Nobuyoshi Nakada almost 3 years ago

  • Category set to build
  • Status changed from Open to Assigned

Updated by Nobuyoshi Nakada almost 3 years ago

  • Status changed from Assigned to Feedback

Updated by Nobuyoshi Nakada almost 3 years ago

Hi,

At Mon, 16 Mar 2009 20:10:26 +0900,
Roger Pack wrote in [ruby-core:22915]:
> This was using ./configure with MSYS.  It worked fine with GCC 3.4 so
> that's why I mention it.  If interested you can recreate it by running
> rake in the gcc43 branch of
> http://github.com/rogerdpack/rubyinstaller/tree/master

I'm running msys gcc-4.3.0 in these days, but haven't seen that
problem.  Does it occur if you run configure without rake?

-- 
Nobu Nakada

Updated by Roger Pack over 2 years ago

this seems to not be a bug anymore.  Thanks for the input.
-=r

Updated by Marc-Andre Lafortune over 2 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF