New submission from Ke Wang <ke.w...@sun.com>: Under Solaris, find_library can not give the correct path. Solaris does not have /sbin/ldconfig, so _findLib_gcc is used.
def _findLib_gcc(name): expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name) fdout, ccout = tempfile.mkstemp() os.close(fdout) cmd = 'if type gcc >/dev/null 2>&1; then CC=gcc; else CC=cc; fi;' \ '$CC -Wl,-t -o ' + ccout + ' 2>&1 -l' + name try: f = os.popen(cmd) trace = f.read() f.close() finally: try: os.unlink(ccout) except OSError, e: if e.errno != errno.ENOENT: raise res = re.search(expr, trace) if not res: return None return res.group(0) I executed these code manually, and after ‘trace = f.read()‘, I printed the content of 'trace', which was just as following: Undefined first referenced symbol in file main /usr/lib/crt1.o ld: fatal: symbol referencing errors. No output written to /tmp/tmpYN85Fm collect2: ld returned 1 exit status ---------- assignee: theller components: ctypes messages: 82303 nosy: kewang, theller severity: normal status: open title: ctypes.util.find_library does not work under Solaris type: behavior versions: Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5289> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com