Discussion:
[patch bfd]: Add further support for x86_64 mingw
Kai Tietz
2008-01-17 12:02:38 UTC
Permalink
Hi,

while porting gdb for x86_64 mingw, I noticed a missing part in
bfd_get_sign_extend_vma() not checking for pe-x86-64 and pei-x86-64.
Additionally the makros sprintf_vma and fprintf_vma need to treat the ms
formatter style I64 (instead of the gnu variant ll).

Changelog for bfd:

2008-01-17 Kai Tietz <***@onevision.com>

* bfd-in.h: Add mingw I64 support.
* bfd-in2.h: Regenerated.
+ bfd.c: (bfd_get_sign_extend_vma): Add pe-x86-64 and pei-x86-64.

Is this patch OK for apply?

Cheers,
i.A. Kai Tietz



| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÀrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÀftsfÌhrer:
Ulrike Döhler, Manuela Kluger
Kai Tietz
2008-01-17 14:28:06 UTC
Permalink
Hi,

This patch corrects the for mingw the use of 'll' formatter styles.

ChangeLog

2008-01-17 Kai Tietz <***@onevision.com>

* binutils/prdbg.c: Correct formatter style use.
* binutils/readelf.c: Likewise.
* binutils/strings.c: Likewise.

Is this OK for apply?

Cheers,
i.A. Kai Tietz



| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÀrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÀftsfÌhrer:
Ulrike Döhler, Manuela Kluger
Kai Tietz
2008-01-17 14:31:52 UTC
Permalink
Hi,

This patch corrects the gnu style use of 'll' in printf formatters for
mingw by using the ms style 'I64'.

2008-01-17 Kai Tietz <***@onevision.com>

* gas/read.c: (emit_expr): Correct for mingw use of printf size
specifier.

Is this OK for apply?

Cheers,
i.A. Kai Tietz



| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÀrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÀftsfÌhrer:
Ulrike Döhler, Manuela Kluger
Brian Dessent
2008-01-17 23:56:15 UTC
Permalink
+#ifndef _WIN32
#define sprintf_vma(s,x) sprintf (s, "%016llx", x)
#define fprintf_vma(f,x) fprintf (f, "%016llx", x)
#else
+#define sprintf_vma(s,x) sprintf (s, "%016I64x", x)
+#define fprintf_vma(f,x) fprintf (f, "%016I64x", x)
+#endif
+#else
Can't you just use the standard inttypes.h macros, e.g.

#define sprintf_vma(s,x) sprintf (s, "%016" PRIx64, x)

Brian
Kai Tietz
2008-01-18 07:14:07 UTC
Permalink
Hi Brian,
Post by Brian Dessent
+#ifndef _WIN32
#define sprintf_vma(s,x) sprintf (s, "%016llx", x)
#define fprintf_vma(f,x) fprintf (f, "%016llx", x)
#else
+#define sprintf_vma(s,x) sprintf (s, "%016I64x", x)
+#define fprintf_vma(f,x) fprintf (f, "%016I64x", x)
+#endif
+#else
Can't you just use the standard inttypes.h macros, e.g.
#define sprintf_vma(s,x) sprintf (s, "%016" PRIx64, x)
Ouf course. But I was uncertain, if these macros are available on all
platforms. If so, I can change the patch in this way.

