Hi all:<br><br>I am compiling the xorg-server-1.6.99.901, but I got a compiling error for below function.<br><br>The error message is:<em> <b>undefined reference to `dladdr</b></em><b>' </b><br><br>void xorg_backtrace(void)<br>
{<br> void *array[64];<br> char *mod;<br> int size, i;<br> Dl_info info;<br> ErrorF("\nBacktrace:\n");<br> size = backtrace(array, 64);<br> for (i = 0; i < size; i++) {<br> dladdr(array[i], &info);<br>
mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)";<br> if (info.dli_saddr)<br> ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod,<br> info.dli_sname, array[i] - info.dli_saddr, array[i]);<br>
else<br> ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod,<br> info.dli_fbase, array[i] - info.dli_fbase, array[i]);<br> }<br>}<br><br>So I have to temp fix this function with xorg-server-1.6.3 coding likes below:<br>
<br>void xorg_backtrace(void)<br>{<br> void *array[32]; /* deeper nesting than this means something's wrong */<br> size_t size, i;<br> char **strings;<br> ErrorF("\nBacktrace:\n");<br> size = backtrace(array, 32);<br>
strings = backtrace_symbols(array, size);<br> for (i = 0; i < size; i++)<br> ErrorF("%d: %s\n", i, strings[i]);<br> free(strings);<br>}<br><br>Did anyone know it's my config issue or it's the xorg-server-1.6.99.901 coding issue?<br>
<br>Thanks & Regards<br clear="all"><br>-- <br>Refer to: <a href="http://www.microsuncn.com">http://www.microsuncn.com</a><br><br>Best Regards<br><br>Alan Zheng<br>