From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10702 invoked by alias); 30 Jan 2007 13:45:39 -0000 Received: (qmail 10648 invoked by uid 48); 30 Jan 2007 13:45:22 -0000 Date: Tue, 30 Jan 2007 13:45:00 -0000 Message-ID: <20070130134522.10647.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug bootstrap/30589] [4.3 regression] C99 extern inline patch broke bootstrap on i386-pc-mingw32 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "fxcoudert at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg02605.txt.bz2 ------- Comment #7 from fxcoudert at gcc dot gnu dot org 2007-01-30 13:45 ------- (In reply to comment #5) > CVS mingw runtime header _mingw.h has this, which avoids the problem: > > # if ( __MINGW_GNUC_PREREQ(4, 3) && __STDC_VERSION__ >= 199901L) > # define __CRT_INLINE extern inline __attribute__((__gnu_inline__)) > # else > # define __CRT_INLINE extern __inline__ > # endif Hum, here's what I don't understand. I installed the w32api-3.8, that includes the above, and I still get a failure (this is on a cross from i386-linux): $ ./bin/i386-pc-mingw32-gcc a.c b.c -std=c99 /tmp/ccR36DmT.o:b.c:(.text+0x0): multiple definition of `___fpclassifyl' /tmp/cc03idRc.o:a.c:(.text+0x0): first defined here [... more of those ...] So I look into the preprocessed files, and ___fpclassifyl is declared as: extern __attribute__((__gnu__inline__)) inline int __attribute__((__cdecl__)) __fpclassifyl (long double x){ unsigned short sw; __asm__ ("fxam; fstsw %%ax;" : "=a" (sw): "t" (x)); return sw & (0x0100 | 0x0400 | 0x4000 ); } so I reproduce it on a minimal testcase: $ cat u1.c extern __attribute__((__gnu__inline__)) inline void __attribute__((__cdecl__)) __fpclassifyl (){ ; } void foo() { ; } $ cat u2.c extern __attribute__((__gnu__inline__)) inline void __attribute__((__cdecl__)) __fpclassifyl (){ ; } void bar() { ; } $ ./bin/i386-pc-mingw32-gcc -std=c99 u1.c u2.c u1.c:1: warning: ‘__gnu__inline__’ attribute directive ignored u2.c:1: warning: ‘__gnu__inline__’ attribute directive ignored /tmp/ccni42ym.o:u2.c:(.text+0x0): multiple definition of `___fpclassifyl' /tmp/cc2aaPle.o:u1.c:(.text+0x0): first defined here /home/fxcoudert/cross_nightbuild/tmp/install-gcc/lib/gcc/i386-pc-mingw32/4.3.0/../../../../i386-pc-mingw32/lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined reference to `_WinMain@16' collect2: ld returned 1 exit status PS: all this is with mainline rev. 121280, Last Changed Date: 2007-01-29 06:53:40 +0100 (Mon, 29 Jan 2007). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30589