bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

gtk3 build fails --with-system-nspr --with-system-nss: /usr/bin/ld: error: cannot find -lmozgtk_stub

RESOLVED FIXED

Status

Firefox Build System
General
RESOLVED FIXED
4 years ago
5 months ago

People

(Reporter: Jan Beich, Unassigned)

Tracking

33 Branch
All
FreeBSD

Firefox Tracking Flags

(firefox33 affected, firefox34 fixed, firefox35 fixed, firefox-esr31 unaffected)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 8496582 [details] [diff] [review]
workaround

It seems when building against internal NSS/NSPR the LDFLAGS for libxul.so contain -L$(DIST)/lib which provide the path for mozgtk_stub. So, when building against system versions the library searchpath isn't there and the following error occurs.

$ cat .mozconfig
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --with-system-icu

ac_add_options --enable-default-toolkit=cairo-gtk3

# shave build time
ac_add_options --disable-webrtc
ac_add_options --disable-tests
ac_add_options --enable-strip
ac_add_options --disable-debug-symbols

$ gmake -f client.mk build
...
gmake[2]: Entering directory 'toolkit/library/build'
libxul.so
rm -f libxul.so
_virtualenv/bin/python config/expandlibs_exec.py --depend .deps/libxul.so.pp --target libxul.so --uselist --  c++ -Qunused-arguments   -I/usr/local/include -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pipe  -DNDEBUG -DTRIMMED -O -fomit-frame-pointer -fPIC -shared -Wl,-h,libxul.so -o libxul.so     -pthread  -Wl,-z,noexecstack -Wl,-z,text -B build/unix/gold   -Wl,-rpath-link,dist/bin -Wl,-rpath-link,/usr/local/lib   ../../../toolkit/library/libxul.a dist/lib/libjs_static.a -licui18n -L/usr/local/lib -licuuc -licudata   -L/usr/local/lib/nss -lssl3 -lsmime3 -lnss3 -lnssutil3 -lcrmf -L/usr/local/lib -lcairo -pthread    -L/usr/local/lib -lcairo -pthread -lXext -lXrender -L/usr/local/lib -lX11     ../../../dist/lib/libmozsqlite3.a  modules/zlib/src/libmozz.a -L/usr/local/lib -lpixman-1   ../../../layout/media/libgkmedias.a -L/usr/local/lib -lasound    -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread ../../../dist/lib/libmozalloc.a -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -pthread -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl -lmozgtk_stub -L/usr/local/lib -lX11  -lXext  -lpangoft2-1.0 -lfontconfig -lfreetype -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -L/usr/local/lib -lcairo -pthread   -lXt -lgthread-2.0 -L/usr/local/lib -lfreetype   -lfontconfig -L/usr/local/lib -lfreetype   ../../../toolkit/library/StaticXULComponentsEnd/libStaticXULComponentsEnd.a   -lutil
Executing: c++ -Qunused-arguments -I/usr/local/include -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-inline-new-delete -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -O -fomit-frame-pointer -fPIC -shared -Wl,-h,libxul.so -o libxul.so -pthread -Wl,-z,noexecstack -Wl,-z,text -B ../../../build/unix/gold -Wl,-rpath-link,dist/bin -Wl,-rpath-link,/usr/local/lib toolkit/library/build/tmp3jPpTO.list ../../../xpcom/typelib/xpt/libxpt.a ../../../intl/unicharutil/util/internal/libintl_unicharutil_util_internal.a ../../../dist/lib/libjs_static.a -licui18n -L/usr/local/lib -licuuc -licudata -L/usr/local/lib/nss -lssl3 -lsmime3 -lnss3 -lnssutil3 -lcrmf -L/usr/local/lib -lcairo -pthread -L/usr/local/lib -lcairo -pthread -lXext -lXrender -L/usr/local/lib -lX11 ../../../dist/lib/libmozsqlite3.so -L/usr/local/lib -lpixman-1 -L/usr/local/lib -lasound -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread ../../../dist/lib/libmozalloc.so -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -pthread -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -L/usr/local/lib -lglib-2.0 -lintl -lmozgtk_stub -L/usr/local/lib -lX11 -lXext -lpangoft2-1.0 -lfontconfig -lfreetype -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -L/usr/local/lib -lcairo -pthread -lXt -lgthread-2.0 -L/usr/local/lib -lfreetype -lfontconfig -L/usr/local/lib -lfreetype -lutil
toolkit/library/build/tmp3jPpTO.list:
[...]
../../../build/unix/gold/ld: error: cannot find -lmozgtk_stub
c++: error: linker command failed with exit code 1 (use -v to see invocation)
config/rules.mk:872: recipe for target 'libxul.so' failed
gmake[2]: *** [libxul.so] Error 1
I don't remember what bug fixed this, but it's fixed in 34. We're not going to backport a fix to 33. Gtk+3 builds are not in a state where they should be massively used anyways. If you want to test Gtk+3 builds, you should do that on mozilla-central.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
status-firefox34: --- → fixed
status-firefox35: unaffected → fixed
Resolution: --- → FIXED

Updated

5 months ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.