public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [patch] Fix compilation on the recent glibc CVS snapshot
@ 2007-08-08 19:19 Jan Kratochvil
  2007-08-09 12:46 ` Alan Modra
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kratochvil @ 2007-08-08 19:19 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1549 bytes --]

Hi,

recent glibc change:

2007-05-24  Ulrich Drepper  <drepper@redhat.com>

	* io/fcntl.h: When compiling with fortification, include bits/fcntl2.h.
	* io/bits/fcntl2.h: New file.

started to sanity check the parameters of the open(2) syscall by providing

	#define open(fname, flags, ...)

which errors out the BFD CVS snapshot compilation by:

	libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.././bfd -I. -I. -I.././bfd -I.././bfd/../include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -O2 -m64 -ggdb2 -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -c opncls.c -o opncls.o
	opncls.c: In function 'bfd_openr_iovec':
	opncls.c:548: error: invalid operands to binary &
	opncls.c:548: error: invalid operands to binary &
	opncls.c:548: error: invalid operands to binary &
	cc1: warnings being treated as errors
	opncls.c:548: warning: assignment makes integer from pointer without a cast
	opncls.c:548: warning: passing argument 1 of '__open_2' from incompatible pointer type
	opncls.c:548: warning: passing argument 2 of '__open_2' makes integer from pointer without a cast
	opncls.c:548: error: too many arguments to function 'open'
	opncls.c:548: warning: assignment makes integer from pointer without a cast
	opncls.c:548: warning: assignment makes pointer from integer without a cast
	make[4]: *** [opncls.lo] Error 1
	make[4]: Leaving directory `/root/redhat/sources/bfd'

GCC needs these options to make the problem reproducible:
	-O -pedantic -Wp,-D_FORTIFY_SOURCE=2 



Regards,
Jan

[-- Attachment #2: bfd-open-fcntl2.patch --]
[-- Type: text/plain, Size: 568 bytes --]

2007-08-08  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* bfd/opncls.c (bfd_openr_iovec): Fix OPEN parameter macro expansion.

--- bfd/opncls.c	24 Jul 2007 19:58:06 -0000	1.48
+++ bfd/opncls.c	8 Aug 2007 19:12:15 -0000
@@ -545,7 +545,8 @@ bfd_openr_iovec (const char *filename, c
   nbfd->filename = filename;
   nbfd->direction = read_direction;
 
-  stream = open (nbfd, open_closure);
+  /* `open (...)' would get expanded by an the open(2) syscall macro.  */
+  stream = (*open) (nbfd, open_closure);
   if (stream == NULL)
     {
       _bfd_delete_bfd (nbfd);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] Fix compilation on the recent glibc CVS snapshot
  2007-08-08 19:19 [patch] Fix compilation on the recent glibc CVS snapshot Jan Kratochvil
@ 2007-08-09 12:46 ` Alan Modra
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Modra @ 2007-08-09 12:46 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: binutils

On Wed, Aug 08, 2007 at 09:18:44PM +0200, Jan Kratochvil wrote:
> 	* bfd/opncls.c (bfd_openr_iovec): Fix OPEN parameter macro expansion.

OK.

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-09 12:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-08 19:19 [patch] Fix compilation on the recent glibc CVS snapshot Jan Kratochvil
2007-08-09 12:46 ` Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).