firefox3 from ports?

Anton Shterenlikht mexas at bristol.ac.uk
Thu Aug 28 17:12:46 UTC 2008


On Thu, Aug 28, 2008 at 09:41:46AM +0100, Dieter wrote:
> [ -alpha@ added ]
> 
> > > From what I gather the problems could show up on other
> > > 64-bit platforms.
> 
> Alignment requirements vary with CPU arch, but is not a 32 vs 64 bit issue.
> 
> > > 	warning: cast from ... to ... increases
> > > 	required alignment of target type
> > 
> > No such warnings on amd64.  I think they only show up on architectures
> > that require strict alignment, and amd64 doesn't.
> 
> > FWIW, building firefox on OpenBSD/alpha and /sparc64 produces lots
> > of these warnings, but after all the pointer casting games are done,
> > the actual accesses still come out properly aligned and firefox
> > runs.
> 
> Very interesting.  Are you saying that the compiler warnings are wrong?
> Are you saying that a 2nd cast is done before the actual access which
> undoes the increase in alignment?  Do you know for certain that the code
> in question is getting executed?  Given the large amount of code in
> firefox, and the large number of features, I can imagine that lots of
> code only gets executed under rare occasions.
> 
> > > What is the easiest way to build this port with gcc42?
> 
> Try setting your PATH so that gcc42 is first.  Verify by running
> "gcc -v".

I added this to /etc/make.conf:

# Build ports/www/firefox3 with the latest gcc
.if ${.CURDIR:M*/www/firefox3*}
USE_GCC=4.2+
.endif

this seems to work, however the error and the warnings are very
similar if not identical.

Then I disabled
 #CXXFLAGS += $(WARNINGS_AS_ERRORS)

in a Makefile in a particular directory which gave me the error.
I did this reluctantly, following the advice from firefox
developer:

	--- Comment #12 from Benjamin Smedberg  [:bs] (bsmedberg)
	 <benjamin at smedbergs.us>  2008-08-28 +06:45:09 PDT ---

	These are warnings. They are *probably* harmless. To turn off
	warnings-as-errors for this directory, do:

	make WARNINGS_AS_ERRORS=

from https://bugzilla.mozilla.org/show_bug.cgi?id=449373

after that the compilation went ahead with many many alignment warnings.

> 
> Are the alignment warnings the only remaining compiler warnings?

there might have been other, but the alignment was a clear champion.

Now I get error on linking:

