Closed Bug 767403 Opened 9 years ago Closed 9 years ago

Fix dependent libs generation on *BSD after bug 763893

Categories

(Firefox Build System :: General, defect)

x86
OpenBSD
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla16

People

(Reporter: gaston, Assigned: gaston)

References

Details

Attachments

(1 file, 2 obsolete files)

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.
Depends on: 763893
Actually it's a bit more complicated since splitext returns .0 as ext...
Attached patch also match libname on lib.*.so.* (obsolete) — Splinter Review
re.match on lib.*\.so\..* fixes the issue for me and probably netbsd/freebsd
Assignee: nobody → landry
Attachment #635884 - Flags: review?(mh+mozilla)
Attached patch also match libname on lib.*.so.* (obsolete) — Splinter Review
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-
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+
https://hg.mozilla.org/mozilla-central/rev/c7b0713958d6
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.