# List of ports that don't build perfectly (or at all) with gcc44



## wonslung (Oct 2, 2009)

I've recently used the method described here to install and use gcc44 for building ports with ssse3

http://www.freebsd.org/doc/en/articles/custom-gcc/article.html

I couldn't find a list of ports which don't build properly with gcc44 so i figured i'd help start one.  If anyone finds more ports with this issue, or has patches and tips on how to make them build, let's post them here.
*


Doesn't build:*
misc/getopt
www/libxul
security/py-crypto 
     this port will not build if you used the mssse3 cflag in lang/python26 
devel/icu
sysutils/fusefs-kmod
graphics/libGL
www/firefox35
net/liveMedia

*Builds, but doesn't work properly:*

net-p2p/rtorrent
net-p2p/libtorrent
net-p2p/rtorrent-devel
net-p2p/libtorrent-devel
*doesn't build, but has a fix:*

sysutils/libcdio ( add 
	
	



```
#include <stdlib.h>
```
 to include/cdio++/iso9660.hpp between 
	
	



```
#include <cdio++/cdio.hpp>
+#include <stdlib.h>
 #include <string.h>
```

ports/security/py-openssl
     This port will not build with -mssse flag

sysutils/fusefs-kmod
     put this in your make.conf:
	
	



```
.if empty(.CURDIR:M/usr/ports/sysutils/fusefs-kmod)
CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
.endif
```

devel/icu
     this requires an edit of the file /usr/ports/devel/icu/work/icu/source/layoutex/ParagraphLayout.cpp  replace #elif with #else then it should build


if anyone has any to add, or any corrections or tips please let me know.
I'll keep adding stuff i find.


----------



## wonslung (Oct 3, 2009)

maybe someone knows how to handle this....
the page i referenced before explains how to exclude a port entirely but how would you just exclude the cflag?  adding this doesn't work


```
.if !empty(.CURDIR:M/usr/ports/security/py-openssl*) && exists(/usr/local/bin/gcc44)
CC=gcc44
CXX=g++44
CPP=cpp44
.endif
```

if you already have the other section....any ideas?


ok, this is quite annoying....the port security/py-pycrypto won't build now no matter what i do....i'm not sure what to do to fix this.

if anyone knows let me know, heres the error code
	
	



```
===>  Building for py26-pycrypto-2.0.1_4
running build
running build_py
running build_ext
building 'Crypto.Hash.MD2' extension
cc -DNDEBUG -O2 -pipe -mssse3 -march=prescott -D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x100000 -fno-strict-aliasing -O2 -pipe -march=prescott 
-fno-strict-aliasing -fPIC -Isrc/ -I/usr/local/include/python2.6 -c src/MD2.c -o build/temp.freebsd-8.0-RC1-i386-2.6/src/MD2.o
cc1: error: unrecognized command line option "-mssse3"
error: command 'cc' failed with exit status 1
*** Error code 1
```

and i've already removed the -mssse3 cflag from /etc/make.conf and even tried the default compiler.


edit:

I ended up having to remove python and rebuild it without the mssse3 flag.

If anyone knows a method to patch py-crypto to make it ignore this flag, that would probably be better...i'm not up to that level of skill yet.


----------



## john_doe (Oct 3, 2009)

wonslung said:
			
		

> ports/security/py-openssl
> This port will not build with -mssse flag


either
	
	



```
.for port in py-openssl portfoo net-p2p/portbar
. if ${.CURDIR:M*/${port}}
   BLAH =
. endif
.endfor

.ifndef BLAH
  CFLAGS += -mssse3
.endif
```
or
	
	



```
.for port in py-openssl net/portfoo portbar
. if ${.CURDIR:M*/${port}}
   CFLAGS := ${CFLAGS:N-mssse3}
. endif
.endfor
```
However, you don't need to explicitly enable SSE extensions on gcc44. Just set -march=native and forget about them.`$  gcc44 -Q -march=native --help=target | fgrep sss
  -mssse3                                   [enabled]`
`$ gcc44 -dM -E -march=native - </dev/null | fgrep -i sss
#define __SSSE3__ 1`
`$ gcc44 -E -v -march=native - </dev/null |& fgrep cc1
 /usr/.../4.4.2/cc1 -E -quiet -v - -march=core2 -mcx16 -msahf -msse4.1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144 -mtune=core2`

You can do similar thing if you have several compilers installed
	
	



```
.for port in recode sdl12 libmad
. if ${.CURDIR:M*/${port}}
   CC =  gcc42
. endif
.endfor

.for port in nmap rtorrent* boost-libs wesnoth-devel
. if ${.CURDIR:M*/${port}}
   CXX = g++43
. endif
.endfor
```
You can compress this code further by writing some macro like it's done in /usr/share/mk/.

FYI, on gcc44 you can try to use -ftree-loop-distribution, -ftree-parallelize-loops or even graphite.


----------



## wonslung (Oct 3, 2009)

so set CPUTYPE = native and it will use all the best compiler based cpu stuff?

Does rtorrent-devel work with gcc43 or something?  Thanks, i'm very new to this part of building ports (i've always used default until i read the doc i linked in my first post)

do you have any /etc/make.conf files you could share with me regarding this?

thanks.


----------



## dennylin93 (Oct 3, 2009)

wonslung said:
			
		

> so set CPUTYPE = native and it will use all the best compiler based cpu stuff?



This is only supported by GCC 4.2 and above.


----------



## wonslung (Oct 3, 2009)

so that's a yes right?


----------



## dennylin93 (Oct 3, 2009)

The native option will automatically detect which instruction sets are supported by the CPU, so it should be a yes.


----------



## olivier (Oct 3, 2009)

Here are my results:

misc/getopt doesn't support CFLAGS+=-mssse3 with gcc44

devel/icu doesn't compil:


