# Trouble building libxul



## mahashakti89 (Jun 10, 2012)

Hi,

I am running FreeBSD 9.0, and have some trouble upgrading my installed ports. It fails on libxul which is needed by some other packages like yelp and other gnome-desktop dependant packages. I get following error message:

```
nsStackWalk.cpp: In function 'nsresult NS_StackWalk(void (*)(void*, void*), PRUint32, void*)':
nsStackWalk.cpp:1544: error: '_Unwind_Backtrace' was not declared in this scope
gmake[4]: *** [nsStackWalk.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
gmake[4]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom/base'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom'
gmake[2]: *** [libs_tier_xpcom] Error 2
gmake[2]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake[1]: *** [tier_xpcom] Error 2
gmake[1]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake: *** [default] Error 2
*** Error code 1
```

I searched on Google, on the forum, emptied /etc/make.conf, deins*t*alled firefox like said in /usr/ports/UPDATING but nothing works. Could need some tips.

Thanks

mahashakti


----------



## AJ (Jun 10, 2012)

Is your ports tree up to date? csup(1) or portsnap(8).


----------



## mahashakti89 (Jun 11, 2012)

Hi,

Yes my ports are up to date. What I did: `portsnap fetch && portsnap extract`
Then: `portmaster -a` 
But nothing seems to work.

Thanks

mahashakti89


----------



## mrgz (Jun 21, 2012)

Hi,

I don't know exactly, but it appears to be something with GCC-specific features. I just commented out line 1544 for testing and the compilation ran just fine. My FreeBSD version on this machine is 8.2-RELEASE-p3.

Deinstalling firefox and seamonkey didn't work for me, too.


----------



## mahashakti89 (Jun 22, 2012)

mrgz said:
			
		

> Hi,
> 
> I don't know exactly, but it appears to be something with GCC-specific features. I just commented out line 1544 for testing and the compilation ran just fine. My FreeBSD version on this machine is 8.2-RELEASE-p3.
> 
> Deinstalling firefox and seamonkey didn't work for me, too.



Thanks for your answer. In what file did you comment out line 1544? ??


mahashakti89


----------



## mrgz (Jun 23, 2012)

Hi,

Disabling lines of code is not a defititive solution, of course. So I went to check how this piece of code is activated on those programs. Reading configure.in from firefox, there is a line to check the presence of unwind.h.


```
if test -z "$SKIP_LIBRARY_CHECKS"; then
   MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
fi
```

The package wich provides unwind.h is libunwind. It was installed on my system. So I tried to [CMD=""]pkg_deinstall libunwind[/CMD] (along with Blender, the only dependent package) and libxul compiled without any errors. Deinstalling libunwind makes the configure process ignore the piece of code which uses the _Unwind_Backtrace function. I'm trying to build Firefox right now, but certainly there is something going wrong when mixing libunwind and Firefox/Seamonkey/libxul.

This issue was already discussed on this forum.

So, try to deinstall libunwind to see what happens.

Regards.


----------



## mahashakti89 (Jun 23, 2012)

Hi,

I made a [cmd=]make deinstall clean[/cmd] for libunwind, but it doesn't work: 


```
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsIConsoleListener.xpt -d .deps/nsIConsoleListener.pp nsIConsoleListener.idl
nsIConsoleMessage.idl
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsIConsoleMessage.xpt -d .deps/nsIConsoleMessage.pp nsIConsoleMessage.idl
nsStackWalk.cpp: In function 'nsresult NS_StackWalk(void (*)(void*, void*), PRUint32, void*)':
nsStackWalk.cpp:1544: error: '_Unwind_Backtrace' was not declared in this scope
nsIConsoleService.idl
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsIConsoleService.xpt -d .deps/nsIConsoleService.pp nsIConsoleService.idl
nsIDebug2.idl
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsIDebug2.xpt -d .deps/nsIDebug2.pp nsIDebug2.idl
gmake[4]: *** [nsStackWalk.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
gmake[4]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom/base'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom'
gmake[2]: *** [libs_tier_xpcom] Error 2
gmake[2]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake[1]: *** [tier_xpcom] Error 2
gmake[1]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake: *** [default] Error 2
*** Error code 1
```
Thanks.


