# Cannot build lang/gcc with Poudriere but build plain ports



## msi (Dec 27, 2013)

I'm still pretty new to FreeBSD (pfSense mostly until now) but have been having fun with the new 10.0 features (ZFS on root installer is really cool!) and was building my own set of packages using Poudriere. I mostly kept following the Poudriere guide from the BSDNow podcast but have also been looking at the official Poudriere document which worked for a couple of things where I wanted to enable some feature not enabled in default packages. I wanted to build some packages that need lang/gcc like openjdk7 and virtualbox-ose-additions in order to build but I tried both with bootstrap and without Java - nevertheless it always fails


```
checking for suffix of object files... configure: error: in `/wrkdirs/usr/ports/lang/gcc/work/build/x86_64-portbld-freebsd10.0/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
gmake[3]: *** [configure-stage1-target-libgcc] Error 1
gmake[3]: Leaving directory `/wrkdirs/usr/ports/lang/gcc/work/build'
[...]
```

However when I install all build dependencies with pkg (gmake, gmp etc.) and do a `make install clean` on the plain ports tree the build passes? I'm looking quite puzzled at my make.conf for that Poudriere jail and haven't yet found a way to look further:


```
WITH_PKGNG=yes
CPUTYPE?=atom          # Building for an Atom D510, guess that's OK
CC=clang        
CXX=clang++     
CPP=clang-cpp
CFLAGS+=-Qunused-parameter -Qunused-arguments
FETCH_BEFORE_ARGS=-p4 -T 10
MASTER_SITE_BACKUP?= \
http://ftp.ch.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR/}
RANDOMIZE_MASTER_SITES=yes
OPTIONS_UNSET= DEBUG HELP STATIC GNUTLS DOCS EXAMPLES \
           PTH DBUS SOUND ALSA PULSEAUDIO \
           DOCBOOK CUPS TESTS HTMLDOCS BONJOUR APIDOCS
# compared to BSDnow's tutorial I remove unset of things IDN since I'd like to have that
.if ${.CURDIR}=="/usr/ports/editors/vim"
WITH_VIM_OPTIONS=yes
WITHOUT_X11=yes
.endif
```

The GCC error is quite generic and points to configuration issues - I guess since the issue was consistent on 10.0-RC1, RC2 and RC3 the problem is likely more due to PEBKAC.

Any pointer would be appreciated


----------



## kpa (Dec 27, 2013)

*Re: Cannot build lang/gcc with poudriere but build plain por*

Try commenting out your compiler variables, CC, CXX and CPP. Also CFLAGS. The default compiler in FreeBSD is clang(1) anyway and overriding those variables may do more harm than good.


----------



## msi (Dec 27, 2013)

*Re: Cannot build lang/gcc with poudriere but build plain por*

I tried removing the mentioned CC, CXX and CPP but that didn't make the difference at first. It turns out CFLAGS proposed by BSDnow are to blame somehow, with both together or just one but all variants caused the build to fail after roughly 4 minutes (on that particular machine). 

The build of gcc just passed with the same make.conf except for removed CFLAGS. But I'll also remove the CC, CXX and CPP as on 10.x don't make sense anymore, I'll ping the BSDnow guys so they know about that (and possibly fix) in the tutorial.  Thanks @kpa!

Edit: Seems the two arguments are not known by GCC but clang and possibly that makes it choke during bootstrap of gcc (the build log is just to vast to read all)


----------

