# gcc fails to build - 10.1 release



## DrObscure (Jul 28, 2015)

In trying to get gcc in ports to build I find the following errors being generated..

--- standard run ---

```
===>  Building for gcc-4.8.5
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 26: Missing dependency operator
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 27: Need an operator
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 28: Need an operator
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 777: Missing dependency operator
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 778: Could not find
gmake[2]: "/ports/lang/gcc/work/build/Makefile" line 779: Need an operator
gmake[2]: Fatal errors encountered -- cannot continue
gmake[2]: stopped in /ports/lang/gcc/work/build
*** Error code 1
```

---- tail of make debug run ----

```
ParseReadLine (17488): 'MAKEOVERRIDES='
Global:MAKEOVERRIDES =
Global:delete .PARSEDIR
Global:delete .PARSEFILE
gmake[2]: Fatal errors encountered -- cannot continue
gmake[2]: stopped in /ports/lang/gcc/work/build
Applying[MAKE_PRINT_VAR_ON_ERROR] :mad: to ""
Modifier pattern: "v"
Modifier pattern: "$v='${$v}'
"
Result[MAKE_PRINT_VAR_ON_ERROR] of :mad: is ""
+ [ -n '' ]
+ false

*** Failed target:  do-build
*** Failed command: (cd /ports/lang/gcc/work/build; if ! /usr/bin/env XDG_DATA_HOME=/ports/lang/gcc/work XDG_CONFIG_HOME=/ports/lang/gcc/work HOME=/ports/lang/gcc/work NO_PIE=yes SHELL=/bin/sh NO_LINT=YES ADDR2LINE="/usr/local/bin/addr2line" AR="/usr/local/bin/ar" AS="/usr/local/bin/as" CPPFILT="/usr/local/bin/c++filt" GPROF="/usr/local/bin/gprof" LD="/usr/local/bin/ld" NM="/usr/local/bin/nm" OBJCOPY="/usr/local/bin/objcopy" OBJDUMP="/usr/local/bin/objdump" RANLIB="/usr/local/bin/ranlib" READELF="/usr/local/bin/readelf" SIZE="/usr/local/bin/size" STRINGS="/usr/local/bin/strings" PREFIX=/usr/local LOCALBASE=/usr/local LIBDIR="/usr/lib" CC="cc" CFLAGS="-O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing" CPP="cpp" CPPFLAGS="-DLIBICONV_PLUG" LDFLAGS="" LIBS="" CXX="c++" CXXFLAGS="-O2 -pipe -DLIBICONV_PLUG -fno-strict-aliasing -DLIBICONV_PLUG" MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -s -m 555" BSD_INSTALL_LIB="install -s -m 444" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="install -m 444" gmake -f Makefile MAKEINFOFLAGS="--no-split" all; then if [ -n "" ] ; then echo "===> Compilation failed unexpectedly."; (echo "") | /usr/bin/fmt 75 79 ; fi; false; fi)
*** Error code 1

Stop.
make[1]: stopped in /ports/lang/gcc
Global:.ERROR_TARGET = do-build
Applying[MAKE_PRINT_VAR_ON_ERROR] :mad: to ""
Modifier pattern: "v"
Modifier pattern: "$v='${$v}'
"
Result[MAKE_PRINT_VAR_ON_ERROR] of :mad: is ""

*** Failed target:  stage
*** Failed command: cd /ports/lang/gcc && make CONFIG_DONE_GCC=1 /ports/lang/gcc/work/.stage_done.gcc._usr_local
*** Error code 1

Stop.
make: stopped in /ports/lang/gcc
Global:.ERROR_TARGET = stage
Applying[MAKE_PRINT_VAR_ON_ERROR] :mad: to ""
Modifier pattern: "v"
Modifier pattern: "$v='${$v}'
"
Result[MAKE_PRINT_VAR_ON_ERROR] of :mad: is ""
```


----------



## talsamon (Jul 28, 2015)

Try to compile lang/gcc48 - if the same error appears.


----------



## talsamon (Jul 28, 2015)

After the install of the Base-System you should make an update. The .iso is always older, than the recent packages.


```
freebsd-update fetch 
freebsd-update instal

portsnap fetch update

portmaster -a  -w
```


----------



## DrObscure (Jul 28, 2015)

talsamon said:


> Try to compile lang/gcc48 - if the same error appears.



Yes.. the same error is there too...


----------



## DrObscure (Jul 28, 2015)

talsamon said:


> After the install of the Base-System you should make an update. The .iso is always older, than the recent packages.



This system is a very recent (ie, days old) install from the net, and I have done a daily `portsnap fetch update`.

What else should I have to update to maintain consistency here? Do I need to rebuild the world just to compile GCC?


----------



## talsamon (Jul 28, 2015)

Something is weird on your system.

Try to put this as first line

```
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
```
in
/usr/ports/lang/gcc/work/build/Makefile


----------



## DrObscure (Jul 28, 2015)

talsamon said:


> Something is weird on your system.
> 
> Try to put this as first line
> 
> ...



Added it as suggested... no change to the build..


----------



## talsamon (Jul 28, 2015)

Try to recompile devel/gmake.

And please, post the output of `locale`.


----------



## talsamon (Jul 28, 2015)

Could cause errors, but I believe that's not in this case.
It seems `make clean` or `make install clean`, does not clean the depends anymore. Use instead `make clean clean-depends` or `make install clean clean-depends`. (The reason for this I don't know).


----------



## DrObscure (Jul 28, 2015)

talsamon said:


> Try to recompile devel/gmake.
> 
> And please, post the output of `locale`.



Recompile went fine, as expected..


```
LANG=
LC_CTYPE="C"
LC_COLLATE="C"
LC_TIME="C"
LC_NUMERIC="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
```


----------



## talsamon (Jul 28, 2015)

`locale` is ok.
If lang/gcc now have the same error, I have no idea in the moment.


----------



## DrObscure (Jul 28, 2015)

Well, lang/gcc, lang/gcc48, and lang/gcc47 all fail in the identical way...

Thinking about just wiping the slate clean and doing a complete reinstall...sigh...
this is an older machine so it takes a while .. especially the Xorg pkg ..

Oh well.. fun with FreeBSD ..I'm used to it after all these years .. (20 or so now)


----------