Cheers,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Kai Tietz
2008-01-22 14:46:49 UTC
Permalink
Post by Brian Dessent
+#ifndef _WIN32
#define sprintf_vma(s,x) sprintf (s, "%016llx", x)
#define fprintf_vma(f,x) fprintf (f, "%016llx", x)
#else
+#define sprintf_vma(s,x) sprintf (s, "%016I64x", x)
+#define fprintf_vma(f,x) fprintf (f, "%016I64x", x)
+#endif
+#else
Can't you just use the standard inttypes.h macros, e.g.
#define sprintf_vma(s,x) sprintf (s, "%016" PRIx64, x)
I could add the inttypes.h header into bfd-in.h, but this would mean to
inherit config, too. This I think isn't a good choice. So the other
solution to prevent to much target specific '#ifdef'-clauses would be to
add to bfd-in.h an equivalent to the printf formatters in standard
inttypes.h, like BFD_PRIx64, BFD_PRIx32, ...? Otherwise it seems to be
better to live with target specific clauses. What is your opinion about
this?

Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrike Döhler, Manuela Kluger
Brian Dessent
2008-01-22 15:23:41 UTC
Permalink
Post by Kai Tietz
Post by Brian Dessent
Can't you just use the standard inttypes.h macros, e.g.
#define sprintf_vma(s,x) sprintf (s, "%016" PRIx64, x)
I could add the inttypes.h header into bfd-in.h, but this would mean to
inherit config, too. This I think isn't a good choice. So the other
I suppose that would pull in a new dependency where it previously didn't
exist before. I was thinking you could provide a default value of llx
(et cetera) if it's not defined, but you'd still need to do a header
check and I guess that's too much trouble.
Post by Kai Tietz
solution to prevent to much target specific '#ifdef'-clauses would be to
add to bfd-in.h an equivalent to the printf formatters in standard
inttypes.h, like BFD_PRIx64, BFD_PRIx32, ...? Otherwise it seems to be
better to live with target specific clauses. What is your opinion about
this?
Is _WIN32 really the right thing to predicate this on? For example
someone using Cygwin and also using the w32api directly (by #include
<windows.h>) will have _WIN32 defined, but they aren't using MSVCRT and
so I64x is wrong. Admittedly this is probably not something that is
likely to occur in bfd, and I know this is a common idiom, but why not
conditionalize it on __MSVCRT__ instead? MinGW gcc defines this as a
builtin right next to _WIN32 but it is not overloaded with the meaning
of "I'm using the Windows headers."

Brian
Daniel Jacobowitz
2008-01-22 15:37:36 UTC
Permalink
Post by Brian Dessent
I suppose that would pull in a new dependency where it previously didn't
exist before. I was thinking you could provide a default value of llx
(et cetera) if it's not defined, but you'd still need to do a header
check and I guess that's too much trouble.
I believe there is an autoconf macro in gnulib to generate inttypes.h...
--
Daniel Jacobowitz
CodeSourcery
NightStrike
2008-01-23 12:42:05 UTC
Permalink
Post by Daniel Jacobowitz
Post by Brian Dessent
I suppose that would pull in a new dependency where it previously didn't
exist before. I was thinking you could provide a default value of llx
(et cetera) if it's not defined, but you'd still need to do a header
check and I guess that's too much trouble.
I believe there is an autoconf macro in gnulib to generate inttypes.h...
Which macro? Would this be a big change?
Kai Tietz
2008-01-22 15:42:20 UTC
Permalink
Post by Brian Dessent
Post by Kai Tietz
Post by Brian Dessent
Can't you just use the standard inttypes.h macros, e.g.
#define sprintf_vma(s,x) sprintf (s, "%016" PRIx64, x)
I could add the inttypes.h header into bfd-in.h, but this would mean to
inherit config, too. This I think isn't a good choice. So the other
I suppose that would pull in a new dependency where it previously didn't
exist before. I was thinking you could provide a default value of llx
(et cetera) if it's not defined, but you'd still need to do a header
check and I guess that's too much trouble.
Post by Kai Tietz
solution to prevent to much target specific '#ifdef'-clauses would be to
add to bfd-in.h an equivalent to the printf formatters in standard
inttypes.h, like BFD_PRIx64, BFD_PRIx32, ...? Otherwise it seems to be
better to live with target specific clauses. What is your opinion about
this?
Is _WIN32 really the right thing to predicate this on? For example
someone using Cygwin and also using the w32api directly (by #include
<windows.h>) will have _WIN32 defined, but they aren't using MSVCRT and
so I64x is wrong. Admittedly this is probably not something that is
likely to occur in bfd, and I know this is a common idiom, but why not
conditionalize it on __MSVCRT__ instead? MinGW gcc defines this as a
builtin right next to _WIN32 but it is not overloaded with the meaning
of "I'm using the Windows headers."
AFAIK doesn't cygwin define _WIN32. I checked current gcc sources and
didn't saw it for cgywin, just for mingw32. The __MSVCRT__ would be an
alternative, for sure. But isn't the macro _WIN32 just the API we use?

Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
Brian Dessent
2008-01-22 15:53:49 UTC
Permalink
Post by Kai Tietz
AFAIK doesn't cygwin define _WIN32. I checked current gcc sources and
didn't saw it for cgywin, just for mingw32. The __MSVCRT__ would be an
alternative, for sure. But isn't the macro _WIN32 just the API we use?
Correct, Cygwin does not normally define _WIN32 but if you #include
<windows.h> it gets defined there too... it's not a common scenario
since the goal of Cygwin is not to use Windowsisms, but you can still do
it if you need access to something in the w32api and there's no POSIX
analog.

Brian
Kai Tietz
2008-01-22 15:58:59 UTC
Permalink
Post by Brian Dessent
Post by Kai Tietz
AFAIK doesn't cygwin define _WIN32. I checked current gcc sources and
didn't saw it for cgywin, just for mingw32. The __MSVCRT__ would be an
alternative, for sure. But isn't the macro _WIN32 just the API we use?
Correct, Cygwin does not normally define _WIN32 but if you #include
<windows.h> it gets defined there too... it's not a common scenario
since the goal of Cygwin is not to use Windowsisms, but you can still do
it if you need access to something in the w32api and there's no POSIX
analog.
Upps your are right 8) I missed this. So I will replace the #ifdef _WIN32
by #ifdef __MSVCRT__. Is this fine?

Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
Pedro Alves
2008-01-24 01:26:18 UTC
Permalink
Post by Brian Dessent
Is _WIN32 really the right thing to predicate this on? For example
someone using Cygwin and also using the w32api directly (by #include
<windows.h>) will have _WIN32 defined, but they aren't using MSVCRT and
so I64x is wrong. Admittedly this is probably not something that is
likely to occur in bfd, and I know this is a common idiom, but why not
conditionalize it on __MSVCRT__ instead? MinGW gcc defines this as a
builtin right next to _WIN32 but it is not overloaded with the meaning
of "I'm using the Windows headers."
__MSVCRT__ is defined if using the the msvcrt.dll runtime. If using the
old crtdll runtime it is __CRTDLL__ (gcc/config/crtdll.h). For Windows
CE, it is coredll.dll, so it is __COREDLL__ that gets defined.

Isn't it usual to do:
#if defined (_WIN32) && !defined (__CYGWIN__)

or:
#ifdef __MINGW32__
?
--
Pedro Alves
Kai Tietz
2008-01-24 08:27:54 UTC
Permalink
Post by Pedro Alves
Post by Brian Dessent
Is _WIN32 really the right thing to predicate this on? For example
someone using Cygwin and also using the w32api directly (by #include
<windows.h>) will have _WIN32 defined, but they aren't using MSVCRT and
so I64x is wrong. Admittedly this is probably not something that is
likely to occur in bfd, and I know this is a common idiom, but why not
conditionalize it on __MSVCRT__ instead? MinGW gcc defines this as a
builtin right next to _WIN32 but it is not overloaded with the meaning
of "I'm using the Windows headers."
__MSVCRT__ is defined if using the the msvcrt.dll runtime. If using the
old crtdll runtime it is __CRTDLL__ (gcc/config/crtdll.h). For Windows
CE, it is coredll.dll, so it is __COREDLL__ that gets defined.
#if defined (_WIN32) && !defined (__CYGWIN__)
#ifdef __MINGW32__
?
You are right, that the simple chack for __MSVCRT__ isn't engough, but the
pattern
Post by Pedro Alves
#if defined (_WIN32) && !defined (__CYGWIN__)
seems to be a bit misleading. IMHO the clause should be something like
#if defined(__CRTDLL__) || defined(__MSVCRT__)

This pattern matches for crtdll (ce), uwin, cygwin, and mingw.
Do you agree?