----------



## mrgz (Jun 23, 2012)

Can you check the presence of the unwind.h on your include paths? Try to build libxul directly on ports folder. Follow those steps:

[CMD=""]find /usr/local/include -iname "unwind.h"[/CMD]
[CMD=""]pkg_deinstall libunwind[/CMD]
[CMD=""]cd /usr/ports/www/libxul[/CMD]
[CMD=""]make clean reinstall[/CMD]


----------



## mahashakti89 (Jun 23, 2012)

Hi,

I tried [cmd=]find /usr/local/include -iname "unwind.h"[/cmd] with no result; libunwind was deinstalled, then I got the same result:

```
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsISupports.xpt -d .deps/nsISupports.pp nsISupports.idl
nsStackWalk.cpp: In function 'nsresult NS_StackWalk(void (*)(void*, void*), PRUint32, void*)':
nsStackWalk.cpp:1544: error: '_Unwind_Backtrace' was not declared in this scope
nsIWeakReference.idl
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsIWeakReference.xpt -d .deps/nsIWeakReference.pp nsIWeakReference.idl
nsrootidl.idl
gmake[4]: *** [nsStackWalk.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
/usr/ports/www/libxul/work/mozilla-1.9.2/dist/bin/xpidl -m typelib -w -I. -I../../dist/idl -e
 _xpidlgen/nsrootidl.xpt -d .deps/nsrootidl.pp nsrootidl.idl
gmake[4]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom/base'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/xpcom'
gmake[2]: *** [libs_tier_xpcom] Error 2
gmake[2]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake[1]: *** [tier_xpcom] Error 2
gmake[1]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake: *** [default] Error 2
*** Error code 1

Stop in /usr/ports/www/libxul.
*** Error code 1

Stop in /usr/ports/www/libxul.
```


----------



## mrgz (Jun 26, 2012)

*Disable code on nsStackWalk.cpp*

Hi,

Well, this is really strange. Anyway, try to comment line 1544 from the file /usr/ports/www/libxul/work/mozilla-1.9.2/xpcom/base/nsStackWalk.cpp. Like this:


```
//_Unwind_Backtrace(unwind_callback, &info);
```

If it compiles without errors, try to rebuild Firefox. It may be helpful if you print the contents of your /etc/make.conf file, too.


----------



## mahashakti89 (Jun 26, 2012)

It did the trick, commenting out the line did it. 
Thanks for your help and your patience   ....
As for /etc/make.conf it's empty. Absolutely nothing in it after reading a post on this forum, saying not to play with compilation options.

 mahashakti89


----------



## mrgz (Jul 6, 2012)

Very good. And what about Firefox? Did you try to compile?


----------



## mahashakti89 (Jul 7, 2012)

Thanks for the help and the answer ....
 I tried it with firefox, but there was an error , I don't remember exactly which error. I use chrome or konqueror as webbrowser, so I didn't push it too far .

Regards


----------



## tingo (Jul 9, 2012)

I can confirm this; with devel/libunwind installed, www/libxul fails to upgrade.
Simply deinstall libunwind, and libxul upgrades without problems.
Has anybody  submitted a PR for this yet?


----------



## mahashakti89 (Jul 10, 2012)

mahashakti89 said:
			
		

> Thanks for the help and the answer ....
> I tried it with firefox, but there was an error , I don't remember exactly which error. I use chrome or konqueror as webbrowser, so I didn't push it too far .
> 
> Regards



Finally, I tried it one more time in order to get rid of the error and not to stay stuck ...
I get following error :

