In libc, execute vcore_event_init before ctors
authorAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 8 Jan 2013 19:57:55 +0000 (11:57 -0800)
committerAndrew Waterman <waterman@cs.berkeley.edu>
Tue, 8 Jan 2013 19:57:55 +0000 (11:57 -0800)
Otherwise, ctors can't spawn uthreads.

tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/start.c

index b4a4212..19ab23c 100644 (file)
@@ -37,8 +37,10 @@ weak_alias(__vcore_event_init, vcore_event_init)
 
 void __ros_libc_csu_init(int argc, char **argv, char **envp)
 {
-       __libc_csu_init(argc, argv, envp);
        vcore_event_init();
+       // Note that we want the ctors to be called after vcore_event_init.
+       // (They are invoked by the next line.)
+       __libc_csu_init(argc, argv, envp);
 }
 
 void