Cheers,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrike Döhler, Manuela
Pedro Alves
2008-01-24 14:13:00 UTC
Permalink
Post by Kai Tietz
You are right, that the simple chack for __MSVCRT__ isn't engough, but the
pattern
Post by Pedro Alves
#if defined (_WIN32) && !defined (__CYGWIN__)
seems to be a bit misleading.
grep through the binutils sources for _WIN32 or "_WIN32.*__CYGWIN" ?
It's what's normally used.
Post by Kai Tietz
IMHO the clause should be something like
#if defined(__CRTDLL__) || defined(__MSVCRT__)
This pattern matches for crtdll (ce), uwin, cygwin, and mingw.
Do you agree?
Well, it doesn't match ce (coredll not crtdll there), but then again,
there's no such thing as a native binutils CE port. I was only
pointing it out as example of the nature of that macro. I've never
really used crtdll -- it's all msvcrt nowadays, AFAIK. Anyway,
this tends to bikeshed, so, I'll just state that whatever goes in
is fine by me.
--
Pedro Alves
Kai Tietz
2008-01-24 14:29:24 UTC
Permalink
Post by Pedro Alves
Post by Kai Tietz
You are right, that the simple chack for __MSVCRT__ isn't engough, but the
pattern
Post by Pedro Alves
#if defined (_WIN32) && !defined (__CYGWIN__)
seems to be a bit misleading.
grep through the binutils sources for _WIN32 or "_WIN32.*__CYGWIN" ?
It's what's normally used.
Post by Kai Tietz
IMHO the clause should be something like
#if defined(__CRTDLL__) || defined(__MSVCRT__)
This pattern matches for crtdll (ce), uwin, cygwin, and mingw.
Do you agree?
Well, it doesn't match ce (coredll not crtdll there), but then again,
there's no such thing as a native binutils CE port. I was only
pointing it out as example of the nature of that macro. I've never
really used crtdll -- it's all msvcrt nowadays, AFAIK. Anyway,
this tends to bikeshed, so, I'll just state that whatever goes in
is fine by me.
Well, I will us the '#if defined(__CRTDLL__) || defined(__MSVCRT__)'
thing, because just in this cases the ms formatters are used in a obvious
way, isn't it?
But another question I have is the issue with inttypes.h. I think to
introduce here a dependency to "config.h" wouldn't be that good. Also I
have no idea, which autoconf macro in gnulib Daniel means for generate
inttypes.h and if this dependency is good. I would suggest to introduce in
bfd-in2.h some macros (especially that for 64-bit values) like that of
inttypes.h (E.g. BFD_PRI64X, BFD_PRI64D, etc.). It would prevent to much
target specific '#if'-clauses in implementation. Do you agree?

Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
Kai Tietz
2008-01-22 16:16:29 UTC
Permalink
Post by Brian Dessent
Post by Kai Tietz
AFAIK doesn't cygwin define _WIN32. I checked current gcc sources and
didn't saw it for cgywin, just for mingw32. The __MSVCRT__ would be an
alternative, for sure. But isn't the macro _WIN32 just the API we use?
Correct, Cygwin does not normally define _WIN32 but if you #include
<windows.h> it gets defined there too... it's not a common scenario
since the goal of Cygwin is not to use Windowsisms, but you can still do
it if you need access to something in the w32api and there's no POSIX
analog.
Upps your are right 8) I missed this. So I will replace the #ifdef _WIN32
by #ifdef __MSVCRT__. Is this fine?

I attached the updated patch files.

Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
Nick Clifton
2008-01-25 16:21:17 UTC
Permalink
Hi Kai,
Post by Kai Tietz
I attached the updated patch files.
Approved and applied.

I think that in the long run it would be better to move these print format
strings into a header but for now the patch is OK.

Cheers
Nick
Kai Tietz
2008-01-28 08:00:44 UTC
Permalink
Hi Nick.
Post by Nick Clifton
Approved and applied.
Thanks
Post by Nick Clifton
I think that in the long run it would be better to move these print format
strings into a header but for now the patch is OK.
I will prepare an update patch for this, using gnulib for stdint.h, soon.

Cheers,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrik
H.J. Lu
2008-02-02 16:27:59 UTC
Permalink
FYI, those x86_64 mingw patches have broken 32bit mingw host for 64bit
target: when compiling
with gcc 4.1:

http://sourceware.org/bugzilla/show_bug.cgi?id=5715


