openai / go-vncdriver

Fast VNC driver
MIT License
123 stars 60 forks source link

Fixed ld trace-symbol formatting issue #34

Open soraxas opened 5 years ago

soraxas commented 5 years ago

The build script is broken when I first tried to install universe. I realise there is a problem in this module's build script when I realise linker had some breaking changes to their output format.

The ld (GNU linker) formatting of the output ld -ljpeg --trace-symbol jpeg_CreateDecompress -e 0 has changed since this commit when they cleaned up the inconsistent output. The version introduced this changes is when in the ld version 2.30.51 -> 2.30.52.

Issue Description

Version 2.30.51 or before

The build.py is written based on the output format here before they changed it. The line

einfo (_("%pB: definition of %s\n"), abfd, name);

will outputs

/usr/lib/libjpeg.so: definition of jpeg_CreateDecompress

in shell, and hence the

libjpg = output.decode().split(':')[0]

in build.py is correct to get the /usr/lib/libjpeg.so in field 0.

Version 2.30.52 and after

But the newer version of ld has changed the format here, which is now using

einfo (_("%P: %pB: definition of %s\n"), abfd, name);

where the %P: refers to the program name. Hence, the output is now

ld: /usr/lib/libjpeg.so: definition of jpeg_CreateDecompress

which is essentially prefix by the linker program name. Therefore, we need to retrieve the correct info in field 1.

My PR involves of retrieving ld's version number and adjust the field index accordingly.