This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kewang
Recipients kewang, theller
Date 2009-02-17.08:17:12
SpamBayes Score 0.0009177067
Marked as misclassified No
Message-id <1234858635.81.0.426092533899.issue5289@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2009-02-17 08:17:15kewangsetrecipients: + kewang, theller
2009-02-17 08:17:15kewangsetmessageid: <1234858635.81.0.426092533899.issue5289@psf.upfronthosting.co.za>
2009-02-17 08:17:14kewanglinkissue5289 messages
2009-02-17 08:17:12kewangcreate