H.J.
Post by Nick Clifton
Hi Kai,
Post by Kai Tietz
I attached the updated patch files.
Approved and applied.
I think that in the long run it would be better to move these print format
strings into a header but for now the patch is OK.
Cheers
Nick
NightStrike
2008-02-02 16:52:57 UTC
Permalink
Post by H.J. Lu
Post by Nick Clifton
Hi Kai,
Post by Kai Tietz
I attached the updated patch files.
Approved and applied.
I think that in the long run it would be better to move these print format
strings into a header but for now the patch is OK.
Cheers
Nick
FYI, those x86_64 mingw patches have broken 32bit mingw host for 64bit
target: when compiling
http://sourceware.org/bugzilla/show_bug.cgi?id=5715
H.J.
I think that the problem was always there to begin with, and Kai's
patch just exposed it and stopped it from being compiled silently. In
this case, Win32 mingw may be wrong.
H.J. Lu
2008-02-02 20:22:45 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Post by Nick Clifton
Hi Kai,
Post by Kai Tietz
I attached the updated patch files.
Approved and applied.
I think that in the long run it would be better to move these print
format
Post by H.J. Lu
Post by Nick Clifton
strings into a header but for now the patch is OK.
Cheers
Nick
FYI, those x86_64 mingw patches have broken 32bit mingw host for 64bit
target: when compiling
http://sourceware.org/bugzilla/show_bug.cgi?id=5715
H.J.
I think that the problem was always there to begin with, and Kai's
patch just exposed it and stopped it from being compiled silently. In
this case, Win32 mingw may be wrong.
Indeed, this patch is not related to 64-bit only. May the header is a bit
misleading. 64-bit and 32-bit ms printf formatter are not supporting a
working length specifier 'll'. It is for both platforms 'I64' and nothing
else. Otherwise the binutils applications are compiling silently, but do not
work as demanded.
May we should disable for mingw the error about warnings for formatters.
Or we can use things like

#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))

H.J.
Kai Tietz
2008-02-02 22:09:27 UTC
Permalink
Post by H.J. Lu
Post by Kai Tietz
Post by H.J. Lu
Post by Nick Clifton
Hi Kai,
Post by Kai Tietz
I attached the updated patch files.
Approved and applied.
I think that in the long run it would be better to move these print
format
Post by H.J. Lu
Post by Nick Clifton
strings into a header but for now the patch is OK.
Cheers
Nick
FYI, those x86_64 mingw patches have broken 32bit mingw host for 64bit
target: when compiling
http://sourceware.org/bugzilla/show_bug.cgi?id=5715
H.J.
I think that the problem was always there to begin with, and Kai's
patch just exposed it and stopped it from being compiled silently. In
this case, Win32 mingw may be wrong.
Indeed, this patch is not related to 64-bit only. May the header is a bit
misleading. 64-bit and 32-bit ms printf formatter are not supporting a
working length specifier 'll'. It is for both platforms 'I64' and nothing
else. Otherwise the binutils applications are compiling silently, but do not
work as demanded.
May we should disable for mingw the error about warnings for formatters.
Or we can use things like
#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
H.J.,
This would be a partial solution for bfd. But the 'll' is used on some
places in binutils and gas, too. So we have to change them too. A
positive side effect of this approach is, that we won't need target
specific '#if' clauses.

Cheers,
Kai
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination
H.J. Lu
2008-02-03 00:02:22 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Or we can use things like
#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) & 0xffffffff))
#define fprintf_vma(s,x) \
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
H.J.,
This would be a partial solution for bfd. But the 'll' is used on some
places in binutils and gas, too. So we have to change them too. A
positive side effect of this approach is, that we won't need target
Would you mind submitting a patch to fix 32bit mingw with gcc 4.1?
Post by Kai Tietz
specific '#if' clauses.
We still need "#if" for hosts, like mingw, which support long long,
but don't support %ll.

Thanks.

