# compile some ports with gcc 4.3 and 4.4 with errors



## ZOleg (Feb 22, 2009)

Why most (Xorg 7.4, QT 4.4.3, OO 3, glib2, gtk2, etc) software from ports build and install with gcc 4.3 or 4.4 (installed from lang/gcc43 and lang/gcc44) ok, but some ports dont compile, example - firefox, firefox3, webkit-gtk2, qt4-webkit?

*firefox-2.0.0.20_2,1:*

```
gcc43 -I/usr/local/include/nss -I/usr/local/include/nss/nss -I/usr/local/include -I/usr/local/include -Wall -W -Wno-unused -Wpointer-arith 
-Wcast-align -Wno-long-long -O2 -pipe -fno-strict-aliasing -march=native -O2 -fno-strict-aliasing -O2 -pipe -DNDEBUG -DTRIMMED -O2 -fPIC 
-shared -Wl,-z,defs -Wl, -h,libmozjs.so -o libmozjs.so  jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o jscntxt.o jsdate.o jsdbgapi.o 
jsdhash.o jsdtoa.o jsemit.o jsexn.o jsfun.o jsgc.o jshash.o jsinterp.o jsiter.o jslock.o jslog2.o jslong.o jsmath.o jsnum.o jsobj.o 
jsopcode.o jsparse.o jsprf.o jsregexp.o jsscan.o jsscope.o jsscript.o jsstr.o jsutil.o jsxdrapi.o jsxml.o prmjtime.o -L/usr/local/lib/nss 
-Wl,-rpath,/usr/local /lib/firefox -lc -lm -pthread -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -pthread -Wl,-Bsymbolic -lc -lm -pthread 
-pthread -L/usr/local/lib -liconv
jsnum.o(.text+0x12c6): In function `js_InitNumberClass':
: undefined reference to `fedisableexcept'
jsnum.o(.text+0x22a3): In function `js_InitRuntimeNumberState':
: undefined reference to `fedisableexcept'
/usr/bin/ld: libmozjs.so: hidden symbol `fedisableexcept' isn't defined
collect2: ld returned 1 exit status
gmake[3]: *** [libmozjs.so] Error 1
gmake[3]: Leaving directory `/usr/ports/www/firefox/work/mozilla/js/src'
gmake[2]: *** [libs] Error 2
gmake[2]: Leaving directory `/usr/ports/www/firefox/work/mozilla/js'
gmake[1]: *** [tier_2] Error 2
gmake[1]: Leaving directory `/usr/ports/www/firefox/work/mozilla'
gmake: *** [default] Error 2
*** Error code 2

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

Stop in /usr/ports/www/firefox.
```
*firefox-3.0.6,1:*

```
gcc43 -I/usr/local/include  -I/usr/local/include -Wall -W -Wno-unused -Wpointer-arith -Wcast-align -W -Wno-long-long -O2 -fno-strict-
aliasing -pipe -O2 -fno-strict-aliasing -O2 -fno-strict-aliasing -pipe  -DNDEBUG -DTRIMMED -O2 -fPIC -shared -Wl,-z,defs -Wl,-h,libmozjs.so 
-o libmozjs.so  jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o jscntxt.o jsdate.o jsdbgapi.o jsdhash.o jsdtoa.o jsemit.o jsexn.o jsfun.o 
jsgc.o jshash.o jsinterp.o jsinvoke.o jsiter.o jslock.o jslog2.o jslong.o jsmath.o jsnum.o jsobj.o jsopcode.o jsparse.o jsprf.o jsregexp.o 
jsscan.o jsscope.o jsscript.o jsstr.o jsutil.o jsxdrapi.o jsxml.o prmjtime.o -pthread -Wl,-rpath-link,../../dist/bin   -lm -pthread -L/usr
/local/lib -lplds4 -lplc4 -lnspr4 -pthread -Wl,-Bsymbolic -lc -lm -pthread -pthread -L/usr/local/lib -liconv
jsnum.o(.text+0x12a3): In function `js_InitNumberClass':
: undefined reference to `fedisableexcept'
jsnum.o(.text+0x1f49): In function `js_InitRuntimeNumberState':
: undefined reference to `fedisableexcept'
/usr/bin/ld: libmozjs.so: hidden symbol `fedisableexcept' isn't defined
collect2: ld returned 1 exit status
gmake[3]: *** [libmozjs.so] Error 1
gmake[3]: Leaving directory `/usr/ports/www/firefox3/work/mozilla/js/src'
gmake[2]: *** [libs_tier_js] Error 2
gmake[2]: Leaving directory `/usr/ports/www/firefox3/work/mozilla'
gmake[1]: *** [tier_js] Error 2
gmake[1]: Leaving directory `/usr/ports/www/firefox3/work/mozilla'
gmake: *** [default] Error 2
*** Error code 2

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

Stop in /usr/ports/www/firefox3.
```
*webkit-gtk2-1.0.1_6:*

```
g++43 -DHAVE_CONFIG_H -I. -DWTF_USE_ICU_UNICODE=1 -DBUILDING_CAIRO__=1 -DBUILDING_GTK__=1 -DWTF_CHANGES -DXP_UNIX -DNDEBUG -I./WebCore 
-I./WebCore/platform -I./WebCore/platform/network -I./WebCore/platform/graphics -I./WebCore/platform/text -I./WebCore/loader -I./WebCore
/loader/appcache -I./WebCore/loader/archive -I./WebCore/loader/icon -I./WebCore/css -I./WebCore/dom -I./WebCore/page -I./WebCore/bridge 
-I./WebCore/bridge/c -I./WebCore/editing -I./WebCore/history -I./WebCore/xml -I./WebCore/html -I./WebCore/bindings/js -I./WebCore/platform
/image-decoders -I./WebCore/platform/image-decoders/bmp -I./WebCore/platform/image-decoders/gif -I./WebCore/platform/image-decoders/ico 
-I./WebCore/platform/image-decoders/jpeg -I./WebCore/platform/image-decoders/png -I./WebCore/platform/image-decoders/xbm -I./WebCore
/plugins -I./WebCore/rendering -I./WebCore/rendering/style -I./WebCore/bindings/js -DWTF_USE_CURL=1 -I./WebCore/platform/network/curl 
-DENABLE_OFFLINE_WEB_APPLICATIONS=1 -DENABLE_DASHBOARD_SUPPORT=1 -DENABLE_DATABASE=1 -I./WebCore/platform/sql -I./WebCore/storage 
-DENABLE_DOM_STORAGE=1 -I./WebCore/storage -DENABLE_ICONDATABASE=1 -DENABLE_VIDEO=1 -DENABLE_XPATH=1 -DENABLE_XSLT=1 -DENABLE_SVG=1 
-I./WebCore/svg -I./WebCore/svg/animation -I./WebCore/svg/graphics -I./WebCore/svg/graphics/filters -DENABLE_SVG_USE=1 
-DENABLE_SVG_FOREIGN_OBJECT=1 -DENABLE_SVG_FONTS=1 -DENABLE_SVG_AS_IMAGE=1 -DENABLE_SVG_ANIMATION=1 -I./JavaScriptCore -I./JavaScriptCore
/ForwardingHeaders -I./JavaScriptCore/wtf -I./JavaScriptCore/kjs -I./DerivedSources -I./JavaScriptCore/ForwardingHeaders 
-I./JavaScriptCore/VM -I./JavaScriptCore/profiler -I./JavaScriptCore/wtf/unicode -I./JavaScriptCore/pcre -I./JavaScriptCore/kjs -I./WebCore
/platform/gtk -I./WebCore/platform/graphics/gtk -I./WebCore/platform/graphics/cairo -I./WebCore/loader/gtk -I./WebCore/page/gtk 
-DUSE_FREETYPE=1 -I./WebCore/svg/graphics/cairo -I/usr/local/include -fno-strict-aliasing -O2 -fvisibility-inlines-hidden -fno-rtti -Wall 
-W -Wcast-align -Wchar-subscripts -Wreturn-type -Wformat -Wformat-security -Wno-format-y2k -Wundef  -Wmissing-format-attribute 
-Wpointer-arith -Wwrite-strings -Wno-unused-parameter -Wno-parentheses -fno-exceptions -fvisibility=hidden -D_REENTRANT -I/usr/local/include
/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include/gtk-2.0 -I/usr/local/lib/gtk-
2.0/include -I/usr/local/include/atk-1.0 -I/usr/local/include/cairo -I/usr/local/include/pango-1.0 -I/usr/local/include -I/usr/local/include
/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libxml2 -I/usr
/local/include -D_THREAD_SAFE -I/usr/local/include/cairo -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/pixman-1 
-I/usr/local/include -D_REENTRANT -DORBIT2=1 -I/usr/local/include/gstreamer-0.10 -I/usr/local/include /glib-2.0 -I/usr/local/lib/glib-
2.0/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/gnome-vfs-2.0 -I/usr/local/lib/gnome-vfs-2.0/include 
-I/usr/local/include/gconf/2 -I/usr/local/include/orbit-2.0 -I/usr/local/include/dbus-1.0 -I/usr/local/include/dbus-1.0/include -I/usr/local
/include -I/usr/local/include/libxml2 -O2 -pipe -fno-strict-aliasing -march=native -MT WebCore/page/gtk/libWebCore_la-AXObjectCacheAtk.lo 
-MD -MP -MF WebCore/page/gtk/.deps/libWebCore_la-AXObjectCacheAtk.Tpo -c WebCore/page/gtk/AXObjectCacheAtk.cpp  -fPIC -DPIC -o WebCore/page
/gtk/.libs/libWebCore_la-AXObjectCacheAtk.o
WebCore/page/gtk/AXObjectCacheAtk.cpp: In member function 'void WebCore::AXObjectCache::postNotification(WebCore::RenderObject*, const 
WebCore::String&)':
WebCore/page/gtk/AXObjectCacheAtk.cpp:45: error: 'printf' was not declared in this scope
WebCore/page/gtk/AXObjectCacheAtk.cpp: In member function 'void WebCore::AXObjectCache::postNotificationToElement(WebCore::RenderObject*, 
const WebCore::String&)':
WebCore/page/gtk/AXObjectCacheAtk.cpp:76: error: 'printf' was not declared in this scope
WebCore/page/gtk/AXObjectCacheAtk.cpp: In member function 'void WebCore::AXObjectCache::handleFocusedUIElementChanged()':
WebCore/page/gtk/AXObjectCacheAtk.cpp:98: error: 'printf' was not declared in this scope
gmake[1]: *** [WebCore/page/gtk/libWebCore_la-AXObjectCacheAtk.lo] Error 1
gmake[1]: Leaving directory `/usr/ports/www/webkit-gtk2/work/webkit-1.0.1'
gmake: *** [all] Error 2
*** Error code 2

Stop in /usr/ports/www/webkit-gtk2.
*** Error code 1

Stop in /usr/ports/www/webkit-gtk2.
```


----------



## ZOleg (Feb 22, 2009)

continued:
*qt4-webkit-4.4.3:*

```
g++43 -c -O2 -pipe -fno-strict-aliasing -march=native -fno-exceptions -Wreturn-type -fno-strict-aliasing -O2 -pipe -fno-strict-aliasing 
-march=native -fPIC -DQT_SHARED -DBUILDING_QT__=1 -DUSE_SYSTEM_MALLOC -DNDEBUG -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT3_SUPPORT 
-DQT_MOC_COMPAT -DHAVE_PTHREAD_NP_H -DBUILD_WEBKIT -DENABLE_ICONDATABASE=1 -DENABLE_XPATH=1 -DENABLE_SVG=1 -DWTF_CHANGES=1 -DBUILDING_QT__ 
-DWTF_USE_JAVASCRIPTCORE_BINDINGS=1 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/usr
/local/share/qt4/mkspecs/freebsd-g++ -I. -I../../../../include/QtCore -I../../../../include/QtCore -I../../../../include/QtNetwork -I../..
/../../include/QtNetwork -I../../../../include/QtGui -I../../../../include /QtGui -I../../../../include -I../WebKit/qt/Api -I../JavaScriptCore
-I../JavaScriptCore/kjs -I../JavaScriptCore/bindings -I../JavaScriptCore/bindings/c -I../JavaScriptCore/wtf -I../JavaScriptCore
/ForwardingHeaders -I. -IForwardingHeaders -Iplatform -Iplatform/network -Iplatform/graphics -Iloader -Ipage -Icss -Idom -Ibridge -Iediting 
-Irendering -Ihistory -Ixml -Ihtml -Iplugins -I../../../../include/QtWebKit -I.rcc/release-shared -Igenerated -Itmp -I../JavaScriptCore 
-I../JavaScriptCore/kjs -I../JavaScriptCore/bindings -I../JavaScriptCore/bindings/c -I../JavaScriptCore/wtf -I../JavaScriptCore/bindings/qt 
-I../JavaScriptCore/pcre -I/usr/ports/www/qt4-webkit/work/qt-x11-opensource-src-4.4.3/src/3rdparty/webkit/WebKitBuild/Debug/JavaScriptCore
/kjs/tmp -Iplatform/qt -Iplatform/network/qt -Iplatform/graphics/qt -Iplatform/graphics/svg/qt -Iloader/qt -Ipage/qt -I../WebKit
/qt/WebCoreSupport -I../WebKit/qt/Api -I. -IForwardingHeaders -I../../webkit -I../JavaScriptCore/kjs -I../JavaScriptCore/bindings -Iplatform 
-Iplatform/network -Iplatform/graphics -Iplatform/graphics/svg -Iplatform/graphics/svg/filters
 -Iloader -Iloader/icon -Icss -Idom -Ipage -Ibridge -Iediting -Irendering -Ihistory -Ixml -Ihtml -Ibindings/js -Iksvg2 -Iksvg2/css 
-Iksvg2/svg -Iksvg2/misc -Iksvg2/events -Iplatform/image-decoders -I../../sqlite -I.moc/release-shared -I.uic/release-shared -I/usr/local
/include -o .obj/release-shared/collector.o ../JavaScriptCore/kjs/collector.cpp
../JavaScriptCore/kjs/collector.cpp: In function 'void* KJS::currentThreadStackBase()':
../JavaScriptCore/kjs/collector.cpp:346: error: 'pthread_self' was not declared in this scope
../JavaScriptCore/kjs/collector.cpp:349: error: 'pthread_attr_init' was not declared in this scope
../JavaScriptCore/kjs/collector.cpp:357: error: 'pthread_attr_getstack' was not declared in this scope
../JavaScriptCore/kjs/collector.cpp:360: error: 'pthread_attr_destroy' was not declared in this scope
*** Error code 1

Stop in /usr/ports/www/qt4-webkit/work/qt-x11-opensource-src-4.4.3/src/3rdparty/webkit/WebCore.
*** Error code 1

Stop in /usr/ports/www/qt4-webkit.
```


----------



## ZOleg (Feb 23, 2009)

I have forgotten to mention a configuration:
Intel Core2Duo E6600/Asus MF (Intel x38 chipset)/8Gb RAM (only 3,2 avail in OS)/FreeBSD 7.1-STABLE x86 builded and installed from source on clean system


----------



## NMB (Mar 3, 2009)

*devel/qt4-webkit*

This helped me alot!
taken from:
http://mail-index.netbsd.org/pkgsrc-bugs/2008/08/01/msg027689.html


```
--- src/3rdparty/webkit/JavaScriptCore/kjs/collector.cpp.orig
+++ src/3rdparty/webkit/JavaScriptCore/kjs/collector.cpp
@@ -73,6 +73,7 @@ extern int *__libc_stack_end;
 #endif

 #if HAVE(PTHREAD_NP_H)
+#include <pthread.h>
 #include <pthread_np.h>
 #else
 #include <pthread.h>
```


----------



## ZOleg (Mar 3, 2009)

Thanks for help!


----------



## SIFE (Jun 2, 2010)

how to apply this patch .


----------



## NMB (Jun 2, 2010)

*devel/qt4-webkit patch*

Dont have the sources or even a FreeBSD box at hand, will try anyway...

1. Extract webkit 'tar -zxvf qt4-webkit-4.4.3.tar.gz' (dont remember name).
2. Create textfile named 'coll.patch' containing 'Code' above.
3. Issue 'patch -p0 < coll.patch'

or simply edit the file 'src/3rdparty/webkit/JavaScriptCore/kjs/collector.cpp'
and add the line '#include <pthread.h>' in context, omit the '+'.

Good Luck


----------



## SirDice (Jun 2, 2010)

http://forums.freebsd.org/showthread.php?t=7454


----------



## SIFE (Jun 2, 2010)

where can i find it  ,i was think it is included in qt4 .


----------



## NMB (Jun 3, 2010)

Your questions seems too vague to me.
Exactly what are you trying to do?
What kind of OS, version do you have?


----------



## SIFE (Jun 4, 2010)

i have problem to compiling some ports depend in qt4-webkit like virtualbox and firefox 3.6 ,now i am trying waht did you suggest but no hope .
8.1-PRERELEASE


----------



## NMB (Jun 4, 2010)

Ok
Did you get the same error as 'ZOleg' got?
Do you use 'ports' and 'make' system?
If ports/make true then you will have to edit a patch i folder 'files'

Well I haven't gone that far (v8.1) yet.
Check out 'SirDice' link above.


----------



## SIFE (Jun 4, 2010)

it is some error , i am using GCC 4.6


> Well I haven't gone that far (v8.1) yet.


i am tracking stable  .


----------



## NMB (Jun 5, 2010)

Be specific!
- My car won't start, why?


----------