gmake[3]: Entering directory `/usr/ports/www/firefox3/work/mozilla/toolkit/library'
rm -f libxul.so
g++42 -I/usr/local/include  -I/usr/local/include -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-long-long -O -pipe -mcpu=ev6 -mieee -O2 -fno-strict-aliasing -fno-strict-aliasing -fshort-wchar -pipe  -DNDEBUG -DTRIMMED -O -fPIC -shared -Wl,-z,defs -Wl,-h,libxul.so -o libxul.so  nsStaticXULComponents.o nsUnicharUtils.o nsCompressedCharMap.o nsBidiUtils.o nsRDFResource.o     -pthread       -Wl,-rpath-link,../../dist/bin  -Wl,--whole-archive ../../embedding/browser/gtk/src/libgtkembedmoz.a ../../toolkit/xre/libxulapp_s.a  ../../staticlib/components/libxpconnect.a ../../staticlib/components/libnecko.a ../../staticlib/components/libuconv.a ../../staticlib/components/libi18n.a ../../staticlib/components/libchardet.a ../../staticlib/components/libjar50.a ../../staticlib/components/libpref.a ../../staticlib/components/libcaps.a ../../staticlib/components/libhtmlpars.a ../../staticlib/components/libimglib2.a ../../staticlib/components/libgklayout.a ../../staticlib/components/libdocshell.a ../../staticlib/components/libembedcomponents.a ../../staticlib/components/libwebbrwsr.a ../../staticlib/components/libnsappshell.a ../../staticlib/components/libtxmgr.a ../../staticlib/components/libchrome.a ../../staticlib/components/libcommandlines.a ../../staticlib/components/libtoolkitcomps.a ../../staticlib/components/libpipboot.a ../../staticlib/components/libpipnss.a ../../staticlib/components/libxmlextras.a ../../staticlib/components/libgkplugin.a ../../staticlib/components/libmozfind.a ../../staticlib/components/libappcomps.a ../../staticlib/components/libunixproxy.a ../../staticlib/components/libxpinstall.a ../../staticlib/components/libjsd.a ../../staticlib/components/libautoconfig.a ../../staticlib/components/libauth.a ../../staticlib/components/libcookie.a ../../staticlib/components/libpermissions.a ../../staticlib/components/libuniversalchardet.a ../../staticlib/components/libcomposer.a ../../staticlib/components/librdf.a ../../staticlib/components/libwindowds.a ../../staticlib/components/libintlapp.a ../../staticlib/components/libfileview.a ../../staticlib/components/libstoragecomps.a ../../staticlib/components/libplaces.a ../../staticlib/components/libtkautocomplete.a ../../staticlib/components/libsatchel.a ../../staticlib/components/libpippki.a ../../staticlib/components/libucvmath.a ../../staticlib/components/libwidget_gtk2.a ../../staticlib/components/libsystem-pref.a ../../staticlib/components/libgkgfxthebes.a ../../staticlib/components/liboji.a ../../staticlib/components/libaccessibility.a ../../staticlib/components/libremoteservice.a ../../staticlib/components/libspellchecker.a ../../staticlib/components/libzipwriter.a ../../staticlib/libxpcom_core.a ../../staticlib/libucvutil_s.a ../../staticlib/libgkgfx.a ../../staticlib/libgfxshared_s.a ../../staticlib/libmozreg_s.a ../../staticlib/libmorkreader_s.a ../../staticlib/libgtkxtbin.a ../../staticlib/libgfxpsshar.a ../../staticlib/libthebes.a ../../staticlib/libjsj.a  -Wl,--no-whole-archive -L../../dist/lib -lsqlite3 -Wl,-Bsymbolic -lc -L../../dist/bin -L../../dist/lib  -L../../dist/bin -L../../dist/lib -L../../jpeg -lmozjpeg -L../../modules/libimg/png -lmozpng -L../../dist/bin -lmozlcms -L../../dist/bin -lmozjs -L../../dist/bin -L../../dist/lib -lcrmf -lsmime3 -lssl3 -lnss3 -lnssutil3 -lsoftokn3  -L/usr/lib -lz  -pthread -L/usr/local/lib -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lpango-1.0 -lm -lfreetype -lz -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -liconv   -pthread -L/usr/local/lib -lcairo -lfreetype -lz -lfontconfig    -L/usr/local/lib -pthread -L/usr/local/lib -lXrender -lcairo -lX11   -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread -L/usr/local/lib -lX11  -L/usr/local/lib -lXft -lXrender -lfontconfig -lfreetype -lz -lX11   -pthread -L/usr/local/lib -lgtk-x11-2.0 -latk-1.0 -lgdk-x11-2.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lcairo -lpangoft2-1.0 -lpango-1.0 -lm -lfreetype -lz -lfontconfig -lgmodule-2.0 -lX11 -lXfixes -lgobject-2.0 -lglib-2.0 -liconv   -lXt -lgthread-2.0 -L/usr/local/lib -lfreetype -lz -lm -pthread -pthread -L/usr/local/lib -liconv    
../../staticlib/components/libxpconnect.a(xpcwrappednative.o)(.text+0x303c): In function `XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode)':
: undefined reference to `NS_InvokeByIndex_P'
../../staticlib/components/libxpconnect.a(xpcwrappednative.o)(.text+0x307c): In function `XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode)':
: undefined reference to `NS_InvokeByIndex_P'
../../staticlib/components/libgklayout.a(txXPCOMExtensionFunction.o)(.text+0xc1c): In function `txXPCOMExtensionFunctionCall::evaluate(txIEvalContext*, txAExprResult**)':
: undefined reference to `NS_InvokeByIndex_P'
../../staticlib/components/libgklayout.a(nsXTFInterfaceAggregator.o)(.text+0x2cc): In function `nsXTFInterfaceAggregator::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*)':
: undefined reference to `NS_InvokeByIndex_P'
../../staticlib/components/libgklayout.a(nsXTFWeakTearoff.o)(.text+0x208): In function `nsXTFWeakTearoff::CallMethod(unsigned short, XPTMethodDescriptor const*, nsXPTCMiniVariant*)':
: undefined reference to `NS_InvokeByIndex_P'
../../staticlib/libxpcom_core.a(nsProxyEvent.o)(.text+0x944): more undefined references to `NS_InvokeByIndex_P' follow
../../staticlib/libxpcom_core.a(xptcinvoke_freebsd_alpha.o)(.text+0x44): In function `XPTC_InvokeByIndex':
: undefined reference to `$invoke_copy_to_stack..ng'
../../staticlib/libxpcom_core.a(xptcstubs_freebsd_alpha.o)(.text+0x40): In function `SharedStub':
: undefined reference to `$PrepareAndDispatch..ng'
collect2: ld returned 1 exit status
gmake[3]: *** [libxul.so] Error 1
gmake[3]: Leaving directory `/usr/ports/www/firefox3/work/mozilla/toolkit/library'

The final 4 lines refer to 2 xptc* files, which I copied from
FF2 distro and modified myself, so that probably means I have
to review these 2 files.

thanks

-- 
Anton Shterenlikht
Room 2.6, Queen's Building
Mech Eng Dept
Bristol University
University Walk, Bristol BS8 1TR, UK
Tel: +44 (0)117 928 8233 
Fax: +44 (0)117 929 4423


More information about the freebsd-amd64 mailing list