H.J.
Kai Tietz
2008-02-04 09:10:38 UTC
Permalink
Post by H.J. Lu
Post by Kai Tietz
Post by H.J. Lu
Or we can use things like
#define _bfd_int64_low(x) ((unsigned long) (((x) & 0xffffffff)))
#define _bfd_int64_high(x) ((unsigned long) (((x) >> 32) &
0xffffffff))
Post by H.J. Lu
Post by Kai Tietz
Post by H.J. Lu
#define fprintf_vma(s,x) \
fprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
#define sprintf_vma(s,x) \
sprintf ((s), "%08lx%08lx", _bfd_int64_high (x), _bfd_int64_low (x))
H.J.,
This would be a partial solution for bfd. But the 'll' is used on some
places in binutils and gas, too. So we have to change them too. A
positive side effect of this approach is, that we won't need target
Would you mind submitting a patch to fix 32bit mingw with gcc 4.1?
Post by Kai Tietz
specific '#if' clauses.
We still need "#if" for hosts, like mingw, which support long long,
but don't support %ll.
Jsut for your notice, if you specify for configure the option
'--disable-werror' you can cross compile without breaking the build.
Should I add a patch to configure to disable -Werror for mingw targets?

Cheers,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrike Döhler, Manuela Kluger
Kai Tietz
2008-02-04 11:02:43 UTC
Permalink
Hi H.J.,

I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently no
ability to re-generate them.

ChangeLog

2008-02-04 Kai Tietz <***@onevision.com>

* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.



Cheers,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
KomplementÀrin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - GeschÀftsfÌhrer:
Ulrike Döhler, Manuela Kluger
H.J. Lu
2008-02-04 14:31:39 UTC
Permalink
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently no
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.

BTW, can you use -Wno-format instead of disabling -Werror on mingw?

Thanks.


H.J.
Kai Tietz
2008-02-04 14:39:32 UTC
Permalink
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently no
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
Ok
Post by H.J. Lu
BTW, can you use -Wno-format instead of disabling -Werror on mingw?
Does -Wno-format exists? I searched it in "info gcc", but didn't saw it
there.

Regards,
i.A. Kai Tietz

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

------------------------------------------------------------------------------------------
OneVision Software Entwicklungs GmbH & Co. KG
Dr.-Leo-Ritter-Straße 9 - 93049 Regensburg
Tel: +49.(0)941.78004.0 - Fax: +49.(0)941.78004.489 - www.OneVision.com
Commerzbank Regensburg - BLZ 750 400 62 - Konto 6011050
Handelsregister: HRA 6744, Amtsgericht Regensburg
Komplementärin: OneVision Software Entwicklungs Verwaltungs GmbH
Dr.-Leo-Ritter-Straße 9 – 93049 Regensburg
Handelsregister: HRB 8932, Amtsgericht Regensburg - Geschäftsführer:
Ulrike Döhler, Manue
H.J. Lu
2008-02-04 14:55:58 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently
no
Post by H.J. Lu
Post by Kai Tietz
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
Ok
Post by H.J. Lu
BTW, can you use -Wno-format instead of disabling -Werror on mingw?
Does -Wno-format exists? I searched it in "info gcc", but didn't saw it
there.
"info gcc" shows

Many options have long names starting with `-f' or with `-W'--for
example, `-fstrength-reduce', `-Wformat' and so on. Most of these have
both positive and negative forms; the negative form of `-ffoo' would be
`-fno-foo'. This manual documents only one of these two forms,
whichever one is not the default.


H.J.
Kai Tietz
2008-02-04 15:10:05 UTC
Permalink
Hi H.J.,
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently no
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
2008-02-04 Kai Tietz <***@onevision.com>

PR/5715
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Post by H.J. Lu
BTW, can you use -Wno-format instead of disabling -Werror on mingw?
Ok, I modified the patch to disable only the format checking for mingw.

Is this patch ok for apply? If yes, could some doing this with a working
autoconf.

Thanks and cheers,
i.A. Kai Tietz



| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") wor
H.J. Lu
2008-02-04 15:38:03 UTC
Permalink
Post by Kai Tietz
Hi H.J.,
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently
no
Post by H.J. Lu
Post by Kai Tietz
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
PR/5715
* bfd/warning.m4: Disable by default -Werror for mingw.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+# Disable -Werror by default when using gcc and mingw
^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.


