Closed Bug 368844 Opened 18 years ago Closed 17 years ago

Build with --enable-system-cairo is broken

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9beta2

People

(Reporter: mpgritti, Assigned: astralstorm)

References

Details

Attachments

(1 file, 1 obsolete file)

Relevant part of the build log: gcc -o cairo-xlib-utils.o -c -I../../../dist/include/system_wrappers -include ../../../config/gcc_hidden.h -DIMPL_THEBES -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DOSTYPE=\"Linux2.6.9-34\" -DOSARCH=\"Linux\" -DBUILD_ID=2007013112 -I../../../dist/include/cairo -I../../../dist/include/libpixman -I../../../dist/include/string -I../../../dist/include/pref -I../../../dist/include/xpcom -I../../../dist/include/unicharutil -I../../../dist/include/gfx -I../../../dist/include -I../../../dist/include/thebes -I/usr/include/nspr4 -I../../../dist/sdk/include -fPIC -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -Wno-long-long -pedantic -pthread -pipe -DNDEBUG -DTRIMMED -Os -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -include ../../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/cairo-xlib-utils.pp cairo-xlib-utils.c c++ -o gfxASurface.o -c -I../../../dist/include/system_wrappers -include ../../../config/gcc_hidden.h -DIMPL_THEBES -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DOSTYPE=\"Linux2.6.9-34\" -DOSARCH=\"Linux\" -DBUILD_ID=2007013112 -I../../../dist/include/cairo -I../../../dist/include/libpixman -I../../../dist/include/string -I../../../dist/include/pref -I../../../dist/include/xpcom -I../../../dist/include/unicharutil -I../../../dist/include/gfx -I../../../dist/include -I../../../dist/include/thebes -I/usr/include/nspr4 -I../../../dist/sdk/include -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/gfxASurface.pp gfxASurface.cpp gfxContext.cpp c++ -o gfxContext.o -c -I../../../dist/include/system_wrappers -include ../../../config/gcc_hidden.h -DIMPL_THEBES -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DOSTYPE=\"Linux2.6.9-34\" -DOSARCH=\"Linux\" -DBUILD_ID=2007013112 -I../../../dist/include/cairo -I../../../dist/include/libpixman -I../../../dist/include/string -I../../../dist/include/pref -I../../../dist/include/xpcom -I../../../dist/include/unicharutil -I../../../dist/include/gfx -I../../../dist/include -I../../../dist/include/thebes -I/usr/include/nspr4 -I../../../dist/sdk/include -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/gfxContext.pp gfxContext.cpp gfxImageSurface.cpp c++ -o gfxImageSurface.o -c -I../../../dist/include/system_wrappers -include ../../../config/gcc_hidden.h -DIMPL_THEBES -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_COM_OBSOLETE -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DOSTYPE=\"Linux2.6.9-34\" -DOSARCH=\"Linux\" -DBUILD_ID=2007013112 -I../../../dist/include/cairo -I../../../dist/include/libpixman -I../../../dist/include/string -I../../../dist/include/pref -I../../../dist/include/xpcom -I../../../dist/include/unicharutil -I../../../dist/include/gfx -I../../../dist/include -I../../../dist/include/thebes -I/usr/include/nspr4 -I../../../dist/sdk/include -fPIC -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pedantic -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -Os -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/gfxImageSurface.pp gfxImageSurface.cpp cairo-xlib-utils.c:446: error: expected ')' before '*' token cairo-xlib-utils.c: In function 'cairo_draw_with_xlib': cairo-xlib-utils.c:586: warning: implicit declaration of function '_compute_alpha_values' cairo-xlib-utils.c:586: error: 'uint32_t' undeclared (first use in this function) cairo-xlib-utils.c:586: error: (Each undeclared identifier is reported only once cairo-xlib-utils.c:586: error: for each function it appears in.) cairo-xlib-utils.c:586: error: expected expression before ')' token gmake[6]: *** [cairo-xlib-utils.o] Error 1 gmake[6]: *** Waiting for unfinished jobs.... None of these is defined when using --enable-system-cairo: #if HAVE_STDINT_H #include <stdint.h> #elif HAVE_INTTYPES_H #include <inttypes.h> #elif HAVE_SYS_INT_TYPES_H #include <sys/int_types.h> #endif The check is limited to MOZILLA_TREE_CAIRO case. From configure.in if test "$MOZ_TREE_CAIRO"; then # Check for headers defining standard int types. AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
I've also stumbled upon that bug. Will attach a patch against current trunk. I've found yet another problem after fixing this one with cairo 1.3.12: i -fno-handle-exceptions -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wno-long-long -pipe -fPIC -Wno-return-type -w -fshort-wchar -pthread -pipe -DNDEBUG -DTRIMMED -O2 -DPNG_NO_MMX_CODE -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -DPNG_NO_MMX_CODE -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DPNG_NO_MMX_CODE -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -DGENTOO_NSPLUGINS_DIR=\"/usr/lib64/nsplugins\" -DGENTOO_NSBROWSER_PLUGINS_DIR=\"/usr/lib64/nsbrowser/plugins\" -DMOZILLA_CLIENT -include ../../../mozilla-config.h -Wp,-MD,.deps/gfxContext.pp gfxContext.cpp gfxASurface.cpp: In member function 'nsrefcnt gfxASurface::AddRef()': gfxASurface.cpp:75: error: 'cairo_surface_get_reference_count' was not declared in this scope gfxASurface.cpp: In member function 'nsrefcnt gfxASurface::Release()': gfxASurface.cpp:86: error: 'cairo_surface_get_reference_count' was not declared in this scope gmake[5]: *** [gfxASurface.o] Error 1 The function no longer exists.
Comment on attachment 255901 [details] [diff] [review] Fix configure.in against --enable-system-cairo stuart, does this look right?
Attachment #255901 - Flags: review?(pavlov)
The configure path helped, but build then failed due to the usage of Cairo's internal API. Fortunately the function wasn't used at all troughout tree, so after adding this patch it built fine.
Regarding, Priit's, "system-cairo-no-internal-api-use.patch", I agree that it might work. I am up to the standard Cairo 1.4.0 release (under Gentoo, both as distributed from Gentoo and compiled directly from source) and they still leave undefined cairo_matrix_transform_bounding_box in gfxMatrix.cpp. I have tried an external declaration in gfxMatrix.cpp, as well as changing cairo_... to _cairo... *and* removing the "cairo_private" declaration in the cairo sources in "cairoint.h" and those do not appear to solve the problem. *Who* the hell allowed function calls to creep into the Mozilla sources which were dependent on "private" cairo functions? Should there not be a mechanism to prevent this? The "patch" proposed might work if it eliminates the reference to cairo_matrix_transform_bounding_box -- but then the question arises... *Why* isn't this part of either the granparadiso sources or the current CVS sources? Why are sources being released which *cannot* be built upon any but a system whose requirements are undefined? Why must one apply "private" patches to the "released" sources. (In my book, a released robust system would compile on at least 3 platforms, Windows, Linux and Darwin, with "standard" requirements for libraries, system call support, etc. required). If if it will *not* compile it should *not* be in the base CVS system or an alpha release. It should be noted that the current CVS sources will not compile with --enable-xprint, presumably due to recent changes in nsIDeviceContext.h. So even if we fix the cairo problem the sources will still not compile using reasonable configuration options on a "state of the library" Linux system. So one has changes taking place in the CVS sources with no concept of whether or not they will break the ability to build the system on alternative platforms. This may be a reason that people despise open source software development -- there is no management and therefore one has chaos reigning in terms of "It will compile and work" or "it will not". I will confirm Marco's comments with respect to cairo-xlib-utils.c, there is a problem in defining HAVE_STDINT_H in the mozilla config process. It can be worked around by adding "#define HAVE_STDINT_H 1" to cairo-xlib-utils.c but that should not have to be necessary.
I would like to be clear about this problem. There are at least 3 problems. 1. cairo-xlib-utils.c -- which is a configuration problem involving type declarations. 2. gfxASurface.cpp -- which appears to be due to incompatibilities between Mozilla's use of cairo and cairo versions (I think this is fixed in cairo-1.4.0). 3. gfxMatrix.cpp -- which appears to be *not* fixed in cairo-1.4.0 and is due to the use of the private cairo function (_cairo_matrix_transform_bounding_box). There is a 4th problem, involved in the use of --enable-xprint which is going to presumably require a rewrite of the gfx/srx/nsFontMetricsXlib.cpp. It looks like the error is in: ./gfx/src/xlib/nsFontMetricsXlib.cpp thru ./gfx/src/xlib/nsFontMetricsXlib.h thru ./gfx/public/nsIDeviceContext.h, class nsIDeviceContext is missing: GetCanonicalPixelScale, AppUnitsToDevUnits, DevUnitsToAppUnits It looks like nsIDeviceContext.h was rewritten sometime in January without bothering to see if it would destroy the ability of --enable-xprint compilations. This problem *will* not be resolved until people cannot check things into the base CVS system without ensuring they do not break "base" compiles on common systems other than Windows. (Mind you the same problem exists in Linux -- having references to cairo_matrix_transform_bounding_box which either doesn't exist or is private in many Linux systems accepted into the base Mozilla system is unacceptable.)
> 1. cairo-xlib-utils.c -- which is a configuration problem involving type > declarations. First patch fixes it.. > 2. gfxASurface.cpp -- which appears to be due to incompatibilities between > Mozilla's use of cairo and cairo versions (I think this is fixed in > cairo-1.4.0). Is fixed since cairo-1.3.16, IIRC. > 3. gfxMatrix.cpp -- which appears to be *not* fixed in cairo-1.4.0 and is due > to the use of the private cairo function > (_cairo_matrix_transform_bounding_box). Second patch fixes it. Although better approach would be to use #if 0 .. #endif blocks instead of deleting the stuff. But the function is not currently use thorough Xulrunner's tree.
Can someone offer a guess as to when these patches will be available in the base CVS tree? I.e. *when* will I be able to do a CVS update and have a version that will build with either --enable-system-cairo (with cairo at either 1.3.16 or 1.4.0 or 1.4.x (if specified as required...)). And will this appear in a granparadiso alpha3 (or alphaN) package? The only reason I started wrestling with granparadiso at all was because in trying to get a fully static firefox for debugging the gtk "untitled window" bug (#263160) and I would anticipate that more attention would be paid to solutions if one was working with 3.0 sources rather than 2.0 sources.
> *Who* the hell allowed function calls to creep into the Mozilla sources > which were dependent on "private" cairo functions? Should there not be > a mechanism to prevent this? I did. > Can someone offer a guess as to when these patches will be available in the > base CVS tree? I.e. *when* will I be able to do a CVS update and have a > version that will build with either --enable-system-cairo (with cairo at either > 1.3.16 or 1.4.0 or 1.4.x (if specified as required...)). --enable-system-cairo is not in any way an interesting build flag for us; it will be "supported" when Firefox 3/Gecko 1.9 ships, and not before. It -might- work before then, but it is not and will not be guaranteed to do so. Screaming and moaning in bugzilla about how something that's not intended to be supported except at well-defined release points isn't going to help. Both cairo and Gecko 1.9 are still in flux, and we have had and may continue to have many private patches in our own tree before they are merged upstream, as necessary. --enable-xprint is equally uninteresting; if someone is interested in making it work, then they should spend the time and effort to do so.
Attachment #255901 - Flags: review?(pavlov) → review+
Is this still a problem after cairo 1.4.x update?
(In reply to comment #9) > > 1. cairo-xlib-utils.c -- which is a configuration problem involving type > > declarations. > First patch fixes it.. This worked for me on Alpha4 stable tarball source code. I got following results patch -p0 < firefox-3.0-fix-system-cairo-configure.patch patching file configure.in Hunk #1 succeeded at 7186 (offset -49 lines). > > > 2. gfxASurface.cpp -- which appears to be due to incompatibilities between > > Mozilla's use of cairo and cairo versions (I think this is fixed in > > cairo-1.4.0). > Is fixed since cairo-1.3.16, IIRC. > > > 3. gfxMatrix.cpp -- which appears to be *not* fixed in cairo-1.4.0 and is due > > to the use of the private cairo function > > (_cairo_matrix_transform_bounding_box). > Second patch fixes it. Although better approach would be to use #if 0 .. #endif > blocks instead of deleting the stuff. > But the function is not currently use thorough Xulrunner's tree. > Second patch failed. Following is output i got patch -p0 < system-cairo-no-internal-api-use.patch patching file gfx/thebes/public/gfxMatrix.h patching file gfx/thebes/src/gfxMatrix.cpp Hunk #1 FAILED at 105. 1 out of 1 hunk FAILED -- saving rejects to file gfx/thebes/src/gfxMatrix.cpp.rej The gfxMatrix.cpp.rej have following code ============================================================================== *************** *** 105,119 **** return gfxRect(Transform(rect.pos), Transform(rect.size)); } - gfxRect - gfxMatrix::TransformBounds(const gfxRect& rect) const - { - double x0 = rect.pos.x; - double y0 = rect.pos.y; - double x1 = rect.pos.x + rect.size.width; - double y1 = rect.pos.y + rect.size.height; - - cairo_matrix_transform_bounding_box(CONST_CAIRO_MATRIX(this), &x0, &y0, &x1, &y1, NULL); - - return gfxRect(x0, y0, x1 - x0, y1 - y0); - } --- 105,107 ---- return gfxRect(Transform(rect.pos), Transform(rect.size)); } ============================================================================ Is there solution to this?
Comment on attachment 257476 [details] [diff] [review] system-cairo-no-internal-api-use.patch This has been fixed internally, so this patch isn't necessary anymore.
Attachment #257476 - Attachment is obsolete: true
Attachment #257476 - Flags: review?(vladimir)
(In reply to comment #14) > (From update of attachment 257476 [details] [diff] [review]) > This has been fixed internally, so this patch isn't necessary anymore. > So is this applied to cvs now and may appear in alpha5 source tarball? But still first patch to configure is needed right for cvs version?
It is still broken for me in trunk cvs with no patch. I have to build with internal cairo.
(In reply to comment #16) > It is still broken for me in trunk cvs with no patch. I have to build with > internal cairo. > Same for me also. Current CVS is nor working still with --enable-system-cairo enabled.
Actually the patch https://bugzilla.mozilla.org/attachment.cgi?id=255901 does indeed fix it.There is not need for the second patch. I can now successfully build with system cairo.
(In reply to comment #18) > Actually the patch https://bugzilla.mozilla.org/attachment.cgi?id=255901 does > indeed fix it.There is not need for the second patch. > I can now successfully build with system cairo. > Can you tell me on which cvs checkout you did successful build with --enable-system-cairo?
(In reply to comment #19) > (In reply to comment #18) > > Actually the patch https://bugzilla.mozilla.org/attachment.cgi?id=255901 does > > indeed fix it.There is not need for the second patch. > > I can now successfully build with system cairo. > > > > Can you tell me on which cvs checkout you did successful build with > --enable-system-cairo? > a cvs checkout from two hours ago. Just use patch https://bugzilla.mozilla.org/attachment.cgi?id=255901 and run autoconf. You will need autoconf-2.13 since autcconf 2.61 doesn't work with mozilla code. After that, you can build with --enable-system-cairo.
Nominating for blocking firefox 3.0 since the patch works.
Flags: blocking-firefox3?
(In reply to comment #21) > Nominating for blocking firefox 3.0 since the patch works. > Thanks it worked for me also now.
(In reply to comment #22) > (In reply to comment #21) > > Nominating for blocking firefox 3.0 since the patch works. > > > > Thanks it worked for me also now. > After applying this patch, does it still build correctly with internal cairo as well? or only system cairo.
(In reply to comment #23) > (In reply to comment #22) > > (In reply to comment #21) > > > Nominating for blocking firefox 3.0 since the patch works. > > > > > > > Thanks it worked for me also now. > > > > After applying this patch, does it still build correctly with internal cairo as > well? or only system cairo. > yes. it built successfully and using built binary successfully. Even about:buildconfig is showing --enable-system-cairo
See most recent comments in Bug #376505. The current CVS source doesn't compile cairo-xlib-utils.c and has other problems as well. Patches should be applied to the CVS source in a timely manner and not require that people still try and assemble a working patch set 5 *months* after the problem was outlined.
Ok. I tested configure patch on Alpha5 tarball and it worked. It compiled with --enable-system-cairo and even about:buildconfig is showing that my build has system-cairo enabled.
Flags: blocking-firefox3? → blocking-firefox3+
Flags: blocking-firefox3+
Product: Firefox → Core
QA Contact: build.config → build-config
While you are at this, please make the minimum required system cairo 1.4.x (preferably 1.4.8 or 1.4.10). Thanks.
Is it any progress?
Comment on attachment 255901 [details] [diff] [review] Fix configure.in against --enable-system-cairo Fixes some system-cairo configure problems. Simple change.
Attachment #255901 - Flags: approval1.9?
Pav - given how old the review is here can you comment on if we want to take this patch?
Comment on attachment 255901 [details] [diff] [review] Fix configure.in against --enable-system-cairo yeah, i think this patch is fine.
Comment on attachment 255901 [details] [diff] [review] Fix configure.in against --enable-system-cairo a+ based on comment #30
Attachment #255901 - Flags: approval1.9? → approval1.9+
Checking in configure.in; /cvsroot/mozilla/configure.in,v <-- configure.in new revision: 1.1889; previous revision: 1.1888 done Does having this patch checked-in mean this bug is fixed? Can I resolve it as such?
Assignee: nobody → astralstorm
Target Milestone: --- → mozilla1.9 M10
works fine for me.
I can verify this works in latest trunk. I can correctly build against system Cairo 1.6.4 You may close the bug.
Marking fixed (as confirmed twice now).
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: