public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* libobjc
@ 1998-09-30  2:15 Jeffrey A Law
  0 siblings, 0 replies; 9+ messages in thread
From: Jeffrey A Law @ 1998-09-30  2:15 UTC (permalink / raw)
  To: egcs

It should be building again as a target library outside of the gcc subdir.

It's still a little rough around the edges, but we can iterate on it to clean
it up.

Ben -- thanks for taking the lead on this.  Getting libobjc moved out of the
gcc subdir is something we've needed for a long time.


jeff

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

* Re: libobjc
  1999-03-14 12:00         ` libobjc ovidiu
@ 1999-03-31 23:46           ` ovidiu
  0 siblings, 0 replies; 9+ messages in thread
From: ovidiu @ 1999-03-31 23:46 UTC (permalink / raw)
  To: Marcus G. Daniels; +Cc: law, egcs

On 13 Mar 1999 14:22:54 -0800, marcusd@cathcart.sysc.pdx.edu (Marcus G. 
Daniels) wrote:

> 
> Ok, I've taken the libobjc sources and put them in an automake package.
> Here's the first pass:
> 
>  ftp://ftp.santafe.edu/pub/gnu/libobjc-1.2.tar.gz
> 
> To make this work, I had to add a few more values to cc1obj's
> -print-objc-runtime-info option [patch below].  Missing is support for
> ADJUST_FIELD_ALIGN (for RS6000/AIX), and ROUND_TYPE_{ALIGN,SIZE} (for
> i960).  But from the absence of a replacement macro for TYPE_MODE in
> encoding.c, it looks to me like the AIX must have been broken.
> Perhaps the thing to do for these cases is to adapt the GCC
> macros into standalone routines...

Yes, I've taken a look at the target macros for AIX and I cannot see how
encoding.c compiles on AIX. Anyway, I think the correct definition for it would
be:

#define TYPE_MODE(TYPE) *TYPE

Regarding the ADJUST_FIELD_ALIGN and ROUND_TYPE_{ALIGN,SIZE} macros, these are
perhaps the most important ones in defining the memory layout of a structure.
The approach taken in encoding.c was to try avoiding writing a separate version
that could be included in a runtime library. Writing such a version would
require extensive knowledge from the compiler moved outside of it, which is not
quite easy. We would have to come up with data structures and an implementation
that works outside the compiler and basically duplicates those inside the
compiler.

One thing you can try is to pack as strings inside a C file the macros defined
at the top of encoding.c. In the same file you can also add automatically,
using a perl or shell/sed/awk script, the needed macro definitions from the
target file as strings. This C file could then be linked in the compiler and
the strings defined could be printed out when -print-objc-runtime-info is
passed to the compiler. Getting the appropriate definitions from the target
files could be made easy by adding some hooks as comments that could be easily
looked up by your script. I think this approach could solve your problem in a
pretty easy way.

Ovidiu



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

* Re: libobjc
  1999-03-11 23:08   ` libobjc Jeffrey A Law
  1999-03-13 14:22     ` libobjc Marcus G. Daniels
@ 1999-03-31 23:46     ` Jeffrey A Law
  1 sibling, 0 replies; 9+ messages in thread
From: Jeffrey A Law @ 1999-03-31 23:46 UTC (permalink / raw)
  To: mgd; +Cc: egcs

  In message < 199903120218.TAA21578@pojoaque.santafe.edu >you write:
  > 
  > With libobjc moved out of the compiler tree, it would be nice if it
  > could be built without references to the gcc sources.  To do this, it
  > appears that a couple macros would need to be compiled in libgcc:
  > BIGGEST_FIELD_ALIGNMENT and STRUCT_VALUE. 
Yes.  Absolutely.

  > The other referenced macros are constants and perhaps could be printed
  > by -print-objc-runtime-info.  They are STRUCTURE_SIZE_BOUNDARY,
  > PCC_BITFIELDS_TYPE_MATTERS, BITS_PER_UNIT and BITS_PER_WORD.
I don't think so.  Not without significant work.  Consider that
BITS_PER_WORD, STRUCTURE_SIZE_BOUNDARY, and other macros can vary
depending on compiler arguments.

Though it's also not clear that those things are correctly handled
for targets there BITS_PER_WORD and friends vary.

jeff

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

* libobjc
  1999-03-11 18:18 libobjc Marcus G. Daniels
       [not found] ` < 199903120218.TAA21578@pojoaque.santafe.edu >
@ 1999-03-31 23:46 ` Marcus G. Daniels
  1 sibling, 0 replies; 9+ messages in thread
From: Marcus G. Daniels @ 1999-03-31 23:46 UTC (permalink / raw)
  To: egcs

With libobjc moved out of the compiler tree, it would be nice if it
could be built without references to the gcc sources.  To do this, it
appears that a couple macros would need to be compiled in libgcc:
BIGGEST_FIELD_ALIGNMENT and STRUCT_VALUE. 

ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN, and ROUND_TYPE_SIZE, are also
used in libobjc.a, but these usages seem to be wrong to me -- they are
using Objective C type signatures as tree nodes -- I don't see how
this accomplishes anything.

The other referenced macros are constants and perhaps could be printed
by -print-objc-runtime-info.  They are STRUCTURE_SIZE_BOUNDARY,
PCC_BITFIELDS_TYPE_MATTERS, BITS_PER_UNIT and BITS_PER_WORD.


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

* Re: libobjc
  1999-03-13 14:22     ` libobjc Marcus G. Daniels
       [not found]       ` < rfig179hvwh.fsf@cathcart.sysc.pdx.edu >
@ 1999-03-31 23:46       ` Marcus G. Daniels
  1 sibling, 0 replies; 9+ messages in thread
From: Marcus G. Daniels @ 1999-03-31 23:46 UTC (permalink / raw)
  To: law; +Cc: egcs

Ok, I've taken the libobjc sources and put them in an automake package.
Here's the first pass:

 ftp://ftp.santafe.edu/pub/gnu/libobjc-1.2.tar.gz

To make this work, I had to add a few more values to cc1obj's
-print-objc-runtime-info option [patch below].  Missing is support for
ADJUST_FIELD_ALIGN (for RS6000/AIX), and ROUND_TYPE_{ALIGN,SIZE} (for
i960).  But from the absence of a replacement macro for TYPE_MODE in
encoding.c, it looks to me like the AIX must have been broken.
Perhaps the thing to do for these cases is to adapt the GCC
macros into standalone routines...

Index: objc-act.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/objc/objc-act.c,v
retrieving revision 1.25
diff -c -r1.25 objc-act.c
*** objc-act.c	1999/02/22 09:02:25	1.25
--- objc-act.c	1999/03/13 22:13:02
***************
*** 526,531 ****
--- 526,532 ----
     any compiling, instead we are to test some platform dependent
     features and output a C header file with appropriate definitions. */
  
+ static int print_target_configuration_values = 0;
  static int print_struct_values = 0;
  
  /* Some platforms pass small structures through registers versus through
***************
*** 587,594 ****
  	printf (", %d", aggregate_in_mem[j]);
        printf ("\n};\n");
      }
-  
-   exit (0);
  }
  
  #if USE_CPPLIB
--- 588,593 ----
***************
*** 657,664 ****
--- 656,687 ----
    if (doing_objc_thang)
      init_objc ();
  
+   if (print_target_configuration_values)
+     {
+ #ifdef STRUCTURE_SIZE_BOUNDARY
+       printf ("#define STRUCTURE_SIZE_BOUNDARY %u\n",
+               STRUCTURE_SIZE_BOUNDARY);
+ #endif
+ #ifdef BIGGEST_FIELD_ALIGNMENT
+       printf ("#define BIGGEST_FIELD_ALIGNMENT %u\n",
+               BIGGEST_FIELD_ALIGNMENT);
+ #endif
+ #ifdef PCC_BITFIELD_TYPE_MATTERS
+       printf ("#define PCC_BITFIELD_TYPE_MATTERS %u\n",
+               PCC_BITFIELD_TYPE_MATTERS);
+ #endif
+ #ifndef STRUCT_VALUE
+       printf ("#define INVISIBLE_STRUCT_RETURN 1\n");
+ #else
+       printf ("#define INVISIBLE_STRUCT_RETURN %u\n", (STRUCT_VALUE == 0));
+ #endif
+       printf ("#define BITS_PER_UNIT %u\n", BITS_PER_UNIT);
+       printf ("#define BITS_PER_WORD %u\n", BITS_PER_WORD);
+     }
    if (print_struct_values)
      generate_struct_by_value_array ();
+   if (print_struct_values || print_target_configuration_values)
+     exit (0);
  }
  
  static void
***************
*** 715,721 ****
    else if (!strcmp (p, "-fnext-runtime"))
      flag_next_runtime = 1;
    else if (!strcmp (p, "-print-objc-runtime-info"))
!     print_struct_values = 1;
    else
      return c_decode_option (argc, argv);
  
--- 738,747 ----
    else if (!strcmp (p, "-fnext-runtime"))
      flag_next_runtime = 1;
    else if (!strcmp (p, "-print-objc-runtime-info"))
!     {
!       print_target_configuration_values = 1;
!       print_struct_values = 1;
!     }
    else
      return c_decode_option (argc, argv);
  

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

* Re: libobjc
       [not found]       ` < rfig179hvwh.fsf@cathcart.sysc.pdx.edu >
@ 1999-03-14 12:00         ` ovidiu
  1999-03-31 23:46           ` libobjc ovidiu
  0 siblings, 1 reply; 9+ messages in thread
From: ovidiu @ 1999-03-14 12:00 UTC (permalink / raw)
  To: Marcus G. Daniels; +Cc: law, egcs

On 13 Mar 1999 14:22:54 -0800, marcusd@cathcart.sysc.pdx.edu (Marcus G. 
Daniels) wrote:

> 
> Ok, I've taken the libobjc sources and put them in an automake package.
> Here's the first pass:
> 
>  ftp://ftp.santafe.edu/pub/gnu/libobjc-1.2.tar.gz
> 
> To make this work, I had to add a few more values to cc1obj's
> -print-objc-runtime-info option [patch below].  Missing is support for
> ADJUST_FIELD_ALIGN (for RS6000/AIX), and ROUND_TYPE_{ALIGN,SIZE} (for
> i960).  But from the absence of a replacement macro for TYPE_MODE in
> encoding.c, it looks to me like the AIX must have been broken.
> Perhaps the thing to do for these cases is to adapt the GCC
> macros into standalone routines...

Yes, I've taken a look at the target macros for AIX and I cannot see how
encoding.c compiles on AIX. Anyway, I think the correct definition for it would
be:

#define TYPE_MODE(TYPE) *TYPE

Regarding the ADJUST_FIELD_ALIGN and ROUND_TYPE_{ALIGN,SIZE} macros, these are
perhaps the most important ones in defining the memory layout of a structure.
The approach taken in encoding.c was to try avoiding writing a separate version
that could be included in a runtime library. Writing such a version would
require extensive knowledge from the compiler moved outside of it, which is not
quite easy. We would have to come up with data structures and an implementation
that works outside the compiler and basically duplicates those inside the
compiler.

One thing you can try is to pack as strings inside a C file the macros defined
at the top of encoding.c. In the same file you can also add automatically,
using a perl or shell/sed/awk script, the needed macro definitions from the
target file as strings. This C file could then be linked in the compiler and
the strings defined could be printed out when -print-objc-runtime-info is
passed to the compiler. Getting the appropriate definitions from the target
files could be made easy by adding some hooks as comments that could be easily
looked up by your script. I think this approach could solve your problem in a
pretty easy way.

Ovidiu


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

* Re: libobjc
  1999-03-11 23:08   ` libobjc Jeffrey A Law
@ 1999-03-13 14:22     ` Marcus G. Daniels
       [not found]       ` < rfig179hvwh.fsf@cathcart.sysc.pdx.edu >
  1999-03-31 23:46       ` libobjc Marcus G. Daniels
  1999-03-31 23:46     ` libobjc Jeffrey A Law
  1 sibling, 2 replies; 9+ messages in thread
From: Marcus G. Daniels @ 1999-03-13 14:22 UTC (permalink / raw)
  To: law; +Cc: egcs

Ok, I've taken the libobjc sources and put them in an automake package.
Here's the first pass:

 ftp://ftp.santafe.edu/pub/gnu/libobjc-1.2.tar.gz

To make this work, I had to add a few more values to cc1obj's
-print-objc-runtime-info option [patch below].  Missing is support for
ADJUST_FIELD_ALIGN (for RS6000/AIX), and ROUND_TYPE_{ALIGN,SIZE} (for
i960).  But from the absence of a replacement macro for TYPE_MODE in
encoding.c, it looks to me like the AIX must have been broken.
Perhaps the thing to do for these cases is to adapt the GCC
macros into standalone routines...

Index: objc-act.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/objc/objc-act.c,v
retrieving revision 1.25
diff -c -r1.25 objc-act.c
*** objc-act.c	1999/02/22 09:02:25	1.25
--- objc-act.c	1999/03/13 22:13:02
***************
*** 526,531 ****
--- 526,532 ----
     any compiling, instead we are to test some platform dependent
     features and output a C header file with appropriate definitions. */
  
+ static int print_target_configuration_values = 0;
  static int print_struct_values = 0;
  
  /* Some platforms pass small structures through registers versus through
***************
*** 587,594 ****
  	printf (", %d", aggregate_in_mem[j]);
        printf ("\n};\n");
      }
-  
-   exit (0);
  }
  
  #if USE_CPPLIB
--- 588,593 ----
***************
*** 657,664 ****
--- 656,687 ----
    if (doing_objc_thang)
      init_objc ();
  
+   if (print_target_configuration_values)
+     {
+ #ifdef STRUCTURE_SIZE_BOUNDARY
+       printf ("#define STRUCTURE_SIZE_BOUNDARY %u\n",
+               STRUCTURE_SIZE_BOUNDARY);
+ #endif
+ #ifdef BIGGEST_FIELD_ALIGNMENT
+       printf ("#define BIGGEST_FIELD_ALIGNMENT %u\n",
+               BIGGEST_FIELD_ALIGNMENT);
+ #endif
+ #ifdef PCC_BITFIELD_TYPE_MATTERS
+       printf ("#define PCC_BITFIELD_TYPE_MATTERS %u\n",
+               PCC_BITFIELD_TYPE_MATTERS);
+ #endif
+ #ifndef STRUCT_VALUE
+       printf ("#define INVISIBLE_STRUCT_RETURN 1\n");
+ #else
+       printf ("#define INVISIBLE_STRUCT_RETURN %u\n", (STRUCT_VALUE == 0));
+ #endif
+       printf ("#define BITS_PER_UNIT %u\n", BITS_PER_UNIT);
+       printf ("#define BITS_PER_WORD %u\n", BITS_PER_WORD);
+     }
    if (print_struct_values)
      generate_struct_by_value_array ();
+   if (print_struct_values || print_target_configuration_values)
+     exit (0);
  }
  
  static void
***************
*** 715,721 ****
    else if (!strcmp (p, "-fnext-runtime"))
      flag_next_runtime = 1;
    else if (!strcmp (p, "-print-objc-runtime-info"))
!     print_struct_values = 1;
    else
      return c_decode_option (argc, argv);
  
--- 738,747 ----
    else if (!strcmp (p, "-fnext-runtime"))
      flag_next_runtime = 1;
    else if (!strcmp (p, "-print-objc-runtime-info"))
!     {
!       print_target_configuration_values = 1;
!       print_struct_values = 1;
!     }
    else
      return c_decode_option (argc, argv);
  

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

* Re: libobjc
       [not found] ` < 199903120218.TAA21578@pojoaque.santafe.edu >
@ 1999-03-11 23:08   ` Jeffrey A Law
  1999-03-13 14:22     ` libobjc Marcus G. Daniels
  1999-03-31 23:46     ` libobjc Jeffrey A Law
  0 siblings, 2 replies; 9+ messages in thread
From: Jeffrey A Law @ 1999-03-11 23:08 UTC (permalink / raw)
  To: mgd; +Cc: egcs

  In message < 199903120218.TAA21578@pojoaque.santafe.edu >you write:
  > 
  > With libobjc moved out of the compiler tree, it would be nice if it
  > could be built without references to the gcc sources.  To do this, it
  > appears that a couple macros would need to be compiled in libgcc:
  > BIGGEST_FIELD_ALIGNMENT and STRUCT_VALUE. 
Yes.  Absolutely.

  > The other referenced macros are constants and perhaps could be printed
  > by -print-objc-runtime-info.  They are STRUCTURE_SIZE_BOUNDARY,
  > PCC_BITFIELDS_TYPE_MATTERS, BITS_PER_UNIT and BITS_PER_WORD.
I don't think so.  Not without significant work.  Consider that
BITS_PER_WORD, STRUCTURE_SIZE_BOUNDARY, and other macros can vary
depending on compiler arguments.

Though it's also not clear that those things are correctly handled
for targets there BITS_PER_WORD and friends vary.

jeff

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

* libobjc
@ 1999-03-11 18:18 Marcus G. Daniels
       [not found] ` < 199903120218.TAA21578@pojoaque.santafe.edu >
  1999-03-31 23:46 ` libobjc Marcus G. Daniels
  0 siblings, 2 replies; 9+ messages in thread
From: Marcus G. Daniels @ 1999-03-11 18:18 UTC (permalink / raw)
  To: egcs

With libobjc moved out of the compiler tree, it would be nice if it
could be built without references to the gcc sources.  To do this, it
appears that a couple macros would need to be compiled in libgcc:
BIGGEST_FIELD_ALIGNMENT and STRUCT_VALUE. 

ADJUST_FIELD_ALIGN, ROUND_TYPE_ALIGN, and ROUND_TYPE_SIZE, are also
used in libobjc.a, but these usages seem to be wrong to me -- they are
using Objective C type signatures as tree nodes -- I don't see how
this accomplishes anything.

The other referenced macros are constants and perhaps could be printed
by -print-objc-runtime-info.  They are STRUCTURE_SIZE_BOUNDARY,
PCC_BITFIELDS_TYPE_MATTERS, BITS_PER_UNIT and BITS_PER_WORD.

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

end of thread, other threads:[~1999-03-31 23:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-09-30  2:15 libobjc Jeffrey A Law
1999-03-11 18:18 libobjc Marcus G. Daniels
     [not found] ` < 199903120218.TAA21578@pojoaque.santafe.edu >
1999-03-11 23:08   ` libobjc Jeffrey A Law
1999-03-13 14:22     ` libobjc Marcus G. Daniels
     [not found]       ` < rfig179hvwh.fsf@cathcart.sysc.pdx.edu >
1999-03-14 12:00         ` libobjc ovidiu
1999-03-31 23:46           ` libobjc ovidiu
1999-03-31 23:46       ` libobjc Marcus G. Daniels
1999-03-31 23:46     ` libobjc Jeffrey A Law
1999-03-31 23:46 ` libobjc Marcus G. Daniels

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).