svn commit: r427110 - head/lang/gcc/files [does lang/gcc49 need such too?]

Mark Millard markmi at
Sun Dec 11 22:59:40 UTC 2016

[After "BUILD_DEPENDS+= gcc6:lang/gcc6" below shows that
portmaster does not do what you indicate the build environment
should do. The beginning is not essential material.]

On 2016-Dec-11, at 4:40 AM, Gerald Pfeifer <gerald at> wrote:

> On Sun, 11 Dec 2016, Mark Millard wrote:
>> I reported already that devel/kBuild/Makefile has in its
>> Makefile:
>> USE_GCC=  any
>> and devel/kBuild is what causes the lang/gcc* build. (I
>> reported more than that but it is the part relevant here.)
> I had read that, and I di investigate.

It was just setup material (context) for what followed. I
had no doubt that you had looked into what I'd reported.

> USE_GCC=any is the equivalent of USE_GCC=4.2+, and lang/gcc6 and
> lang/gcc6-devel should both meet this requirement.
> (In general, do not use a gcc*-devel port unless you really want 
> or need to, though; use the corresponding gcc* port instead.)

In genreal I have avoided *-devel's but with with -r428312 having
updated the likes of devel/powerpc64-gcc and devel/amd64-gcc and
such to be 6.2.0 based I was exploring what combinations of 6.2.0
installations were compatible vs. not.

Historically on, e.g., powerpc64, devel/powerpc64-gcc and the
matching lang/gcc* by version conflicted so I picked an alternate
lang/gcc* if a devel/powerpc64-gcc updated to match what I already
had from lang/gcc* .

>> Additional information (gained later) is that if I "pkg delete 
>> gcc6-devel" then instead of devel/kBuild trying to install lang/gcc6 
>> it tries to install lang/gcc (no number).
> That works as designed.  USE_GCC=yes defaults to lang/gcc.  USE_GCC=any 
> tries to use an existing GCC system compiler and lang/gcc by default if 
> none is present.


>> If I clean that out and put back lang/gcc6-devel and try again it 
>> goes back to trying to install lang/gcc6 .
> That is a little odd.  It means gcc6 from lang/gcc6-devel is found
> and identified as a suitable version of GCC.

Yep: odd.

> Then Mk/ adds
>  BUILD_DEPENDS+= gcc6:lang/gcc6
> when it resolves USE_GCC=any.
> That should not trigger and pull in lang/gcc6, though, as long
> as gcc6 is found.

You are wrong relative to portmaster: it uses (from "sh -x"
output, including for its relevant recursive uses):

#  pkg query %n-%v lang/gcc6

as its test and ends up with am empty response that it
interprets as needs-installation. By contrast:

#  pkg query %n-%v lang/gcc6-devel

gives a match and would be classified as installed.

The sh -x output that is relevant:

+ pm_cd /usr/ports/lang/gcc6
+ builtin cd /usr/ports/lang/gcc6
+ grep -ql ^CONFLICTS Makefile
+ origin=lang/gcc6
+ iport_from_origin lang/gcc6
+ local sn dir
+ [ -n yes ]
+ pkg query %n-%v lang/gcc6
+ return 1
+ iport=''
+ check_exclude lang/gcc6
+ [ -n '' ]
+ return 0
+ [ -n '' -a -n '' ]
+ [ -n '' -a -n '' ]
+ [ -n '' ]
+ check_interactive lang/gcc6
+ [ -n '' ]
+ return 0
+ update_port lang/gcc6
+ local deps
+ [ -n '' ]
+ [ -z '' ]
+ echo '===>>> Launching child to install lang/gcc6'
===>>> Launching child to install lang/gcc6
+ dep_of_deps=2
+ [ -n pm_first_pass ]
+ [ ! '(' -n '' -a -n '' ')' ]
+ num_of_deps=2
+ deps='(2/2)'
+ term_printf ' >> devel/kBuild >> lang/gcc6 (2/2)'
+ echo -e '\n===>>> emulators/virtualbox-ose-additions >> devel/kBuild >> lang/gcc6 (2/2)'

===>>> emulators/virtualbox-ose-additions >> devel/kBuild >> lang/gcc6 (2/2)
+ [ -n '' ]
+ printf '\033]0;portmaster: emulators/virtualbox-ose-additions >> devel/kBuild >> lang/gcc6 (2/2)\007'
ESC]0;portmaster: emulators/virtualbox-ose-additions >> devel/kBuild >> lang/gcc6 (2/2)^G+ [ -n doing_dep_check -o '(' -n '' -a -n pm_first_pass ')' ]
+ [ -z '' -o -n pm_first_pass ]
+ sh -x /usr/local/sbin/portmaster -D -K lang/gcc6
+ trap trap_exit INT

>> It appears to be picking up that a gcc is installed when
>> lang/gcc6-devel and that it is is version 6 based but then
>> it looks for lang/gcc6 specifically but does not find it
>> and so tries to install lang/gcc6. Its identification of the
>> version is not enough to identify what specific gcc port
>> to look for but it only looks for the one possible source
>> to satisfy the dependency --and not finding that specific
>> port it then tries to install that specific port that it
>> did not find.
> That's pretty close.  It finds the gcc6 binary and hence settles
> on GCC 6 as the compiler to use, but when resolving dependencies
> then it apparently does not find the gcc6 binary (or does, and
> something triggers a full rebuild regardless with lang/gcc6 instead 
> of the original lang/gcc6-devel).

See above for what portmaster really does.

> Do you, by any chance, have some non-standard settings that would
> trigger such an unconditional rebuild?

I try to be as standard as I can given that I experiment with
clang targeting powerpc64 and powerpc and other such oddities
and that I want rather current C++ language/library standards.
> In general, for ports work lang/gcc is the one to use, and lang/gccX 
> over lang/gccX-devel.

Relative to lang/gcc vs. lang/gcc* . . .

A) devel/powerpc64-gcc and devel/amd64-gcc and the like
   updated to 6.2.0 at -r428312 .


B) I want the more current C++ status.

Historically I have avoided lang/gcc*-devel . But when devel/*-gcc's
update versions I tend to experiment with what combinations
conflict for installation vs. what combinations to not.

> Somehow it feels your setup adds layers of shaky, untested and
> non-standard elements on top of each other.

Nope. As stands across /usr/src/ and /usr/ports/ I have around
19 patched files. I do tend to have KERNCONF files that include
the standard ones and then change a few things.

For ports I try to get by with /etc/make.file having:


But the binutils vintage problems for powerpc64 (system and
head ports) and such lead me to do more for the contexts in
which I deal with those.

I tend to have powerpc64 and powerpc patches because of my
experimenting with clang targeting them and that the standard
powerpc64 build does not boot PowerMac G5's reliably.

Some patches are ones that someone has requested that I try,
usually relative to something that I've reported. I also
have ones that work around problems so I can see if there is
more to report. 

> As far as lang/gcc* ports are concerned, I believe the best use
> of our time will be moving lang/gcc from GCC 4.9 (where it finally
> got to) to GCC 5.

The only place that I've been using lang/gcc49 was on powerpc64
for my self-hosted libc++ based powerpc64 system builds: For
buildworld buildkernel I used:

0) lang/gcc49 analogously to the clang system compiler

1) devel/powerpc64-sxtoolchain-gcc anlogously to a cross compiler

This was via SRC_CONF_ENV file content to control what was used.

> Gerald

Mark Millard
markmi at

More information about the freebsd-ports mailing list