```
generating dependency information for ParagraphLayout.cpp
ParagraphLayout.cpp:816:6: error: #elif with no expression
gmake[1]: quittant le rÃ©pertoire Â« /usr/ports/devel/icu/work/icu/source/layoutex Â»
gmake[1]: entrant dans le rÃ©pertoire Â« /usr/ports/devel/icu/work/icu/source/layoutex Â»
generating dependency information for ParagraphLayout.cpp
ParagraphLayout.cpp:816:6: error: #elif with no expression
g++44  -I. -I./unicode -I./.. -I../common   -DU_LAYOUTEX_IMPLEMENTATION -pipe -mssse3 -g  -fvisibility=hidden -c   -o ParagraphLayout.ao 
ParagraphLayout.cpp
ParagraphLayout.cpp:816:6: error: #elif with no expression
gmake[1]: *** [ParagraphLayout.ao] Erreur 1
gmake[1]: quittant le rÃ©pertoire Â« /usr/ports/devel/icu/work/icu/source/layoutex Â»
gmake: *** [all-recursive] Erreur 2
*** Error code 1

Stop in /usr/ports/devel/icu.
*** Error code 1

Stop in /usr/ports/devel/icu.
```

sysutils/fusefs-kmod doesn't compil:


```
gcc44 -pipe -mssse3 -g -mssse3 -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=8000 --param 
inline-unit-growth=100 --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 
-mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow  -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector 
-std=iso9899:1999 -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith 
-Winline -Wcast-qual  -Wundef -Wno-pointer-sign -fformat-extensions -c fuse_main.c
cc1: error: unrecognized command line option "-fformat-extensions"
*** Error code 1

Stop in /usr/ports/sysutils/fusefs-kmod/work/fuse4bsd-498acaef33b0/fuse_module.
*** Error code 1
```

graphics/libGL doesn't compil:


```
mklib: Making FreeBSD shared library:  libGL.so.1
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: ../../../src/mesa/x86-64
/glapi_x86-64.o: relocation R_X86_64_PC32 against symbol `_gl_DispatchTSD' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: 'edition de lien finale en 'echec: 
Mauvaise valeur
collect2: ld returned 1 exit status
mklib: Installing libGL.so.1 libGL.so in ../../../lib
mv: rename libGL.so.1 to ../../../lib/libGL.so.1: No such file or directory
gmake[2]: *** [../../../lib/libGL.so] Erreur 1
gmake[2]: quittant le rÃ©pertoire Â« /usr/ports/graphics/libGL/work/Mesa-7.4.4/src/glx/x11 Â»
gmake[1]: *** [subdirs] Erreur 1
gmake[1]: quittant le rÃ©pertoire Â« /usr/ports/graphics/libGL/work/Mesa-7.4.4/src Â»
gmake: *** [default] Erreur 1
```

Then, here is my /etc/make.conf :


```
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc44)
.if empty(.CURDIR:M/usr/ports/devel/icu*) && empty(.CURDIR:M/usr/ports/sysutils/fusefs-kmod*) && empty(.CURDIR:M/usr/ports/graphics/libGL)
CC=gcc44
CXX=g++44
CPP=cpp44
.if empty(.CURDIR:M/usr/ports/misc/getopt) 
CFLAGS+=-mssse3
.endif
.endif
.endif
```


----------



## john_doe (Oct 3, 2009)

wonslung said:
			
		

> so set CPUTYPE = native and it will use all the best compiler based cpu stuff?


Yep. Don't use core2 with gcc44 because <bsd.cpu.mk> will override it with nocona/prescott. Well, I consider that file *evil* and have removed some overly "smart" parts inside it.





			
				wonslung said:
			
		

> Does rtorrent-devel work with gcc43 or something?


Find out it yourself. The app will either not compile or easily crash if you pick the wrong compiler. Sometimes it takes time to notice misbehavior e.g., in case devel/sdl12.





			
				wonslung said:
			
		

> do you have any /etc/make.conf files you could share with me regarding this?


No, my make.conf is quite messy and other than lists for gcc4{2,3,4} (assumes `cc' == `gcc45') contains much ad hoc stuff like 
- disable `-combine' for clang and replace `native' with `core2'
- enable -ggdb (*.symbols) for ports with kernel modules
- use MAKE_JOBS_UNSAFE for some non-marked ports
Some hacks are scattered across ports tree because it's impossible to do some things from make.conf e.g., add --enable-sse2 option to CONFIGURE_ARGS because make.conf is read *before* Makefile.
[cmd="rtorrent-devel $"]make -V .MAKEFILE_LIST
/usr/share/mk/sys.mk /etc/make.conf .. /usr/share/mk/bsd.compat.mk .. /usr/share/mk/bsd.cpu.mk .. .. Makefile...[/cmd]

FWIW, by using compiler from ports you might stumble upon some ports that assume GCC in FreeBSD doesn't search /usr/local/include by default e.g., ports/132579, ports/136917.


----------



## wonslung (Oct 3, 2009)

well, i understood SOME of that =)  

When i build rtorrent-devel with gcc44 it would core dump every time i tried to connect via scgi

rebuilding it with the default compiler didn't solve the issue...i don't know WHAT happened, i even tried rebuild ALL ports but i still ended up with an rtorrent that didn't work.   It was highly highly stupid of me to build it outside of a jail...but live and learn.  i only asked because i thought you may know, you mentioned it earlier but now i realize you were just using MY example.

what do you mean by the last statement?

As you can tell, i'm fairly new to THIS part of port building.  I am loving it...i've done a lot of googing but there is surprisingly little info on using other compilers


----------



## wonslung (Oct 3, 2009)

olivier said:
			
		

> Here are my results:



thanks, added to list.


----------



## john_doe (Oct 3, 2009)

olivier said:
			
		

> misc/getopt doesn't support CFLAGS+=-mssse3 with gcc44


As I said earlier you do not need to set machine specific CFLAGS for gcc44 and gcc45, -march= will do this for you.





			
				olivier said:
			
		

> ```
> generating dependency information for ParagraphLayout.cpp
> ParagraphLayout.cpp:816:6: error: #elif with no expression
> gmake[1]: quittant le rÃ©pertoire Â« /usr/ports/devel/icu/work/icu/source/layoutex Â»
> ...


I think replacing offending #elif's with #else should fix it.





			
				olivier said:
			
		

> ```
> gcc44 -pipe -mssse3 -g
> -mssse3 -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I../include -I. -I@ -I@/contrib/altq -finline-limit=8000 --param inline-unit-growth=100
> --param large-function-growth=1000 -fno-common  -fno-omit-frame-pointer -mcmodel=kernel -mno-red-zone  -mfpmath=387 -mno-sse -mno-sse2
> ...


Try to put smth like this in make.conf
	
	



```
.if ${CC:Mgcc44}
  CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
.endif
```


----------



## olivier (Oct 4, 2009)

Thanks a lot's Jhon_Doe!

*devel/icu* fix for gcc44:

Editing file: /usr/ports/devel/icu/work/icu/source/layoutex/ParagraphLayout.cpp
and replacing the #elif by a #else fix the problem.

*sysutils/fusefs-kmod* fix for gcc44 using this /etc/make.conf:

```
.if empty(.CURDIR:M/usr/ports/sysutils/fusefs-kmod)
CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
.endif
```

*www/firefox35* doesn't compil:


```
/usr/ports/www/firefox35/work/mozilla-1.9.1/js/src/jsnum.cpp:765: rÃ©fÃ©rence indÃ©finie vers << fedisableexcept >>
jsnum.o: dans la fonction << js_InitRuntimeNumberState >>:
/usr/ports/www/firefox35/work/mozilla-1.9.1/js/src/jsnum.cpp:687: rÃ©fÃ©rence indÃ©finie vers << fedisableexcept >>
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: libmozjs.so: hidden symbol 
`fedisableexcept' isn't defined
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: 'edition de lien finale en 'echec: 
Section non-reprÃ©sentable pour la sortie
jsnum.o: dans la fonction << js_InitNumberClass >>:
/usr/ports/www/firefox35/work/mozilla-1.9.1/js/src/jsnum.cpp:765: rÃ©fÃ©rence ind'efinie vers << fedisableexcept >>
jsnum.o: dans la fonction << js_InitRuntimeNumberState >>:
/usr/ports/www/firefox35/work/mozilla-1.9.1/js/src/jsnum.cpp:687: rÃ©fÃ©rence ind'efinie vers << fedisableexcept >>
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: js: hidden symbol `fedisableexcept' 
isn't defined
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: 'edition de lien finale en 'echec: 
Section non-reprÃ©sentable pour la sortie
collect2: ld returned 1 exit status
collect2: ld returned 1 exit status
gmake[3]: *** [libmozjs.so] Erreur 1
gmake[3]: *** Attente des tÃ¢ches non terminÃ©es....
gmake[3]: *** [js] Erreur 1
gmake[3]: quittant le rÃ©pertoire Â« /usr/ports/www/firefox35/work/mozilla-1.9.1/js/src Â»
gmake[2]: *** [libs_tier_js] Erreur 2
gmake[2]: quittant le rÃ©pertoire Â« /usr/ports/www/firefox35/work/mozilla-1.9.1 Â»
gmake[1]: *** [tier_js] Erreur 2
gmake[1]: quittant le rÃ©pertoire Â« /usr/ports/www/firefox35/work/mozilla-1.9.1 Â»
gmake: *** [default] Erreur 2
*** Error code 1
```

*net/liveMedia* doesn't compil


```
Media.cpp:21:20: error: Media.hh: No such file or directory
Media.cpp:22:24: error: HashTable.hh: No such file or directory
MediaSource.cpp:21:26: error: MediaSource.hh: No such file or directory
MediaSource.cpp:25: error: 'MediaSource' has not been declared
MediaSource.cpp:25: error: expected constructor, destructor, or type conversion before '(' token
MediaSource.cpp:29: error: expected constructor, destructor, or type conversion before '::' token
MediaSource.cpp:32: error: 'Boolean' does not name a type
MediaSource.cpp:36: error: 'MediaSource' has not been declared
MediaSource.cpp:36: error: non-member function 'const char* MIMEtype()' cannot have cv-qualifier
MediaSource.cpp:40: error: 'Boolean' does not name a type
MediaSource.cpp:43: error: 'Boolean' does not name a type
MediaSource.cpp:46: error: 'Boolean' does not name a type
MediaSource.cpp:49: error: 'Boolean' does not name a type
MediaSource.cpp:52: error: 'Boolean' does not name a type
MediaSource.cpp:55: error: 'Boolean' does not name a type
MediaSource.cpp:58: error: 'Boolean' does not name a type
MediaSource.cpp:61: error: 'Boolean' does not name a type
MediaSource.cpp:65: error: 'Boolean' does not name a type
MediaSource.cpp:82: error: 'MediaSource' has not been declared
MediaSource.cpp:82: error: non-member function 'void getAttributes()' cannot have cv-qualifier
MediaSource.cpp: In function 'void getAttributes()':
MediaSource.cpp:84: error: 'envir' was not declared in this scope
Media.cpp:27: error: expected ';' before '(' token
Media.cpp:29: error: ISO C++ forbids declaration of 'Medium' with no type
Media.cpp:29: error: expected ';' before '*' token
Media.cpp:32: error: 'Medium' has not been declared
Media.cpp:38: error: expected ')' before '&' token
Media.cpp:42: error: ISO C++ forbids declaration of 'UsageEnvironment' with no type
Media.cpp:42: error: expected ';' before '&' token
Media.cpp:43: error: ISO C++ forbids declaration of 'HashTable' with no type
Media.cpp:43: error: expected ';' before '*' token
*** Error code 1
Media.cpp:50: error: 'Medium' has not been declared
Media.cpp:50: error: expected constructor, destructor, or type conversion before '(' token
Media.cpp:60: error: expected constructor, destructor, or type conversion before '::' token
Media.cpp:65: error: 'Boolean' does not name a type
Media.cpp:76: error: 'Medium' has not been declared
Media.cpp:76: error: variable or field 'close' declared void
Media.cpp:76: error: 'UsageEnvironment' was not declared in this scope
Media.cpp:76: error: 'env' was not declared in this scope
Media.cpp:76: error: expected primary-expression before 'char'
Media.cpp:80: error: 'Medium' has not been declared
Media.cpp:80: error: variable or field 'close' declared void
Media.cpp:80: error: 'Medium' was not declared in this scope
Media.cpp:80: error: 'medium' was not declared in this scope
Media.cpp:86: error: 'Boolean' does not name a type
Media.cpp:90: error: 'Boolean' does not name a type
Media.cpp:94: error: 'Boolean' does not name a type
Media.cpp:98: error: 'Boolean' does not name a type
Media.cpp:102: error: 'Boolean' does not name a type
Media.cpp:106: error: 'Boolean' does not name a type
Media.cpp:110: error: 'Boolean' does not name a type
Media.cpp:114: error: 'Boolean' does not name a type
Media.cpp:121: error: expected constructor, destructor, or type conversion before '*' token
*** Error code 1
2 errors
*** Error code 2
1 error
*** Error code 1
```

Now, following your advice, I've changed my /etc/make.conf:

```
CPUTYPE?=native
.if !empty(.CURDIR:M/usr/ports/*) && exists(/usr/local/bin/gcc44)
.if empty(.CURDIR:M/usr/ports/graphics/libGL) && empty(.CURDIR:M/usr/ports/www/firefox35) && empty(.CURDIR:M/usr/ports/net/liveMedia*)
CC=gcc44
CXX=g++44
CPP=cpp44
.if empty(.CURDIR:M/usr/ports/misc/getopt)
CFLAGS+=-mssse3
.endif
.if empty(.CURDIR:M/usr/ports/sysutils/fusefs-kmod)
CWARNFLAGS := ${CWARNFLAGS:N-fformat-extensions}
.endif
.endif
.endif
```


----------



## wonslung (Oct 4, 2009)

olivier said:
			
		

> Thanks a lot's Jhon_Doe!



i added all this to the first post, thanks bro.  i hope if we keep doing this we might get a very nice list to help people.  

Also, if anyone finds a way to make the ones in thee "wont build" category to build, let us know.


----------



## thuglife (Oct 11, 2009)

I got into problems with the following ports and gcc44

audio/libmad
multimedia/gstreamer-ffmpeg
multimedia/libdvdread
x11/nvidia-driver

nvidia-driver uses -mno-align-long-strings and -fformat-extensions


----------



## john_doe (Oct 11, 2009)

olivier said:
			
		

> *net/liveMedia* doesn't compil
> 
> 
> ```
> ...


The port doesn't like *CPP* in your make.conf. I use symlinks, not sure how to fix it otherwise. You can do same as me, i.e.
make these symlinks in $HOME/bin:
cc -> /usr/local/bin/gcc44
gcc -> /usr/local/bin/gcc44
cpp -> /usr/local/bin/cpp44
c++ -> /usr/local/bin/g++44
g++ -> /usr/local/bin/g++44
gcov -> /usr/local/bin/gcov44 (optional)
basegcc -> /usr/bin/gcc
baseg++ -> /usr/bin/g++

add [cmd=]EXTRA_COMPILERS=basegcc baseg++[/cmd] into make.conf and reinstall devel/ccache
add [cmd=]PATH=/usr/local/libexec/ccache:$HOME/bin:$PATH[/cmd] to ~/.profile
define excludes that should use *basgcc*/*baseg++* in make.conf, e.g. /usr/src and some failing ports



			
				olivier said:
			
		

> CFLAGS+=-mssse3


I advised against doing so. [cmd=]-march=native[/cmd] detects and enables it when it's supported.


----------



## john_doe (Oct 11, 2009)

thuglife said:
			
		

> audio/libmad


[cmd=]-fforce-mem[/cmd] is nop on gcc42
`$ /usr/bin/gcc -fforce-mem - -E
cc1: warning: -f[no-]force-mem is nop and option will be removed in 4.3`
You can safely remove it from ${WRKSRC}/configure.





			
				thuglife said:
			
		

> multimedia/libdvdread


builds fine here using slightly old gcc44 (20091006) and gcc45 (20091001). Can you show error message?


----------



## john_doe (Oct 11, 2009)

wonslung said:
			
		

> devel/icu
> this requires an edit of the file /usr/ports/devel/icu/work/icu/source/layoutex/ParagraphLayout.cpp  replace #elif with #else then it should build


Can you submit a PR with patch for devel/icu? I'm a little discouraged after getting a dull response for trying to fix similar issue in security/cyrus-sasl2 (cf. ports/132573).


----------



## nickolaev (Oct 12, 2009)

I use my home FreeBSD server as an AV-UPNP transcoding server. So SSE3s will come right in place for me.

I use AMD Athlon64 X2 - FreeBSD 8.0RC1, amd64, gcc44, -mssse3 and CPUTYPE?=native


Here are my results:

*multimedia/xvid* - fails build with:

```
L: libxvidcore.so.4
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: image/x86_asm/qpel_mmx.o: relocation 
R_X86_64_PC32 against symbol `xvid_FIR_14_3_2_1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/gcc44/gcc/x86_64-portbld-freebsd8.0/4.4.2/../../../../../x86_64-portbld-freebsd8.0/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
```

I'll add new ones here - once I find such.


----------



## thuglife (Oct 12, 2009)

john_doe said:
			
		

> builds fine here using slightly old gcc44 (20091006) and gcc45 (20091001). Can you show error message?




```
===>  Building for libdvdread-4.1.3_1
cd obj && [B][color="Red"]gcc[/color][/B] -fPIC -DPIC -MD -O2 -pipe -mssse3 -march=native 
 -I/usr/local/include -fno-strict-aliasing  -Wall -funsigned-char -I/usr/ports/multimedia/libdvdread/work/libdvdread-4.1.3 
 -I"/usr/ports/multimedia/libdvdread/work/libdvdread-4.1.3"/src -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -DHAVE_CONFIG_H -DHAVE_DLFCN_H
 -I"/usr/ports/multimedia/libdvdread/work/libdvdread-4.1.3"/src -c -o dvd_input.so /usr/ports/multimedia/libdvdread/work/libdvdread-4.1.3/src/dvd_input.c
cc1: error: unrecognized command line option "-mssse3"
gmake: *** [dvd_input.so] Error 1
*** Error code 1

Stop in /usr/ports/multimedia/libdvdread.
```

weird...

Also, i found this http://www.freebsd.org/cgi/query-pr.cgi?pr=112997

is it still safe to use CPUTYPE=native without the patch?


----------



## john_doe (Oct 12, 2009)

thuglife said:
			
		

> Also, i found this http://www.freebsd.org/cgi/query-pr.cgi?pr=112997
> 
> is it still safe to use CPUTYPE=native without the patch?


The funny thing is even if you specify *core2* in CPUTYPE <bsd.cpu.mk> will drop the value down to prescott/nocona (i386/amd64) unconditionally. If a user specified incorrect data then the system should fail, not *lie* to him and pretend that all is OK.

Besides, there are other ways to populate MACHINE_CPU
	
	



```
MACHINE_CPU != ${CC} -Q --help=target -march=native - </dev/null \
                | awk '/tune/ { print $$2 }; /sse|mmx|3dnow|altivec/ && /enable/ { sub("-m",""); print $$1 }'

or

MACHINE_CPU != ${CC} -dM -E -march=native - </dev/null | awk '/SSE|MMX|3dNOW/ && !/MATH/ { gsub("__",""); gsub("_","."); print tolower($$2) }'
```
`$ make -V MACHINE_CPU -f a.mk
core2 sse sse2 sse3 sse4.1 ssse3`