```
/usr/ports/www/firefox/work/mozilla-release/xpcom/base/nsStackWalk.cpp:1195: error: '_Unwind_Backtrace' was not declared in this scope
gmake[4]: *** [nsStackWalk.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
gmake[4]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release/xpcom/base'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release/xpcom'
gmake[2]: *** [libs_tier_platform] Error 2
gmake[2]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release'
gmake[1]: *** [tier_platform] Error 2
gmake[1]: Leaving directory `/usr/ports/www/firefox/work/mozilla-release'
gmake: *** [default] Error 2
*** Error code 1
```

I founf nothing helpful on the www ...

 Regards

mahashakti89


----------



## tingo (Jul 12, 2012)

See my message above: did you try to uninstall libunwind first?


----------



## mahashakti89 (Jul 12, 2012)

*Libunwind already desinstalled but no effect*

Hi,

To answer your question : yes, libunwind was already desinstalled. I tried it more time, cleaning again, doing :
	
	



```
portmaster www/firefox
```
but I got the same error already mentioned above.

Thanks

mahashakti89


----------



## tingo (Jul 15, 2012)

*Firefox installed for me*

Strange. I just did

```
root@kg-v2# pkg_deinstall -f libunwind-20110911
--->  Deinstalling 'libunwind-20110911'
pkg_delete: package 'libunwind-20110911' is required by these other packages
and may not be deinstalled (but I'll delete it anyway):
blender-2.63a
[Updating the pkgdb <format:bdb_btree> in /var/db/pkg ... - 995 packages found (-1 +0) (...) done]
```
Followed by

```
root@kg-v2# portupgrade -R firefox

--->  Upgrading 'firefox-12.0,1' to 'firefox-13.0.1,1' (www/firefox)
--->  Building '/usr/ports/www/firefox'
===>  Cleaning for firefox-13.0.1,1
===>  Found saved configuration for firefox-13.0.1,1
===>  Extracting for firefox-13.0.1,1
```
and that worked for me - now I have Firefox 13.
All this on

```
tingo@kg-v2$ uname -a
FreeBSD kg-v2.kg4.no 8.3-STABLE FreeBSD 8.3-STABLE #6: Fri Apr 27 23:50:55 CEST 2012
     root@kg-v2.kg4.no:/usr/obj/usr/src/sys/GENERIC  amd64
```
I finished off by installing libunwind again.


----------



## b0red (Jul 24, 2012)

*Trouble building libxul crashes*

Hi
I have the same trouble that some of you have, libxul crashes when trying to update ports.


```
gmake[4]: *** [nsHtml5ElementName.o] Error 1
gmake[4]: *** Deleting file `nsHtml5ElementName.o'
gmake[4]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/parser/html'
gmake[3]: *** [libs] Error 2
gmake[3]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2/parser'
gmake[2]: *** [libs_tier_gecko] Error 2
gmake[2]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake[1]: *** [tier_gecko] Error 2
gmake[1]: Leaving directory `/usr/ports/www/libxul/work/mozilla-1.9.2'
gmake: *** [default] Error 2
*** Error code 1

Stop in /usr/ports/www/libxul.
*** Error code 1

Stop in /usr/ports/www/libxul.
*** Error code 1

Stop in /usr/ports/www/libxul.
*** Error code 1

Stop in /usr/ports/x11/yelp.
*** Error code 1

Stop in /usr/ports/x11/yelp.
*** Error code 1

Stop in /usr/ports/graphics/evince.
*** Error code 1

Stop in /usr/ports/graphics/evince.
*** Error code 1

Stop in /usr/ports/graphics/evince.
```

I have the latest ports tree, did a 
	
	



```
portsnap fetch update
```
 prior to a 
	
	



```
portmaster -a
```
.

I don't have libunwind installed at all; 

```
XFCE4-81# whereis libunwind
libunwind: /usr/ports/devel/libunwind
```

And uname -a looks like this;
FreeBSD XFCE4-81.psrnet 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Mon Apr  9 21:47:23 UTC 2012     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386


----------

