Closed Bug 373535 Opened 14 years ago Closed 14 years ago

firefox-on-top-of-xulrunner browser does't find libmozcairo on linux

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla3 alpha7

People

(Reporter: wuno, Assigned: wuno)

References

Details

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9a3pre) Gecko/20070310 Minefield/3.0a3pre
Build Identifier: 

unlike windows in linux builds the browser component is finally linked against libmozcairo.
http://lxr.mozilla.org/seamonkey/source/browser/components/build/Makefile.in#88

Since the checkin for bug 78081 the build finally breaks in the broswser component as libmozcairo isn't found in the browser subtree as it resides in the xulrunner subtree.
A solution for a comparable problem was found in Bug 333874.
Patch is coming up

Reproducible: Always

Steps to Reproduce:
1.
2.
3.


Expected Results:  
browser in a ff on xr build on linux should find libmozcairo to link against it
I tested this patch also with a "conventional" ff and tb build, they build as well
Comment on attachment 258199 [details] [diff] [review]
exchange $(DEPTH) with $(LIBXUL_DIST)/../ in configure.in for the libmozairo location

benjamin, if you think its the correct patch, could you please check it in? thanks
Attachment #258199 - Flags: review?(benjamin)
Comment on attachment 258199 [details] [diff] [review]
exchange $(DEPTH) with $(LIBXUL_DIST)/../ in configure.in for the libmozairo location

1) I don't see the code you mention at http://lxr.mozilla.org/mozilla/source/browser/components/build/Makefile.in

2) non-xulrunner code should not be linking against cairo under any circumstances.
Attachment #258199 - Flags: review?(benjamin) → review-
(In reply to comment #3)
> (From update of attachment 258199 [details] [diff] [review])
> 1) I don't see the code you mention at
> http://lxr.mozilla.org/mozilla/source/browser/components/build/Makefile.in
> 
> 2) non-xulrunner code should not be linking against cairo under any
> circumstances.
> 
(In reply to comment #3)
> (From update of attachment 258199 [details] [diff] [review])
> 1) I don't see the code you mention at
> http://lxr.mozilla.org/mozilla/source/browser/components/build/Makefile.in

Sorry, its not line #88, but line #90
> 
> 2) non-xulrunner code should not be linking against cairo under any
> circumstances.
> 
Last lines in browser/components/build/Makefile.in
# Mac: Need to link with CoreFoundation for Mac Migrators (PList reading code)
# GTK2: Need to link with glib for GNOME shell service
ifneq (,$(filter mac cocoa gtk2,$(MOZ_WIDGET_TOOLKIT)))
EXTRA_DSO_LDOPTS += \
  $(TK_LIBS) \
  $(NULL)
endif

include $(topsrcdir)/config/rules.mk

$(TK_LIBS) in cairo-gtk2 builds is defined in configure.in
http://lxr.mozilla.org/seamonkey/source/configure.in#4663
as TK_LIBS='$(MOZ_GTK2_LIBS) $(MOZ_CAIRO_LIBS)'
(for other cairo-platform builds its $(MOZ_CAIRO_LIBS) alone, but these are not concerned here)

Therefore, we pull MOZ_CAIRO_LIBS in cairo-gtk2 builds (but not in windows)
If that's wrong at that point we should probably separate gtk2 from mac
in this particular situation

I don't know why TK_LIBS contains cairo. My impression was that TK_LIBS was for OS libraries needed by the graphics system. vlad, do you remember why you added cairo to TK_LIBS?

In any case, I'm pretty sure we shouldn't be using TK_LIBS in browser/components/builds. Instead, use MOZ_GTK2_LIBS. And for cocoa, we should link against the specific libs we need, which is probably -framework CoreFoundation
Status: UNCONFIRMED → NEW
Ever confirmed: true
Product: Core → Firefox
QA Contact: build-config → build.config
oop, pav != vlad
Both, ff on top of xr and conventional ff build successfully when I remove MOZ_CAIRO_LIBS and MOZ_CAIRO_CFLAGS from TK_LIBS and TK_CFLAGS in configure.in at the lines mentioned. However, I'm using gtk+-2.10.11 that potentially could pull external cairo for linking, so I'm not sure what would happen if gtk+ is pre 2.8. 
On the other hand we could leave browser/build/Makefile.in alone in this case.
attached an lxr derived list of links against $(TK_LIBS) excluding those designated only to cocoa, mac or darwin.
In cairo-gtk2 builds we are linking in these against MOZ_GTK2_LIBS and MOZ_CAIRO_LIBS. If I understood benjamin correctly, we would need linking against MOZ_CAIRO_LIBS probably only in the gfx/thebes or gfx/src/thebes files.
Comment on attachment 272388 [details] [diff] [review]
remove MOZ_CAIRO_LIBS /CFLAGS from TK_LIBS/CFLAGS

mostly TK_LIBS is used for mac cocoa and ifdefed. In https://bugzilla.mozilla.org/attachment.cgi?id=260475
I made a list, where either gtk2 or all other toolkits are included. I don't see where we would need MOZ_CAIRO_LIBS included in TK_LIBS.
Attachment #272388 - Attachment description: remove MOZ_CAIRO_LI → remove MOZ_CAIRO_LIBS /CFLAGS from TK_LIBS/CFLAGS
Attachment #272388 - Attachment is patch: true
Attachment #272388 - Attachment mime type: text/x-patch → text/plain
Attachment #272388 - Flags: review?(benjamin)
Attachment #272388 - Flags: review?(benjamin) → review+
Keywords: checkin-needed
Comment on attachment 258199 [details] [diff] [review]
exchange $(DEPTH) with $(LIBXUL_DIST)/../ in configure.in for the libmozairo location

this one is obsolete, afaics
Attachment #258199 - Attachment is obsolete: true
Assignee: nobody → wuno
Flags: in-testsuite-
Target Milestone: --- → Firefox 3 M7
Version: unspecified → Trunk
Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1851; previous revision: 1.1850
done
Status: NEW → RESOLVED
Closed: 14 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Depends on: 388542
This patch does not let thunderbird build on linux... Is there something that I should be taking care of?

Here is my mozconfig:
  ac_add_options --disable-airbag --disable-tests --disable-optimize --enable-debug
  mk_add_options MOZ_OBJDIR=/home/tux/mozilla/build-dir
  mk_add_options MOZ_BUILD_PROJECTS="mail"
  mk_add_options MOZ_CO_PROJECT="mail calendar"
  ac_add_app_options mail --enable-application=mail
  ac_add_app_options mail --enable-extensions=default,lightning
When mking libthebes.so, the command-line is missing '-lfreetype' and causes the following errors (incomplete list) to occur.

gfxPangoFonts.o: In function `gfxPangoFont::GetMetrics()':
/home/tux/mozilla/mozilla/gfx/thebes/src/gfxPangoFonts.cpp:565: undefined reference to `FT_MulFix'
/home/tux/mozilla/mozilla/gfx/thebes/src/gfxPangoFonts.cpp:572: undefined reference to `FT_MulFix'
/home/tux/mozilla/mozilla/gfx/thebes/src/gfxPangoFonts.cpp:579: undefined reference to `FT_Get_Sfnt_Table'
/home/tux/mozilla/mozilla/gfx/thebes/src/gfxPangoFonts.cpp:582: undefined reference to `FT_MulFix'
/home/tux/mozilla/mozilla/gfx/thebes/src/gfxPangoFonts.cpp:591: undefined reference to `FT_MulFix'
This broke my Firefox build too (on Ubuntu-feisty).
Comparing my build log with the Tinderbox build logs it looks like my
MOZ_XFT_LIBS doesn't include -lfreetype.   Running "pkg-config --libs xft"
on my system gives the output: -lXft -lfontconfig
Tinderbox has:
-L/usr/X11R6/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig

(FWIW, I hacked my /usr/lib/pkgconfig/xft.pc to fix it)
(In reply to comment #16)
> This broke my Firefox build too (on Ubuntu-feisty).
> Comparing my build log with the Tinderbox build logs it looks like my
> MOZ_XFT_LIBS doesn't include -lfreetype.   Running "pkg-config --libs xft"
> on my system gives the output: -lXft -lfontconfig
> Tinderbox has:
> -L/usr/X11R6/lib -lXft -lX11 -lfreetype -lXrender -lfontconfig
> 
> (FWIW, I hacked my /usr/lib/pkgconfig/xft.pc to fix it)
> 
Mats, Prasad, Benjamin checked in a fix, see bug 388542, does this help?
Yep, that fixed it, thanks.
Positive or Thunderbird too, thanks.
Component: Build Config → General
Product: Firefox → Firefox Build System
Target Milestone: Firefox 3 alpha7 → mozilla3 alpha7
You need to log in before you can comment on or make changes to this bug.