linux-gcc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] GCC 3.4.3: libobjc build failure
@ 2004-12-20 21:35 Denis Zaitsev
  2004-12-20 21:38 ` Andrew Pinski
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 21:35 UTC (permalink / raw)
  To: gcc, linux-gcc, gcc-patches; +Cc: Zack Weinberg

This patch is for exactly the same issue as described in

http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html

The fix is exactly the same, just another file is the target.  Without
it libobjc fails to build when --with-objc-gc is given to configure.

Please, apply it.


2004-12-21  Denis Zaitsev  <zzz@anda.ru>

	* libobjc/gc.c: Include coretypes.h and tm.h.


--- libobjc/gc.c.orig	2003-05-24 02:04:58.000000000 +0600
+++ libobjc/gc.c	2004-12-21 01:27:00.000000000 +0500
@@ -26,6 +26,8 @@ Boston, MA 02111-1307, USA.  */
    the executable file might be covered by the GNU General Public License.  */
 
 #include "tconfig.h"
+#include "coretypes.h"
+#include "tm.h"
 #include "objc.h"
 #include "encoding.h"
 

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:35 [PATCH] GCC 3.4.3: libobjc build failure Denis Zaitsev
@ 2004-12-20 21:38 ` Andrew Pinski
  2004-12-20 21:48   ` Denis Zaitsev
  2004-12-20 21:50   ` Zack Weinberg
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 21:38 UTC (permalink / raw)
  To: Denis Zaitsev; +Cc: gcc, linux-gcc, gcc-patches, Zack Weinberg


On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:

> This patch is for exactly the same issue as described in
>
> http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
>
> The fix is exactly the same, just another file is the target.  Without
> it libobjc fails to build when --with-objc-gc is given to configure.

This patch is incorrect as noted before.  I am going to reject it
as it was rejected before.  Again libobjc has no reason to include
these headers.

Thanks,
Andrew Pinski
libobjc maintainer


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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:38 ` Andrew Pinski
@ 2004-12-20 21:48   ` Denis Zaitsev
  2004-12-20 21:53     ` Andrew Pinski
  2004-12-20 21:50   ` Zack Weinberg
  1 sibling, 1 reply; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 21:48 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc, linux-gcc, gcc-patches, Zack Weinberg

On Mon, Dec 20, 2004 at 04:38:36PM -0500, Andrew Pinski wrote:
> 
> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
> 
> > This patch is for exactly the same issue as described in
> >
> > http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
> >
> > The fix is exactly the same, just another file is the target.  Without
> > it libobjc fails to build when --with-objc-gc is given to configure.
> 
> This patch is incorrect as noted before.  I am going to reject it
> as it was rejected before.  Again libobjc has no reason to include
> these headers.

a) The patches from the reference I've noted are already applied.

b) libobjc is not compiled without the new patch.  How should it be
   fixed then?

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:38 ` Andrew Pinski
  2004-12-20 21:48   ` Denis Zaitsev
@ 2004-12-20 21:50   ` Zack Weinberg
  1 sibling, 0 replies; 13+ messages in thread
From: Zack Weinberg @ 2004-12-20 21:50 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Denis Zaitsev, gcc, linux-gcc, gcc-patches

At Mon, 20 Dec 2004 16:38:36 -0500,
Andrew Pinski wrote:
> 
> 
> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
> 
> > This patch is for exactly the same issue as described in
> >
> > http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
> >
> > The fix is exactly the same, just another file is the target.  Without
> > it libobjc fails to build when --with-objc-gc is given to configure.
> 
> This patch is incorrect as noted before.  I am going to reject it
> as it was rejected before.  Again libobjc has no reason to include
> these headers.

The patch is the Wrong Thing in a formal sense.  However, it may be
the correct thing to do in the short term.  libobjc files have been
including coretypes.h and tm.h for a very long time; adding a few more
is not the end of the world, especially not on an old release branch!

zw

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:48   ` Denis Zaitsev
@ 2004-12-20 21:53     ` Andrew Pinski
  2004-12-20 22:03       ` Andrew Pinski
  2004-12-20 22:07       ` Denis Zaitsev
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 21:53 UTC (permalink / raw)
  To: Denis Zaitsev; +Cc: gcc, linux-gcc, gcc-patches, Zack Weinberg

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


On Dec 20, 2004, at 4:48 PM, Denis Zaitsev wrote:

> On Mon, Dec 20, 2004 at 04:38:36PM -0500, Andrew Pinski wrote:
>>
>> On Dec 20, 2004, at 4:35 PM, Denis Zaitsev wrote:
>>
>>> This patch is for exactly the same issue as described in
>>>
>>> http://gcc.gnu.org/ml/gcc/2002-12/msg00033.html
>>>
>>> The fix is exactly the same, just another file is the target.  
>>> Without
>>> it libobjc fails to build when --with-objc-gc is given to configure.
>>
>> This patch is incorrect as noted before.  I am going to reject it
>> as it was rejected before.  Again libobjc has no reason to include
>> these headers.
>
> a) The patches from the reference I've noted are already applied.
Yes and the patch was submitted before, see
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12035>.


> b) libobjc is not compiled without the new patch.  How should it be
>    fixed then?

The uses of the macros are not needed as shown by a "grep -r ."

Does this patch fix the problem for you?

Thanks,
Andrew Pinski


[-- Attachment #2: temp1.diff.txt --]
[-- Type: text/plain, Size: 779 bytes --]

Index: gc.c
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
retrieving revision 1.6
diff -u -p -r1.6 gc.c
--- gc.c	23 May 2003 20:04:58 -0000	1.6
+++ gc.c	20 Dec 2004 21:51:20 -0000
@@ -40,18 +40,6 @@ Boston, MA 02111-1307, USA.  */
 typedef GC_word word;
 typedef GC_signed_word signed_word;
 
-#if BITS_PER_WORD == 32
-# define LOGWL	5
-# define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word	    */
-#endif
-
-#if BITS_PER_WORD == 64
-# define LOGWL 6
-# define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word	    */
-#endif
-
-#define divWORDSZ(n) ((n) >> LOGWL)	   /* divide n by size of word      */
-
 #include <gc_typed.h>
 
 /* The following functions set up in `mask` the corresponding pointers.

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:53     ` Andrew Pinski
@ 2004-12-20 22:03       ` Andrew Pinski
  2004-12-20 22:26         ` Denis Zaitsev
  2004-12-20 22:07       ` Denis Zaitsev
  1 sibling, 1 reply; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 22:03 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: linux-gcc, gcc, Denis Zaitsev, gcc-patches, Zack Weinberg

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


On Dec 20, 2004, at 4:53 PM, Andrew Pinski wrote:
>
>> b) libobjc is not compiled without the new patch.  How should it be
>>    fixed then?
>
> The uses of the macros are not needed as shown by a "grep -r ."
>
> Does this patch fix the problem for you?

Actually that patch will not work, sorry about that.

This one is better and should work.


If it does not report the errors please as it will help to fix the
problem.

Thanks,
Andrew Pinski


[-- Attachment #2: temp1.diff.txt --]
[-- Type: text/plain, Size: 879 bytes --]

Index: gc.c
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
retrieving revision 1.6
diff -u -p -r1.6 gc.c
--- gc.c	23 May 2003 20:04:58 -0000	1.6
+++ gc.c	20 Dec 2004 22:01:27 -0000
@@ -35,22 +35,12 @@ Boston, MA 02111-1307, USA.  */
 #if OBJC_WITH_GC
 
 #include <gc.h>
+#include <limits.h>
 
 /* gc_typed.h uses the following but doesn't declare them */
 typedef GC_word word;
 typedef GC_signed_word signed_word;
-
-#if BITS_PER_WORD == 32
-# define LOGWL	5
-# define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word	    */
-#endif
-
-#if BITS_PER_WORD == 64
-# define LOGWL 6
-# define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word	    */
-#endif
-
-#define divWORDSZ(n) ((n) >> LOGWL)	   /* divide n by size of word      */
+#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
 
 #include <gc_typed.h>
 

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 21:53     ` Andrew Pinski
  2004-12-20 22:03       ` Andrew Pinski
@ 2004-12-20 22:07       ` Denis Zaitsev
  1 sibling, 0 replies; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 22:07 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc, linux-gcc, gcc-patches, Zack Weinberg

On Mon, Dec 20, 2004 at 04:53:52PM -0500, Andrew Pinski wrote:

> The uses of the macros are not needed as shown by a "grep -r ."
> 
> Does this patch fix the problem for you?
> 
> Thanks,
> Andrew Pinski
> 

> Index: gc.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 gc.c
> --- gc.c	23 May 2003 20:04:58 -0000	1.6
> +++ gc.c	20 Dec 2004 21:51:20 -0000
> @@ -40,18 +40,6 @@ Boston, MA 02111-1307, USA.  */
>  typedef GC_word word;
>  typedef GC_signed_word signed_word;
>  
> -#if BITS_PER_WORD == 32
> -# define LOGWL	5
> -# define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word	    */
> -#endif
> -
> -#if BITS_PER_WORD == 64
> -# define LOGWL 6
> -# define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word	    */
> -#endif
> -
> -#define divWORDSZ(n) ((n) >> LOGWL)	   /* divide n by size of word      */
> -
>  #include <gc_typed.h>
>  
>  /* The following functions set up in `mask` the corresponding pointers.

The problem is not really here, but there:

line 316 of gc.c:

  size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD;

So...  Why doesn't your grep show this?

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:03       ` Andrew Pinski
@ 2004-12-20 22:26         ` Denis Zaitsev
  2004-12-20 22:32           ` Andrew Pinski
  0 siblings, 1 reply; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 22:26 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: linux-gcc, gcc, gcc-patches, Zack Weinberg

On Mon, Dec 20, 2004 at 05:03:45PM -0500, Andrew Pinski wrote:
>
> This one is better and should work.
>
>
> If it does not report the errors please as it will help to fix the
> problem.

Yes, this patch seems to work, thanks.  But the compiler still
complains about undeclared atoi.  Maybe it worth something to include
<stdlib.h> somewhere?

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:26         ` Denis Zaitsev
@ 2004-12-20 22:32           ` Andrew Pinski
  2004-12-20 22:35             ` Andrew Pinski
  2004-12-20 22:46             ` Denis Zaitsev
  0 siblings, 2 replies; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 22:32 UTC (permalink / raw)
  To: Denis Zaitsev; +Cc: linux-gcc, gcc, gcc-patches, Zack Weinberg

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


On Dec 20, 2004, at 5:26 PM, Denis Zaitsev wrote:

> On Mon, Dec 20, 2004 at 05:03:45PM -0500, Andrew Pinski wrote:
>>
>> This one is better and should work.
>>
>>
>> If it does not report the errors please as it will help to fix the
>> problem.
>
> Yes, this patch seems to work, thanks.  But the compiler still
> complains about undeclared atoi.  Maybe it worth something to include
> <stdlib.h> somewhere?

Yes, this is what I applied to both the mainline and the 3.4 branch.

Thanks,
Andrew Pinski

ChangeLog:

	* gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ since
	they are not used.  Include limits.h and stdlib.h.


[-- Attachment #2: temp1.diff.txt --]
[-- Type: text/plain, Size: 946 bytes --]

Index: gc.c
===================================================================
RCS file: /cvs/gcc/gcc/libobjc/gc.c,v
retrieving revision 1.6
diff -u -p -r1.6 gc.c
--- gc.c	23 May 2003 20:04:58 -0000	1.6
+++ gc.c	20 Dec 2004 22:29:44 -0000
@@ -31,26 +31,17 @@ Boston, MA 02111-1307, USA.  */
 
 #include <assert.h>
 #include <string.h>
+#include <stdlib.h>
 
 #if OBJC_WITH_GC
 
 #include <gc.h>
+#include <limits.h>
 
 /* gc_typed.h uses the following but doesn't declare them */
 typedef GC_word word;
 typedef GC_signed_word signed_word;
