[pulseaudio-commits] r1840 - /branches/lennart/src/daemon/main.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Sep 17 06:32:47 PDT 2007


Author: lennart
Date: Mon Sep 17 15:32:46 2007
New Revision: 1840

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1840&root=pulseaudio&view=rev
Log:
on Linu disable lazy binding altogether

Modified:
    branches/lennart/src/daemon/main.c

Modified: branches/lennart/src/daemon/main.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/daemon/main.c?rev=1840&root=pulseaudio&r1=1839&r2=1840&view=diff
==============================================================================
--- branches/lennart/src/daemon/main.c (original)
+++ branches/lennart/src/daemon/main.c Mon Sep 17 15:32:46 2007
@@ -315,7 +315,6 @@
     pa_strbuf *buf = NULL;
     pa_daemon_conf *conf = NULL;
     pa_mainloop *mainloop = NULL;
-
     char *s;
     int r = 0, retval = 1, d = 0;
     int daemon_pipe[2] = { -1, -1 };
@@ -329,6 +328,23 @@
     struct timeval tv;
 #endif
 
+    
+#if defined(__linux__) && defined(__OPTIMIZE__)
+    /*
+       Disable lazy relocations to make usage of external libraries
+       more deterministic for our RT threads. We abuse __OPTIMIZE__ as
+       a check whether we are a debug build or not.
+    */
+
+    if (!getenv("LD_BIND_NOW")) {
+        putenv(pa_xstrdup("LD_BIND_NOW=1"));
+
+        /* We have to execute ourselves, because the libc caches the
+         * value of $LD_BIND_NOW on initialization. */
+        pa_assert_se(execv("/proc/self/exe", argv) == 0);
+    }
+#endif
+    
 #ifdef HAVE_GETUID
     real_root = getuid() == 0;
     suid_root = !real_root && geteuid() == 0;




More information about the pulseaudio-commits mailing list