The latter one should work even with gcc in base.


----------



## thuglife (Oct 13, 2009)

VirtualBox builds fine but it crashes on vm launch, binutils from ports are causing the problem.


----------



## morbit (Mar 26, 2010)

Doesn't build (install):


aspell

*-openoffice.org*

firefox3*

qt33* *appears to be fixed with png update

icu ( + 1 on filling a PR with simple fix http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg585685.html )

openldap*

dri2proto (fixed with 2.2)

dri

libGL

libGLU

libglut

openal

libgadu ( ~ not sure here)

mesa-demos*

nmap*

wavpack* (fixed with 4.60)

P.S. On core 2, -march=native adds -mcx16 -msahf beside -march=core2 (??)


```
gcc44 -march=native -E -v - </dev/null 2>&1 | sed -n 's/.* -v - //p'
```

Kind of a explanation -> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38749


----------



## volatilevoid (Mar 30, 2010)

john_doe said:
			
		

> ```
> .for port in py-openssl net/portfoo portbar
> . if ${.CURDIR:M*/${port}}
> CFLAGS := ${CFLAGS:N-mssse3}
> ...


A variation of the code above doesn't work for me:

```
.for port in xxx yyy
.if !${.CURDIR:M*/${port}}
CC=gcc44
...
.endif
.endfor
```
I want to exclude all ports in the list from being built with gcc44. Where's my error? Right now, all ports are built with gcc44, regardless if they are in the list or not.

And how to match ports with '-' in the name? Matching x11/nvidia-drivers for example doesn't work with

```
.if empty(.CURDIR:M/usr/ports/x11/nvidia-driver)
```
but with

```
.if empty(.CURDIR:M/usr/ports/x11/nvidia*)
```
Putting quotes around the name didn't work... :\


----------



## zenzo82 (Apr 19, 2010)

nickolaev said:
			
		

> *multimedia/xvid* - fails build with:
> 
> ```
> L: libxvidcore.so.4
> ...



same issue here with gcc45, any way to resolve this?


----------



## rossiya (Apr 22, 2010)

I notice on three boxes that icu4, and probably icu *don't* build without gcc44.  Which brings up the the question why we are running three year old system software?  I know some BSD gurus are on an anti-Stallman kick but their arguments elude me, while their fix is mostly vaporware.  x(

UPDATE: Actually icu does build on virgin 8.0 systems.  Then something protrudes in the filesystem that trips up subsequent icu builds.  Updating the autoconf, autobuilds don't help.  Nor does making the libraries consistent.  Somehow the patches fail to work 100%.  And yes gcc44 still makes a perfect icu4 build.  Just weird....

UPDATE: I used the divide and conquer approach to nail down libidn-1.15 as the cause of breakage in devel/icu.  Problem report submitted.


----------



## wonslung (Apr 23, 2010)

rossiya said:
			
		

> I notice on three boxes that icu4, and probably icu *don't* build without gcc44.  Which brings up the the question why we are running three year old system software?  I know some BSD gurus are on an anti-Stallman kick but their arguments elude me, while their fix is mostly vaporware.  x(



it has nothing to do with being "anti-stallman"

It's a question of license.   It's the same reason you dont' see ZFS in linux.


----------



## john_doe (May 26, 2010)

*wonslung*, you can probably remove firefox & libxul from your list due to ports/142736 and libGL & friends due to ports/144287.


----------



## morbit (May 27, 2010)

Speaking of LibGL, mesa-demos needs the same fix.


```
LDFLAGS="${PTHREAD_LIBS} -L${LOCALBASE}/lib -Wl,-Bsymbolic"
```


----------



## fairy (Jul 6, 2010)

john_doe said:
			
		

> ```
> .for port in nmap rtorrent* boost-libs wesnoth-devel
> . if ${.CURDIR:M*/${port}}
> CXX = g++43
> ...


Hmm, wesnoth-1.8.3 and boost-1.43 compiles fine with g++45 here.


----------



## sossego (Jul 6, 2010)

Some ports have to be built twice, so to say. Firefox is no exception.


```
/path/to/port# make
^C
# cd path/to/work_directory
#cd files && make (config)
<correct whatever errors>
#cd /path/to/port
#make install clean
```
Run make config and make depends whenever possible.
AS for GCC, I install a few versions. Port does a search and finds necessary version, all is good.


----------



## fairy (Jul 6, 2010)

I don't understand your pseudo example. What ports you need to build twice? What error they give you on first try?

firefox builds fine here from the first try.


----------



## sossego (Jul 7, 2010)

Not a pseudo example. I work with nonx86 hardware. It's necessary more often than not to enter the work directory.


----------



## fairy (Jul 7, 2010)

sossego said:
			
		

> Not a pseudo example.


I don't see error there. Only some arcane magic that you're performing.


			
				sossego said:
			
		

> I work with nonx86 hardware.


What one? powerpc?


			
				sossego said:
			
		

> It's necessary more often than not to enter the work directory.


And why it is? Unless you give me an example of error your sentence seem not more than gibberish to me.


----------



## sossego (Jul 7, 2010)

fairy said:
			
		

> I don't see error there. Only some arcane magic that you're performing.


http://en.wikipedia.org/wiki/Magic_(disambiguation) My apologies but I don't practice such, use such, or have read such.


			
				fairy said:
			
		

> What one? powerpc?


 A smart fool researches. You've done well my son.


			
				fairy said:
			
		

> And why it is? Unless you give me an example of error your sentence seem not more than gibberish to me.


 Use the same equipment and you wouldn't have to ask such. http://www.google.com/search?hl=en&...raigslist.org+$40&aq=f&aqi=&aql=&oq=&gs_rfai=
I'm sure that you can afford the $40 bucks for the machine.
There is also the option of stopping the make process to see if a subdirectory of work exists.


----------



## DutchDaemon (Jul 7, 2010)

Gentlemen, are we done with the increasingly prickly exchange? I'll happily give you both a week off if it continues. Thank you.


----------



## sossego (Jul 8, 2010)

Proof:


```
tima# uname -a
FreeBSD tima.tiza 9.0-20100418-SNAP FreeBSD 9.0-20100418-SNAP #0: Sun Apr 18 06:51:02 UTC 2010     root@dynode.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC  powerpc
tima# pwd
/usr/ports/net/xprobe
tima# ls
Makefile	distinfo	files		pkg-descr	pkg-plist	work
tima# ls work
.extract_done.xprobe2._usr_local	xprobe2-0.3
.patch_done.xprobe2._usr_local
tima# ls work/xprobe2-0.3
AUTHORS		CREDITS		README		cfg-scripts	docs		src
CHANGELOG	INSTALL		TODO		configure	etc
COPYING		Makefile.in	acconfig.h	configure.in	libs-external
tima# cd  work/xprobe2-0.3
tima# ./configure --help
`configure' configures this package to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
			  [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
			  [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR           user executables [EPREFIX/bin]
  --sbindir=DIR          system admin executables [EPREFIX/sbin]
  --libexecdir=DIR       program executables [EPREFIX/libexec]
  --datadir=DIR          read-only architecture-independent data [PREFIX/share]
  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
  --libdir=DIR           object code libraries [EPREFIX/lib]
  --includedir=DIR       C header files [PREFIX/include]
  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
  --infodir=DIR          info documentation [PREFIX/info]
  --mandir=DIR           man documentation [PREFIX/man]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
 --enable-debug       enable debugging )

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
 --with-libpcap-includes=DIR  libpcap include directory
 --with-libpcap-libraries=DIR  libpcap library directory
 --with-libusipp-includes=DIR  libusipp include directory
 --with-libusipp-libraries=DIR  libusipp library directory

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
              headers in a nonstandard directory <include dir>
  CXX         C++ compiler command
  CXXFLAGS    C++ compiler flags
  CXXCPP      C++ preprocessor

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

tima# ls src
Makefile.in		interface.h		scan_engine.h		xprobe.h
cmd_opts.cc		interface_con.cc	target.cc		xprobe_module.h
cmd_opts.h		interface_con.h		target.h		xprobe_module_hdlr.cc
config.h.in		log.cc			targets_list.cc		xprobe_module_hdlr.h
config_set.cc		log.h			targets_list.h		xprobe_module_param.cc
config_set.h		os_matrix.cc		xplib			xprobe_module_param.h
defines.h.in		os_matrix.h		xpmodules		xprobe_timeval.h
interface.cc		scan_engine.cc		xprobe.cc
tima# ls src/*
src/Makefile.in			src/interface_con.h		src/targets_list.h
src/cmd_opts.cc			src/log.cc			src/xprobe.cc
src/cmd_opts.h			src/log.h			src/xprobe.h
src/config.h.in			src/os_matrix.cc		src/xprobe_module.h
src/config_set.cc		src/os_matrix.h			src/xprobe_module_hdlr.cc
src/config_set.h		src/scan_engine.cc		src/xprobe_module_hdlr.h
src/defines.h.in		src/scan_engine.h		src/xprobe_module_param.cc
src/interface.cc		src/target.cc			src/xprobe_module_param.h
src/interface.h			src/target.h			src/xprobe_timeval.h
src/interface_con.cc		src/targets_list.cc

src/xplib:
Makefile.in		xp_get_interface.h	xp_get_src_addr.cc	xp_sha1.h
README			xp_get_ping_payload.cc	xp_get_src_addr.h	xplib.h
xp_get_iface_addr.cc	xp_get_ping_payload.h	xp_lib.cc
xp_get_iface_addr.h	xp_get_random_data.cc	xp_lib.h
xp_get_interface.cc	xp_get_random_data.h	xp_sha1.cc

src/xpmodules:
Makefile.in		modules_proto		static_modules.h
alive_probe		os_probe
tima#
```



```
timey# uname -a
FreeBSD timey.time 8.0-RELEASE FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
timey# ls
Makefile	distinfo	files		pkg-descr	pkg-plist	work
timey# ls work
.extract_done.xprobe2._usr_local	xprobe2-0.3
.patch_done.xprobe2._usr_local
timey# ls work/xprobe2-0.3
AUTHORS		CREDITS		README		cfg-scripts	docs		src
CHANGELOG	INSTALL		TODO		configure	etc
COPYING		Makefile.in	acconfig.h	configure.in	libs-external
timey# cd  work/xprobe2-0.3
timey# ls src
Makefile.in		interface.h		scan_engine.h		xprobe.h
cmd_opts.cc		interface_con.cc	target.cc		xprobe_module.h
cmd_opts.h		interface_con.h		target.h		xprobe_module_hdlr.cc
config.h.in		log.cc			targets_list.cc		xprobe_module_hdlr.h
config_set.cc		log.h			targets_list.h		xprobe_module_param.cc
config_set.h		os_matrix.cc		xplib			xprobe_module_param.h
defines.h.in		os_matrix.h		xpmodules		xprobe_timeval.h
interface.cc		scan_engine.cc		xprobe.cc
timey#
```


If anyone doubts the validity of these statements then you can do the following.
Go to any port and start building.
CTRL+C after the file begins to build.
List the contents.

Now, in each subdirectory, you can further configure the application(s) beyond what is listed with make config arguments.

I don't need to apologize because I'm not wrong.


----------



## fairy (Jul 8, 2010)

Tried to run a diff(1) on your output and didn't see the difference. What it's a proof of?


			
				sossego said:
			
		

> in each subdirectory, you can further configure the application(s) beyond what is listed with make config arguments.


So? If you're dissatisfied with `make config' (e.g. doesn't have options you're interested with) then bug the maintainer. I fail to see any error nor smth specific or odd in powerpc case.

Besides, net/xprobe should be marked as MAKE_JOBS_UNSAFE or simple patch to fix it should be applied
	
	



```
--- Makefile.in~
+++ Makefile.in
@@ -43,8 +43,8 @@ SIG=md5sum -b
 
 
 all: 
-    cd libs-external/USI++/src; ${MAKE}
-    cd src; ${MAKE}
+    (cd libs-external/USI++/src; ${MAKE})
+    (cd src; ${MAKE})
 
 
 clean:
```
There are a few other things broken in that port, see ports/148451.


----------



## sossego (Jul 8, 2010)

I run ./configure from the subdirectory of /usr/ports/$SECTION/$PORT/work/$PORTS_SOURCE/$FILES when possible and can usually see where the error occurs. At times, one can just edit the file.


----------



## fairy (Jul 8, 2010)

sossego said:
			
		

> I run ./configure from the subdirectory of /usr/ports/$SECTION/$PORT/work/$PORTS_SOURCE/$FILES when possible


If configure target fails you usually have WRKSRC/config.log around.`$ less $(make -V WRKSRC)/config.log`


			
				sossego said:
			
		

> At times, one can just edit the file.


The user is not supposed to descend into WRKSRC and touch any files by hand there. Any issue with building ports should be reported to respective maintainer or gnats.


----------



## sossego (Jul 8, 2010)

I usually don't check for config logs; so, thanks for the tip. (No sarcasm.)
Being that compiling for ppc is a touch and go process, I need to find the exact error.
Example from earlier was firefox.
I had to change libxul to libxul-devel and firefox ot firefox-devel with patches. 
I ran ./configure and make| gmake- depending on file- in $WORK/$SUBDIRECTORIES to see what would function.


```
/usr/ports/www/elinks/work/elinks-0.11.7/src/session/download.c:692: warning: warning: tempnam() possibly used unsafely; consider using mkstemp()
```
Just did this with gmake from the subdirectory. That was the error. Yesterday, replaced 





> tempnam


 with 





> mkstmp


 and the build broke. I'm rerunning it now- new source- to see if the error only occurs in subdirectory.


----------



## sossego (Jul 8, 2010)

I just reran the build with:

```
#cd work/$SOURCE/src
#gmake
#cd ..
#gmake
#cd ..
#ls (to see if I missed something)
# cd ..
(In /usr/ports/www/elinks$DIR)
# gmake
#make install clean
```
And.....
it worked.

1.) Normal make doesn't always work. See above.
2.) It is necessary at times to run ./configure from work. This is at times a processor "dependency" or "problem" if you will.
3.) Make or gmake may have to be ran from $SUBDIRECTORY to each higher directory to correct the build.
4.) It's a learning experience.
5.) It's just plain fun and enjoyable to do at times.


----------



## fairy (Jul 8, 2010)

sossego said:
			
		

> I had to change libxul to libxul-devel and firefox ot firefox-devel with patches.


libxul-devel is only available in svn-gecko repository. If you're hacking ports you'd get *better* responses on freebsd-ports@.





			
				sossego said:
			
		

> warning: tempnam() possibly used unsafely; consider using mkstemp()


Warnings shouldn't break build unless you have -Werror in CFLAGS. BTW, sometimes you can force build to be verbose by
`$ make V=1`


			
				sossego said:
			
		

> 2.) It is necessary at times to run ./configure from work. This is at times a processor "dependency" or "problem" if you will.


Only when you're hacking port and even then should better be avoided. bsd.port.mk supplies a few not very noticeable environment variables and configure args by default to configure script. And dependencies usually can be inspected from a more human-readable configure.(ac|in).

Most of the time you can restart configure or build target by simply typing `make'. make(1) and gmake(1) is smart enough to not try to compile sources again.


----------



## morbit (Jul 10, 2010)

After recent update graphics/mupdf installation ends with sed error.

(Who needs update which adds dependencies and breaks the build with newer compiler, eh?)


----------



## fairy (Jul 12, 2010)

graphics/mupdf builds and installs fine here on /head@amd64 + gcc45. You can try the patch in ports/148503 if you have relatively old machine that's broken by optimization.


----------



## morbit (Jul 12, 2010)

fairy said:
			
		

> if you have relatively old machine that's broken by optimization.



Only If you consider fresh STABLE old and -march=native silly optimization.


```
===>  Patching for mupdf-0.6,1
sed: 1: "s/CC = .*/CC = /usr/loc ...": bad flag in substitute command: 'u'
*** Error code 1
```


----------



## fairy (Jul 12, 2010)

The port overrides `-march=native' with `-march=k8'. Besides, on gcc45 -march=native implies -msse[12345] depending on actual support and -ftree-vectorize is enabled when you specify -O3. In short the port should not try to outsmart its user. I for one have following CFLAGS in make.conf