-
-#if BITS_PER_WORD == 32
-# define LOGWL	5
-# define modWORDSZ(n) ((n) & 0x1f)        /* n mod size of word	    */
-#endif
-
-#if BITS_PER_WORD == 64
-# define LOGWL 6
-# define modWORDSZ(n) ((n) & 0x3f)        /* n mod size of word	    */
-#endif
-
-#define divWORDSZ(n) ((n) >> LOGWL)	   /* divide n by size of word      */
+#define BITS_PER_WORD (CHAR_BIT * sizeof (word))
 
 #include <gc_typed.h>
 

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:32           ` Andrew Pinski
@ 2004-12-20 22:35             ` Andrew Pinski
  2004-12-20 22:46             ` Denis Zaitsev
  1 sibling, 0 replies; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 22:35 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: linux-gcc, gcc, Denis Zaitsev, gcc-patches, Zack Weinberg


On Dec 20, 2004, at 5:32 PM, Andrew Pinski wrote:

> Yes, this is what I applied to both the mainline and the 3.4 branch.
>
> Thanks,
> Andrew Pinski
>
> ChangeLog:

But with this changelog as I had forgot to put something about
BITS_PER_WORD.

2004-12-20  Andrew Pinski  <pinskia@physics.uc.edu>

         PR libobjc/12035
         * gc.c: Remove definition of LOGWL, modWORDSZ, and divWORDSZ 
since
         they are not used.
         Include limits.h and stdlib.h.
         Define BITS_PER_WORD.

Thanks,
Andrew Pinski


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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:32           ` Andrew Pinski
  2004-12-20 22:35             ` Andrew Pinski
@ 2004-12-20 22:46             ` Denis Zaitsev
  2004-12-20 22:48               ` Andrew Pinski
  1 sibling, 1 reply; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 22:46 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: linux-gcc, gcc, gcc-patches, Zack Weinberg

On Mon, Dec 20, 2004 at 05:32:39PM -0500, Andrew Pinski wrote:
> 
> On Dec 20, 2004, at 5:26 PM, Denis Zaitsev wrote:
> 
> > On Mon, Dec 20, 2004 at 05:03:45PM -0500, Andrew Pinski wrote:
> >>
> >> This one is better and should work.
> >>
> >>
> >> If it does not report the errors please as it will help to fix the
> >> problem.
> >
> > Yes, this patch seems to work, thanks.  But the compiler still
> > complains about undeclared atoi.  Maybe it worth something to include
> > <stdlib.h> somewhere?
> 
> Yes, this is what I applied to both the mainline and the 3.4 branch.

Ok.  Does it means that something alike should be applied for the
files, which are including coretypes.h and tm.h for now?

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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:46             ` Denis Zaitsev
@ 2004-12-20 22:48               ` Andrew Pinski
  2004-12-20 23:14                 ` Denis Zaitsev
  0 siblings, 1 reply; 13+ messages in thread
From: Andrew Pinski @ 2004-12-20 22:48 UTC (permalink / raw)
  To: Denis Zaitsev; +Cc: linux-gcc, gcc, gcc-patches, Zack Weinberg


On Dec 20, 2004, at 5:46 PM, Denis Zaitsev wrote:

> Ok.  Does it means that something alike should be applied for the
> files, which are including coretypes.h and tm.h for now?

Those are more complex and will not be fixed until 4.1.

-- Pinski


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

* Re: [PATCH] GCC 3.4.3: libobjc build failure
  2004-12-20 22:48               ` Andrew Pinski
@ 2004-12-20 23:14                 ` Denis Zaitsev
  0 siblings, 0 replies; 13+ messages in thread
From: Denis Zaitsev @ 2004-12-20 23:14 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: linux-gcc, gcc, gcc-patches, Zack Weinberg

On Mon, Dec 20, 2004 at 05:48:17PM -0500, Andrew Pinski wrote:
> 
> On Dec 20, 2004, at 5:46 PM, Denis Zaitsev wrote:
> 
> > Ok.  Does it means that something alike should be applied for the
> > files, which are including coretypes.h and tm.h for now?
> 
> Those are more complex and will not be fixed until 4.1.

Ok.  Thanks.

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

end of thread, other threads:[~2004-12-20 23:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-20 21:35 [PATCH] GCC 3.4.3: libobjc build failure Denis Zaitsev
2004-12-20 21:38 ` Andrew Pinski
2004-12-20 21:48   ` Denis Zaitsev
2004-12-20 21:53     ` Andrew Pinski
2004-12-20 22:03       ` Andrew Pinski
2004-12-20 22:26         ` Denis Zaitsev
2004-12-20 22:32           ` Andrew Pinski
2004-12-20 22:35             ` Andrew Pinski
2004-12-20 22:46             ` Denis Zaitsev
2004-12-20 22:48               ` Andrew Pinski
2004-12-20 23:14                 ` Denis Zaitsev
2004-12-20 22:07       ` Denis Zaitsev
2004-12-20 21:50   ` Zack Weinberg

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 NNTP newsgroup(s).