H.J.
Kai Tietz
2008-02-04 15:50:54 UTC
Permalink
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable the
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have currently
no
Post by H.J. Lu
Post by Kai Tietz
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
PR/5715
* bfd/warning.m4: Disable by default -Werror for mingw.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+# Disable -Werror by default when using gcc and mingw
^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.
Yes, because this feature is available until gcc 4.4 (AFAICS). If you
don't apply the patch file for gcc 4.3, you will have the same results as
for any mingw target. The patch to gcc affects all mingw targets.

Cheers,
Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
H.J. Lu
2008-02-04 16:44:33 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable
the
Post by H.J. Lu
Post by Kai Tietz
Post by H.J. Lu
Post by Kai Tietz
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have
currently
Post by H.J. Lu
Post by Kai Tietz
no
Post by H.J. Lu
Post by Kai Tietz
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
PR/5715
* bfd/warning.m4: Disable by default -Werror for mingw.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+# Disable -Werror by default when using gcc and mingw
^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.
Yes, because this feature is available until gcc 4.4 (AFAICS). If you
don't apply the patch file for gcc 4.3, you will have the same results as
for any mingw target. The patch to gcc affects all mingw targets.
Thanks. Please update your patch with "-Wno-format" instead of
"Disable -Werror by default".


H.J.
H.J. Lu
2008-02-04 19:39:35 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
Post by H.J. Lu
Post by Kai Tietz
Hi H.J.,
I patched bfd/warning.m4. Could you review it. It should diable
the
Post by H.J. Lu
Post by Kai Tietz
Post by H.J. Lu
Post by Kai Tietz
-Werror option for host mingw.
You need to regenerate the configure scripts, because I have
currently
Post by H.J. Lu
Post by Kai Tietz
no
Post by H.J. Lu
Post by Kai Tietz
ability to re-generate them.
ChangeLog
* bfd/warning.m4: Disable by default -Werror for mingw.
* bfd/configure: Regenerate.
* gas/configure: Regenerate.
* binutils/configure: Regenerate.
* ld/configure: Regenerate.
Please mention PR 5715 in your ChangeLog.
PR/5715
* bfd/warning.m4: Disable by default -Werror for mingw.
^^^^^^^^^^^^^^^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+# Disable -Werror by default when using gcc and mingw
^^^^^^^^^^^^^
It is wrong.
Post by Kai Tietz
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.
Yes, because this feature is available until gcc 4.4 (AFAICS). If you
don't apply the patch file for gcc 4.3, you will have the same results as
for any mingw target. The patch to gcc affects all mingw targets.
I am applying this patch as an obvious fix. I will check if gdb needs
update.


H.J.
---
bfd/

2008-02-04 Kai Tietz <***@onevision.com>
H.J. Lu <***@intel.com>

PR 5715
* warning.m4: Enable -Wno-format by default when using gcc on
mingw.
* configure: Regenerated.

binutils/

2008-02-04 H.J. Lu <***@intel.com>

PR 5715
* configure: Regenerated.

gas/

2008-02-04 H.J. Lu <***@intel.com>

PR 5715
* configure: Regenerated.

ld/

2008-02-04 H.J. Lu <***@intel.com>

PR 5715
* configure: Regenerated.

opcodes/

2008-02-04 H.J. Lu <***@intel.com>

PR 5715
* configure: Regenerated.

