The default bug view has changed. See this FAQ.

Fix dependent libs generation on *BSD after bug 763893

RESOLVED FIXED in mozilla16

Status

()

Core
Build Config
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: gaston, Assigned: gaston)

Tracking

Trunk
mozilla16
x86
OpenBSD
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

5 years ago
dependentlibs.py has the following snippet :

if ext == '.dll':
    func = dependentlibs_dumpbin
elif ext == '.so':
    func = dependentlibs_readelf
elif ext == '.dylib':
    func = dependentlibs_otool

This doesnt take into account all bsd platforms where configure.in sets DLL_SUFFIX to .so.1.0 (or to our controlled-versionning lib variable .so.${SO_VERSION} on OpenBSD), so this breaks with cryptic messages :

Traceback (most recent call last):
  File "/home/buildslave/mozilla-central-i386/build/xpcom/stub/dependentlibs.py", line 102, in <module>
    main()
  File "/home/buildslave/mozilla-central-i386/build/xpcom/stub/dependentlibs.py", line 99, in main
    print '\n'.join(dependentlibs(lib, options.libpaths, func))
UnboundLocalError: local variable 'func' referenced before assignment

I'd suggest matching elf platforms with elif ext[0:3] == '.so':, which i'm testing right now and will post a patch for if it works.
(Assignee)

Updated

5 years ago
Depends on: 763893
(Assignee)

Comment 1

5 years ago
Actually it's a bit more complicated since splitext returns .0 as ext...
(Assignee)

Comment 2

5 years ago
Created attachment 635884 [details] [diff] [review]
also match libname on lib.*.so.*

re.match on lib.*\.so\..* fixes the issue for me and probably netbsd/freebsd
Assignee: nobody → landry
Attachment #635884 - Flags: review?(mh+mozilla)
(Assignee)

Comment 3

5 years ago
Created attachment 636154 [details] [diff] [review]
also match libname on lib.*.so.*

New patch rebased after #767024
Attachment #635884 - Attachment is obsolete: true
Attachment #635884 - Flags: review?(mh+mozilla)
Attachment #636154 - Flags: review?(mh+mozilla)
Comment on attachment 636154 [details] [diff] [review]
also match libname on lib.*.so.*

Review of attachment 636154 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/stub/dependentlibs.py
@@ +94,5 @@
>      lib = args[0]
>      ext = os.path.splitext(lib)[1]
>      if ext == '.dll':
>          func = dependentlibs_dumpbin
> +    elif ext == '.so' or re.match('lib.*\.so\..*',lib):

Please use fnmatch.fnmatch instead.
Attachment #636154 - Flags: review?(mh+mozilla) → review-
(Assignee)

Comment 5

5 years ago
Created attachment 636817 [details] [diff] [review]
use fnmatch to match lib*.so.*

Sure, that also works and is nicer (my python fu is weak)
Attachment #636154 - Attachment is obsolete: true
Attachment #636817 - Flags: review?(mh+mozilla)
Comment on attachment 636817 [details] [diff] [review]
use fnmatch to match lib*.so.*

Review of attachment 636817 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/stub/dependentlibs.py
@@ +95,5 @@
>      lib = args[0]
>      ext = os.path.splitext(lib)[1]
>      if ext == '.dll':
>          func = dependentlibs_dumpbin
> +    elif ext == '.so' or fnmatch.fnmatch(lib,'lib*.so.*'):

Please add a whitespace after the comma.

I think you can lift the lib prefix and just use *.so.*
Attachment #636817 - Flags: review?(mh+mozilla) → review+
(Assignee)

Comment 7

5 years ago
Right, pushed it that way.

https://hg.mozilla.org/integration/mozilla-inbound/rev/c7b0713958d6
https://hg.mozilla.org/mozilla-central/rev/c7b0713958d6
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
You need to log in before you can comment on or make changes to this bug.