Skip to content

Fixed ld trace-symbol formatting issue#34

Open
soraxas wants to merge 1 commit intoopenai:masterfrom
soraxas:master
Open

Fixed ld trace-symbol formatting issue#34
soraxas wants to merge 1 commit intoopenai:masterfrom
soraxas:master

Conversation

@soraxas
Copy link

@soraxas soraxas commented Oct 3, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant