This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.0.1 PATCH: Allow building shared libobjc on Solaris 2
Following up to myself:
> right, I hadn't noticed the other #ifdef __hpux__'s since in the Solaris
> case, it was sufficient to fix handle_class_ref. I'll remove the other two
> instances, re-bootstrap on all platforms and report results.
All results are unchanged with the new patch below.
Ok for branch now?
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Thu Jun 28 00:47:23 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* objc/objc-act.c (handle_class_ref): Always place decl in
variable section.
(handle_impent): Always place decl in readonly data section.
Fixes PRs libobjc/917, libobjc/3237, bootstrap/3251.
testsuite:
* lib/objc.exp (objc_target_compile): Declare rootme. Append to
ld_library_path.
===================================================================
RCS file: gcc/objc/RCS/objc-act.c,v
retrieving revision 1.1
diff -up -r1.1 gcc/objc/objc-act.c
--- gcc/objc/objc-act.c 2001/06/15 01:08:40 1.1
+++ gcc/objc/objc-act.c 2001/06/14 23:08:40
@@ -8362,13 +8362,8 @@ handle_class_ref (chain)
pushdecl (decl);
rest_of_decl_compilation (decl, 0, 0, 0);
-#ifdef __hpux__
/* Put the decl in the variable section. It may need relocation. */
variable_section (decl, 1);
-#else
- /* Make following constant read-only (why not)? */
- readonly_data_section ();
-#endif
exp = build1 (ADDR_EXPR, string_type_node, decl);
@@ -8421,9 +8416,7 @@ handle_impent (impent)
{
sprintf (string, "%sobjc_class_name_%s",
(flag_next_runtime ? "." : "__"), class_name);
-#ifdef __hpux__
readonly_data_section ();
-#endif
assemble_global (string);
assemble_label (string);
}
@@ -8458,9 +8451,7 @@ handle_impent (impent)
sprintf (string, "%sobjc_category_name_%s_%s",
(flag_next_runtime ? "." : "__"),
class_name, class_super_name);
-#ifdef __hpux__
readonly_data_section ();
-#endif
assemble_global (string);
assemble_label (string);
}
Index: gcc/testsuite/lib/objc.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/objc.exp,v
retrieving revision 1.5.6.4
diff -u -p -r1.5.6.4 objc.exp
--- objc.exp 2001/06/28 12:53:48 1.5.6.4
+++ objc.exp 2001/06/28 17:43:59
@@ -113,13 +113,14 @@ proc objc_init { args } {
}
proc objc_target_compile { source dest type options } {
+ global rootme;
global tmpdir;
global gluefile wrap_flags;
global OBJC_UNDER_TEST
global TOOL_OPTIONS
global ld_library_path
- set ld_library_path "."
+ set ld_library_path ".:${rootme}"
lappend options "libs=-lobjc"
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {