Răsfoiți Sursa

Some versions of GCC were optimizing out the static ctor section. This patch
makes the ctor non-static so it is not optimized out.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@917 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake 20 ani în urmă
părinte
comite
96deb78110
10 a modificat fișierele cu 11 adăugiri și 11 ștergeri
  1. 2 1
      exec/amf.c
  2. 1 2
      exec/cfg.c
  3. 1 1
      exec/ckpt.c
  4. 1 1
      exec/clm.c
  5. 1 1
      exec/evs.c
  6. 1 1
      exec/evt.c
  7. 1 1
      exec/lck.c
  8. 1 1
      exec/msg.c
  9. 1 1
      lcr/libtest_a.c
  10. 1 1
      lcr/libtest_b.c

+ 2 - 1
exec/amf.c

@@ -434,11 +434,12 @@ struct openais_service_handler *amf_get_handler_ver0 (void)
 {
 	return (&amf_service_handler);
 }
+
 static void register_this_component (void) {
 	lcr_component_register (&amf_comp_ver0);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
 
 enum clc_command_run_operation_type {
 	CLC_COMMAND_RUN_OPERATION_TYPE_INSTANTIATE = 1,

+ 1 - 2
exec/cfg.c

@@ -178,11 +178,10 @@ struct openais_service_handler *cfg_get_handler_ver0 (void)
 	return (&cfg_service_handler);
 }
 static void register_this_component (void) {
-printf ("registering cfg component\n");
 	lcr_component_register (&cfg_comp_ver0);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __ctor_cfg_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
 
 /* IMPL */
 

+ 1 - 1
exec/ckpt.c

@@ -536,7 +536,7 @@ static void register_this_component (void) {
 	lcr_component_register (&ckpt_comp_ver0);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __ctor_ckpt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
 
 /*
  * All data types used for executive messages

+ 1 - 1
exec/clm.c

@@ -244,7 +244,7 @@ static void clm_comp_register (void) {
 	lcr_component_register (&clm_comp_ver0);
 }
 
-static void (*const __ctor_clm_comp[1]) (void) __attribute__ ((section(".ctors"))) = { clm_comp_register }; 
+void (*const __ctor_clm_comp[1]) (void) __attribute__ ((section(".ctors"))) = { clm_comp_register }; 
 
 struct req_exec_clm_nodejoin {
 	struct req_header header;

+ 1 - 1
exec/evs.c

@@ -197,7 +197,7 @@ static void evs_comp_register (void) {
 	lcr_component_register (&evs_comp_ver0);
 }
 
-static void (*const __ctor_evs_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evs_comp_register };
+void (*const __ctor_evs_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evs_comp_register };
 
 struct res_evs_confchg_callback res_evs_confchg_callback;
 

+ 1 - 1
exec/evt.c

@@ -262,7 +262,7 @@ static void evt_comp_register (void) {
 	lcr_component_register (&evt_comp_ver0);
 }
 
-static void (*const __ctor_evt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evt_comp_register };
+void (*const __ctor_evt_comp[1]) (void) __attribute__ ((section(".ctors"))) = { evt_comp_register };
 
 /* 
  * list of all retained events 

+ 1 - 1
exec/lck.c

@@ -336,7 +336,7 @@ static void register_this_component (void) {
 	lcr_component_register (&lck_comp_ver0);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __lck_ctor_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
 
 /*
  * All data types used for executive messages

+ 1 - 1
exec/msg.c

@@ -485,7 +485,7 @@ static void register_this_component (void) {
 	lcr_component_register (&msg_comp_ver0);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __ctor_msg_comp[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
 
 /*
  * All data types used for executive messages

+ 1 - 1
lcr/libtest_a.c

@@ -160,4 +160,4 @@ static void register_this_component (void) {
 	lcr_component_register (&test_comp);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __init_libtest_a[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };

+ 1 - 1
lcr/libtest_b.c

@@ -167,5 +167,5 @@ static void register_this_component (void)
 	lcr_component_register (&test_comp);
 }
 
-static void (*const __init_this_component[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };
+void (*const __init_libtest_b[1]) (void) __attribute__ ((section(".ctors"))) = { register_this_component };