Resolved: Attempting to build a port uses a stale make(1) configuration

Австин Ким avstin at mail.ru
Wed Nov 14 01:02:30 UTC 2012


Втр 13 Ноя 2012 04:10:46 от Австин Ким <avstin at mail.ru>:
> Hi, all,
> 
> While attempting to build the KDE 4 port, the build of /usr/ports/astro/gpsd (which recursively got pulled in somewhere) failed because make(1) tried to build using a version of GCC that I had installed from ports at one time but long since `make deinstall'ed:
> 
> ...
> cc -o gpxlogger.o -c -D_GNU_SOURCE -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -O2 -pipe -O3 -march=native -fno-strict-aliasing gpxlogger.c
> cc -o gpxlogger -Wl,-rpath=//usr/local/lib gpxlogger.o -L. -L/usr/local/lib -lrt -lgps -lm
> cc -o lcdgps.o -c -D_GNU_SOURCE -Wextra -Wall -Wno-uninitialized -Wno-missing-field-initializers -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -O2 -pipe -O3 -march=native -fno-strict-aliasing lcdgps.c
> cc -o lcdgps -Wl,-rpath=//usr/local/lib lcdgps.o -L. -L/usr/local/lib -lrt -lgps -lm
> gcc48 -o gpsclient-py_2_7_3_final_0.so -c -fno-strict-aliasing -O2 -pipe -O3 -march=native -fno-strict-aliasing -fPIC -DNDEBUG -O2 -pipe -mfpmath=sse,387 -march=pentium4 -fno-strict-aliasing -I/usr/local/include/python2.7 gpsclient.c
> gcc48: not found
> scons: *** [gpsclient-py_2_7_3_final_0.so] Error 127
> scons: building terminated because of errors.
> *** [do-build] Error code 2
> 
> Stop in /usr/ports/astro/gpsd.
> *** [build] Error code 1
> 
> Stop in /usr/ports/astro/gpsd.
> 
> 
> At one time I had installed GCC 4.8.0 from ports, but later removed it (due to stability issues), reverting back to using the default system compiler.  I removed the /usr/ports/lang/gcc48 port using `make deinstall,' and then removed any mention of `*48' from /etc/make.conf.  However, when make(1) tries to build /usr/ports/astro/gpsd above, it apparently tries to use an old setting of `CC=gcc48' and old settings of `CPUTYPE=pentium4' and `CCFLAGS+=-mfpmath=sse,387' that I once had in /etc/make.conf but long since deleted.
> 
> Any ideas where these stale make/build configurations might be lingering?  I suspect that the old options may be in some Python-related config file somewhere, but I have so far not been able to find where.  I know this doesn't give a lot to go on, but can anyone suggest possible places to try looking for stale configuration files?
> 
> Thanks in advance!
> Austin Kim

Never mind; I figured it out.

Shortly after bringing my FreeBSD system up, I installed GNU GCC 4.8.0 from Ports (/usr/ports/lang/gcc48) and set `CC=gcc48,' `CXX=g++48,' `CPP=cpp48,' et al., in /etc/make.conf.  Then, as other ports got built under this configuration, Python 2.7 (/usr/ports/lang/python27) got pulled in for the ride, and when that was built, the above settings made their way into /usr/local/lib/python2.7/config/Makefile:

...
CC=             gcc48
CXX=            g++48
...
CONFIG_ARGS=     '--with-threads' '--enable-unicode=ucs4' '--enable-ipv6' '--with-fpectl' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=i386-portbld-freebsd9.1' 'build_alias=i386-portbld-freebsd9.1' 'CC=gcc48' 'CFLAGS=-O2 -pipe -mfpmath=sse,387 -march=pentium4  -fno-strict-aliasing' 'LDFLAGS= -pthread' 'CPPFLAGS=' 'CPP=cpp48'
...

Later, after deinstalling GCC 4.8 and reverting back to using the FreeBSD system compiler, the vestigial settings above would on occasion get invoked when building other ports that presumably used scons or other Python-related build mechanisms, causing the `gcc48: not found' error above.  Reinstalling the Python 2.7 port from scratch with the updated /etc/make.conf fixed the problem.

Judging from the (lack of) responses, I guess no one else has run into issues arising from using different compilers or compiler versions at different times to build ports :)


More information about the freebsd-questions mailing list