--- binutils/bfd/configure.ll 2008-02-04 11:26:25.000000000 -0800
+++ binutils/bfd/configure 2008-02-04 11:32:07.000000000 -0800
@@ -10609,6 +10609,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
--- binutils/bfd/warning.m4.ll 2007-11-28 17:21:45.000000000 -0800
+++ binutils/bfd/warning.m4 2008-02-04 11:32:00.000000000 -0800
@@ -11,6 +11,16 @@ AC_ARG_ENABLE(werror,
*) AC_MSG_ERROR(bad value ${enableval} for --enable-werror) ;;
esac])

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
--- binutils/binutils/configure.ll 2007-11-28 17:21:00.000000000 -0800
+++ binutils/binutils/configure 2008-02-04 11:32:22.000000000 -0800
@@ -10305,6 +10305,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
--- binutils/gas/configure.ll 2007-11-28 17:20:17.000000000 -0800
+++ binutils/gas/configure 2008-02-04 11:32:24.000000000 -0800
@@ -10325,6 +10325,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
--- binutils/ld/configure.ll 2007-11-28 17:18:17.000000000 -0800
+++ binutils/ld/configure 2008-02-04 11:32:10.000000000 -0800
@@ -3315,6 +3315,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
@@ -4718,13 +4728,13 @@ if test "${lt_cv_nm_interface+set}" = se
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
- (eval echo "\"\$as_me:4721: $ac_compile\"" >&5)
+ (eval echo "\"\$as_me:4731: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
- (eval echo "\"\$as_me:4724: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+ (eval echo "\"\$as_me:4734: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
- (eval echo "\"\$as_me:4727: output\"" >&5)
+ (eval echo "\"\$as_me:4737: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@@ -5779,7 +5789,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 5782 "configure"' > conftest.$ac_ext
+ echo '#line 5792 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -6879,11 +6889,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6882: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6892: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6886: \$? = $ac_status" >&5
+ echo "$as_me:6896: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7201,11 +7211,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7204: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7214: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7208: \$? = $ac_status" >&5
+ echo "$as_me:7218: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7306,11 +7316,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7309: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7319: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7313: \$? = $ac_status" >&5
+ echo "$as_me:7323: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -7361,11 +7371,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7364: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:7374: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:7368: \$? = $ac_status" >&5
+ echo "$as_me:7378: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10158,7 +10168,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10161 "configure"
+#line 10171 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
@@ -10258,7 +10268,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 10261 "configure"
+#line 10271 "configure"
#include "confdefs.h"

#if HAVE_DLFCN_H
--- binutils/opcodes/configure.ll 2008-02-04 11:24:39.000000000 -0800
+++ binutils/opcodes/configure 2008-02-04 11:32:14.000000000 -0800
@@ -10471,6 +10471,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
H.J. Lu
2008-02-04 19:58:31 UTC
Permalink
Post by H.J. Lu
I am applying this patch as an obvious fix. I will check if gdb needs
update.
H.J.
---
bfd/
PR 5715
* warning.m4: Enable -Wno-format by default when using gcc on
mingw.
* configure: Regenerated.
gdb is ok. I missed gprof. I am checking it in now.

H.J.
---
2008-02-04 H.J. Lu <***@intel.com>

PR 5715
* configure: Regenerated.

--- gprof/configure.ll 2007-10-26 09:49:55.000000000 -0700
+++ gprof/configure 2008-02-04 11:56:33.000000000 -0800
@@ -11222,6 +11222,16 @@ echo "$as_me: error: bad value ${enablev
esac
fi;

+# Enable -Wno-format by default when using gcc on mingw
+case "${host}" in
+ *-*-mingw32*)
+ if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
+ GCC_WARN_CFLAGS="$GCC_WARN_CFLAGS -Wno-format"
+ fi
+ ;;
+ *) ;;
+esac
+
# Enable -Werror by default when using gcc
if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" ; then
ERROR_ON_WARNING=yes
NightStrike
2008-02-05 03:36:01 UTC
Permalink
Post by Kai Tietz
Post by H.J. Lu
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.
Yes, because this feature is available until gcc 4.4 (AFAICS). If you
don't apply the patch file for gcc 4.3, you will have the same results as
for any mingw target. The patch to gcc affects all mingw targets.
If this is changed in binutils, will the change be reverted once gcc
4.4 is released?
Kai Tietz
2008-02-05 08:33:16 UTC
Permalink
Hi NightStrike,
Post by NightStrike
Post by Kai Tietz
Post by H.J. Lu
Do you want to use -Wno-format on 64bit mingw? I thought 64bit mingw
was OK. Otherwise, you will see the same error on 64bit mingw.
Yes, because this feature is available until gcc 4.4 (AFAICS). If you
don't apply the patch file for gcc 4.3, you will have the same results as
for any mingw target. The patch to gcc affects all mingw targets.
If this is changed in binutils, will the change be reverted once gcc
4.4 is released?
When gcc 4.4 includes this feature, than it is possible to check in
warning.m4 for gcc version and re-enable it for higher or equal gcc
version. We have to keep in mind, that the older gcc versions are still
supported.

Cheers,
Kai

| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.

Loading...