Last Comment Bug 673681 - libxul linking error with --enable-system-ffi and static js lib
: libxul linking error with --enable-system-ffi and static js lib
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: Trunk
: All Other
: -- normal (vote)
: mozilla8
Assigned To: Mike Hommey [:glandium]
:
Mentors:
Depends on:
Blocks: 551138
  Show dependency treegraph
 
Reported: 2011-07-23 03:16 PDT by ojab
Modified: 2011-08-26 22:07 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Add --enable-system-ffi switch for xulrunner/firefox (1.83 KB, text/plain)
2011-07-23 03:16 PDT, ojab
no flags Details
Add --enable-system-ffi switch for xulrunner/firefox (1.86 KB, patch)
2011-07-23 04:57 PDT, ojab
no flags Details | Diff | Review
Add --enable-system-ffi switch for xulrunner/firefox (1.86 KB, patch)
2011-07-23 05:43 PDT, ojab
no flags Details | Diff | Review
Properly support --enable-system-ffi with static js (2.04 KB, patch)
2011-07-24 06:16 PDT, Mike Hommey [:glandium]
ted: review+
Details | Diff | Review

Description ojab 2011-07-23 03:16:59 PDT
Created attachment 547913 [details]
Add --enable-system-ffi switch for xulrunner/firefox

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0a1) Gecko/20110723 Firefox/8.0a1
Build ID: 20110723130330

Steps to reproduce:

After bug 551138 it's possible to build mozjs against system libffi, but -lffi isn't added on libxul linking stage.
Comment 1 ojab 2011-07-23 04:00:30 PDT
Shortened libxul linking output:

rm -f libxul.so
/usr/bin/python2.7 /sources/mozilla-central/config/pythonpath.py -I../../config … -lXt -lgthread-2.0 -lfreetype -lz -ldl  -lrt
../../dist/lib/libjs_static.a(CTypes.o): In function `Finalize':
/sources/mozilla-central/js/src/ctypes/CTypes.cpp:5314: undefined reference to `ffi_closure_free'
../../dist/lib/libjs_static.a(CTypes.o): In function `CreateInternal':
/sources/mozilla-central/js/src/ctypes/CTypes.cpp:3239: undefined reference to `ffi_type_pointer'
../../dist/lib/libjs_static.a(CTypes.o): In function `js::ctypes::InitTypeClasses(JSContext*, JSObject*)':
/sources/mozilla-central/js/src/ctypes/typedefs.h:104: undefined reference to `ffi_type_uint8'
/sources/mozilla-central/js/src/ctypes/typedefs.h:105: undefined reference to `ffi_type_sint8'
…
Comment 2 ojab 2011-07-23 04:56:12 PDT
And it happens only with static js library.
Comment 3 ojab 2011-07-23 04:57:55 PDT
Created attachment 547920 [details] [diff] [review]
Add --enable-system-ffi switch for xulrunner/firefox

Add -lffi only in static js lib case.
Comment 4 ojab 2011-07-23 05:43:20 PDT
Created attachment 547923 [details] [diff] [review]
Add --enable-system-ffi switch for xulrunner/firefox

MOZ_STATIC_JS isn't defined, actually ._.
Use "ifndef JS_SHARED_LIBRARY" instead.
Comment 5 Mike Hommey [:glandium] 2011-07-24 06:16:30 PDT
Created attachment 548000 [details] [diff] [review]
Properly support --enable-system-ffi with static js

I think this would be better this way
Comment 6 Ted Mielczarek [:ted.mielczarek] 2011-07-25 07:53:02 PDT
Comment on attachment 548000 [details] [diff] [review]
Properly support --enable-system-ffi with static js

Review of attachment 548000 [details] [diff] [review]:
-----------------------------------------------------------------
Comment 8 :Ehsan Akhgari (out sick) 2011-07-26 11:06:35 PDT
http://hg.mozilla.org/mozilla-central/rev/767b0b274561

Note You need to log in before you can comment on or make changes to this bug.