```
CPUTYPE ?= native # for -march=native
DEBUG_FLAGS ?= -ggdb
SSP_CFLAGS ?= -fstack-protector
LTO_CFLAGS ?= -flto -fuse-linker-plugin
OPTIMIZE ?= -O3
CFLAGS += ${OPTIMIZE} ${DEBUG_FLAGS} ${SSP_CFLAGS}

.for port in git xmp zsh emacs*
. if ${.CURDIR:M*/${port}}
CFLAGS += ${LTO_CFLAGS}
. endif
.endfor
```
and override *cc* within PATH so I can build 32bit ports on amd64 or use gcc45 by default. If something goes weird I can always override optimization to empty string from command line to check that it doesn't break build/runtime. Any optimization beyond `-march=native' + `-O3' usually give much headache, especially smth like lto or graphite.

That sed(1) error is because you use full path that contains slashes. Do you distrust you own PATH that much?


----------



## morbit (Jul 12, 2010)

Thanks for hint with full path, it was in plain sight and couldn't see it 

BTW, stack-protector is not safe to turn on everywhere, e.g. after I recompiled all ports with it, I couldn't build png anymore.


----------



## fairy (Jul 12, 2010)

morbit said:
			
		

> BTW, stack-protector is not safe to turn on everywhere, e.g. after I recompiled all ports with it, I couldn't build png anymore.


I turned it on recently and recompiled a few ports with it including graphics/png. So far I haven't been hit by *__stack_chk_fail_local* being hidden as you can see in this thread.

see also https://wiki.ubuntu.com/CompilerFlags


----------



## morbit (Jul 12, 2010)

The problem was not with building png with stack-protector, but rebuilding it (and mksh as well) after all ports were compiled with stack-protector.

Cherry picking ports for stack-protection usually works, it was after full ports recompile I have been hit by corner cases stick I suppose, so I chose to stay with more tested configuration.


----------



## fairy (Jul 15, 2010)

morbit said:
			
		

> The problem was not with building png with stack-protector, but rebuilding it (and mksh as well) after all ports were compiled with stack-protector.


It doesn't make sense, *all-depends-list* is empty for graphics/png. And I have gcc/binutils built with -fstack-protector.



			
				morbit said:
			
		

> Cherry picking ports for stack-protection usually works, it was after full ports recompile I have been hit by corner cases stick I suppose, so I chose to stay with more tested configuration.


I can't reproduce it even after rebuilding all my ports and graphics/mupdf that I don't use. The only times I encountered hidden symbol errors were when I tried to enable LTO for them but that didn't involve SSP.


----------



## morbit (Jul 15, 2010)

> It doesn't make sense, all-depends-list is empty for graphics/png. And I have gcc/binutils built with -fstack-protector.



So it seems, If i reckon correctly one of the internal test of png have triggered "stack smashing detected" and build was automatically terminated. But maybe I'm talking gibberish, point is, there have been reports of ports (mis)compiling silently with stack-protection on FreeBSD list, so it's certainly not impossible, and I remember that I couldn't build mksh as well. The problem went away after I rebuild ports (gcc) with base compiler, and only then I could again build those ports with gcc44(5).

Sure, I didn't debug it fully, but this is how it was.


----------



## fairy (Jul 15, 2010)

morbit said:
			
		

> So it seems, If i reckon correctly one of the internal test of png have triggered "stack smashing detected" and build was automatically terminated.


Not in the thread I pointed to you earlier. In there dougb@ had *__stack_chk_fail_local* being hidden in his libc for some mysterious reason while it isn't hidden in snapshots. Since he didn't try use libc from snapshot I still believe that was the cause of the problem.





			
				morbit said:
			
		

> I remember that I couldn't build mksh as well.


I don't have problem compiling shells/mksh by gcc45 with -fstack-protector.


----------



## interfasys (Aug 23, 2010)

What is the strategy to update gcc once it's installed?

"make deinstall" followed by "make reinstall" won't work since gcc45 will disappear after the first step.
"make deinstall" followed by pkg_add gcc45 and "make reinstall" will leave 2 similar packages in the list of installed ports


----------



## camelia (Aug 24, 2010)

interfasys said:
			
		

> "make deinstall" followed by "make reinstall" won't work since gcc45 will disappear after the first step.


Just do a *build* (or *all*) target before issuing *deinstall*. When I'm lazy to run portmaster I usually run`$ make {,{de,}inst}all clean`in zsh (works in tcsh, too). That magic expands to *all deinstall install*.

When *gold* starts to complain about missing symbol like GLIBCXX_3.4.10 during *install* then I just stuff libstdc++.so from zfs snapshot, e.g.
`$ sudo LD_LIBRARY_PATH=/.zfs/snapshot/auto-<my_date>/$LOCALBASE/lib/gcc45 make install`or save a copy of the lib beforehand where rtld can find it. BTW, if you don't have this problem then you're probably linking *gold* against old libstdc++.so from base. The issue is related to ports/148196, /etc/rc.d/ldconfig altering workaround there makes rtld(1) and ld(1) always use libstdc++.so from gcc45.





			
				interfasys said:
			
		

> "make deinstall" followed by pkg_add gcc45 and "make reinstall" will leave 2 similar packages in the list of installed ports


gcc45 package should conflict with the port since they have same origin, lang/gcc45.


----------



## interfasys (Aug 24, 2010)

camelia said:
			
		

> Just do a *build* (or *all*) target before issuing *deinstall*. When I'm lazy to run portmaster I usually run`$ make {,{de,}inst}all clean`in zsh (works in tcsh, too). That magic expands to *all deinstall install*.


I usually do a `$ make` to see if everything went fine and then issue the `$ deinstall`followed by`$ reinstall`
You're telling me to do a `$ make all deinstall install`
?


			
				camelia said:
			
		

> When *gold* starts to complain about missing symbol like GLIBCXX_3.4.10 during *install* then I just stuff libstdc++.so from zfs snapshot, e.g.
> `$ sudo LD_LIBRARY_PATH=/.zfs/snapshot/auto-<my_date>/$LOCALBASE/lib/gcc45 make install`or save a copy of the lib beforehand where rtld can find it.


Interesting...



			
				camelia said:
			
		

> BTW, if you don't have this problem then you're probably linking *gold* against old libstdc++.so from base. The issue is related to ports/148196, /etc/rc.d/ldconfig altering workaround there makes rtld(1) and ld(1) always use libstdc++.so from gcc45.


That's what I've been using and it's worked quite well.



			
				camelia said:
			
		

> gcc45 package should conflict with the port since they have same origin, lang/gcc45.


Yeah, but that means two entries for the same files. I'm surprised that `$ make install` didn't get rid of the old entry.


----------



## interfasys (Aug 24, 2010)

`$ make all deinstall install`

```
ccache: FATAL: Could not find compiler "gcc45" in PATH
```


----------



## camelia (Aug 25, 2010)

lang/gcc45 shouldn't invoke compiler/linker during *install* step. If it is then it's a bug.

But I rarely test specifying CC/CXX myself since I use symlinks in PATH (just after ccache dir):
	
	



```
cc -> gcc45
gcc -> gcc45
c++ -> g++45
g++ -> g++45
cpp -> cpp45
gcov -> gcov45
basegcc -> /usr/bin/gcc
baseg++ -> /usr/bin/g++
```
It also reduces the number of symlinks I need for -m32 wrapper. And not having to worry about programs that may not respect CC/CXX is good, too.


----------



## interfasys (Aug 25, 2010)

camelia said:
			
		

> lang/gcc45 shouldn't invoke compiler/linker during *install* step. If it is then it's a bug.


OK, but I'm surprised that nobody else ran into it.


----------



## interfasys (Aug 25, 2010)

archivers/arj and php5.2 don't work with gcc45+gold


----------



## camelia (Aug 26, 2010)

I'm not sure what issue you have with php5.2. Runtime? Compiletime? I don't use php but lang/php52 compiles (gcc45+gold and default options) and php(1) runs "hello world" fine.

That ld script for arj port can be thrown away. However, the segfault is harder to fix. I think gold also mislinks at least
lang/ghc
www/w3m
x11-servers/xorg-server and friends, e.g. xephyr

Moreover, you can't build lang/sbcl using binutils from ports whether gold or ld. I suspect it's related to default ld script.


----------



## interfasys (Aug 26, 2010)

camelia said:
			
		

> I'm not sure what issue you have with php5.2. Runtime? Compiletime? I don't use php but lang/php52 compiles (gcc45+gold and default options) and php(1) runs "hello world" fine.


I haven't tried from ports, but straight from source. It's a runtime problem and the executable only segfaults if I build php with  --with-apxs2.


----------



## interfasys (Sep 3, 2010)

pop3-login of dovecot 2 segfaults when started.


----------

