It looks like USE_GCC=any is broken and leads to system-clang use

Mark Millard markmi at dsl-only.net
Mon Jul 3 05:30:16 UTC 2017


[More on the behavior: it is more complicated than
previously shown.]

On 2017-Jul-2, at 8:12 PM, Mark Millard <markmi at dsl-only.net> wrote:

> [Looks like output from "make test-gcc" is appropriate,
> so I'm adding such.]
> 
> On 2017-Jul-2, at 7:53 PM, Mark Millard <markmi at dsl-only.net> wrote:
> 
>> [It looks like USE_GCC=any is broken and leads to system-clang use.]
>> 
>> On 2017-Jun-29, at 5:58 PM, Gerald Pfeifer <gerald at pfeifer.com> wrote:
>> 
>>> Am 29. Juni 2017 18:55:59 GMT+08:00 schrieb Mark Millard <markmi at dsl-only.net>:
>>>> I'm not currently set up to run more than head on
>>>> any of amd64, powerpc64, powerpc, aarch64, or armv6/7
>>>> (which are all I target). And I'm in the middle of
>>>> attempting a fairly large jump to head -r320458 on
>>>> those.
>>> 
>>> Oh, then I had misunderstood your previous mail. No worries, I'll gently proceed then.
>>> 
>>> I expect to update gcc5 in the next 24 hours.
>>> 
>>>> [In my normal/head environment I'm switching to lang/gcc7-devel
>>>> for gcc (from lang/gcc6 ) but I'm odd that way.]
>>> 
>>> The compiler should be fine, it's a number of ports that are not (even blocking the move from GCC 5 to 6 as default).
>> 
>> As part of testing that an environment seemed stable,
>> an environment based on head -r320570 and ports -r444872
>> with gcc being lang/gcc7-devel that is installed on
>> amd64, I tried:
>> 
>> script ~/ports_typescripts/phoronix-try-00-typescript portmaster -DK benchmarks/phoronix-test-suite
>> 
>> in part because it has:
>> 
>> USE_GCC=        any
>> 
>> and I'm using:
>> 
>> DEFAULT_VERSIONS+=perl5=5.24 gcc=7
>> 
>> in /etc/make.conf and the gcc that I have installed
>> is lang/gcc7-devel. This should also have been a test
>> of the adjusted-header removal that has been applied
>> to lang/gcc7-devel (but not a old environment's build
>> used under a modern system environment).
>> 
>> But the result was a surprise: the log file
>> shows all the build as using cc and in my context
>> cc is:
>> 
>> # cc --version
>> FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM 4.0.0)
>> Target: x86_64-unknown-freebsd12.0
>> Thread model: posix
>> InstalledDir: /usr/bin
>> 
>> Configure repeatedly shows:
>> 
>> checking for gcc... cc
>> . . .
>> checking whether we are using the GNU C compiler... yes
>> 
>> 
>> In fact "phoronix-test-suite diagnostics" reports:
>> 
>> COMPILER = Clang 4.0.0 (SVN 297347) + LLVM 4.0.0
>> 
>> So clang is being treated as an example of gcc as far
>> as I can tell.
> 
> # cd /usr/ports/benchmarks/phoronix-test-suite/
> FreeBSDx64OPC# make test-gcc
> USE_GCC=any
> Port can use later versions.
> GCC version: 4.2 - OSVERSION up to 9999999
> GCC version: 4.8 - OSVERSION up to 0
> GCC version: 4.9 - OSVERSION up to 0
> GCC version: 5 - OSVERSION up to 0
> GCC version: 6 - OSVERSION up to 0
> Using GCC version 7
> CC=cc - CXX=c++ - CPP=cpp - CFLAGS="-O2 -pipe -g -fstack-protector -fno-strict-aliasing"
> LDFLAGS=" -fstack-protector"
> BUILD_DEPENDS=/usr/local/include/php/main/php.h:lang/php56 /usr/local/bin/python2.7:lang/python27 update-desktop-database:devel/desktop-file-utils update-mime-database:misc/shared-mime-info /usr/local/lib/php/20131226/ctype.so:textproc/php56-ctype /usr/local/lib/php/20131226/curl.so:ftp/php56-curl /usr/local/lib/php/20131226/dom.so:textproc/php56-dom /usr/local/lib/php/20131226/filter.so:security/php56-filter /usr/local/lib/php/20131226/gd.so:graphics/php56-gd /usr/local/lib/php/20131226/hash.so:security/php56-hash /usr/local/lib/php/20131226/json.so:devel/php56-json /usr/local/lib/php/20131226/openssl.so:security/php56-openssl /usr/local/lib/php/20131226/pcntl.so:devel/php56-pcntl /usr/local/lib/php/20131226/posix.so:sysutils/php56-posix /usr/local/lib/php/20131226/session.so:www/php56-session /usr/local/lib/php/20131226/simplexml.so:textproc/php56-simplexml /usr/local/lib/php/20131226/sockets.so:net/php56-sockets /usr/local/lib/php/20131226/sqlite3.so:databases/php56-sqlite3 /usr/l
> ocal/lib/php/20131226/zip.so:archivers/php56-zip /usr/local/lib/php/20131226/zlib.so:archivers/php56-zlib
> RUN_DEPENDS=fpdf>0:print/fpdf cmake:devel/cmake /usr/local/include/php/main/php.h:lang/php56 /usr/local/bin/python2.7:lang/python27 update-desktop-database:devel/desktop-file-utils update-mime-database:misc/shared-mime-info /usr/local/lib/php/20131226/ctype.so:textproc/php56-ctype /usr/local/lib/php/20131226/curl.so:ftp/php56-curl /usr/local/lib/php/20131226/dom.so:textproc/php56-dom /usr/local/lib/php/20131226/filter.so:security/php56-filter /usr/local/lib/php/20131226/gd.so:graphics/php56-gd /usr/local/lib/php/20131226/hash.so:security/php56-hash /usr/local/lib/php/20131226/json.so:devel/php56-json /usr/local/lib/php/20131226/openssl.so:security/php56-openssl /usr/local/lib/php/20131226/pcntl.so:devel/php56-pcntl /usr/local/lib/php/20131226/posix.so:sysutils/php56-posix /usr/local/lib/php/20131226/session.so:www/php56-session /usr/local/lib/php/20131226/simplexml.so:textproc/php56-simplexml /usr/local/lib/php/20131226/sockets.so:net/php56-sockets /usr/local/lib/php/20131226/sqlite3
> .so:databases/php56-sqlite3 /usr/local/lib/php/20131226/zip.so:archivers/php56-zip /usr/local/lib/php/20131226/zlib.so:archivers/php56-zlib

I used:

Index: /usr/ports/Mk/bsd.gcc.mk
===================================================================
--- /usr/ports/Mk/bsd.gcc.mk    (revision 444872)
+++ /usr/ports/Mk/bsd.gcc.mk    (working copy)
@@ -35,7 +35,7 @@
 # ascending order and in sync with the table below. 
 # When adding a version, please keep the comment in
 # Mk/bsd.default-versions.mk in sync.
-GCCVERSIONS=   040200 040800 040900 050000 060000
+GCCVERSIONS=   040200 040800 040900 050000 060000 070000
 
 # The first field is the OSVERSION in which it disappeared from the base.
 # The second field is the version as USE_GCC would use.
@@ -44,6 +44,7 @@
 GCCVERSION_040900=           0 4.9
 GCCVERSION_050000=           0 5
 GCCVERSION_060000=           0 6
+GCCVERSION_070000=           0 7
 
 # No configurable parts below this. ####################################
 #


to get "make test-gcc" to report:

# pwd
/usr/ports/benchmarks/phoronix-test-suite
FreeBSDx64OPC# make test-gcc
USE_GCC=any
Port can use later versions.
GCC version: 4.2 - OSVERSION up to 9999999
GCC version: 4.8 - OSVERSION up to 0
GCC version: 4.9 - OSVERSION up to 0
GCC version: 5 - OSVERSION up to 0
GCC version: 6 - OSVERSION up to 0
GCC version: 7 (port) - OSVERSION up to 0
Using GCC version 7
CC=gcc7 - CXX=g++7 - CPP=cpp7 - CFLAGS="-O2 -pipe -g -fstack-protector -Wl,-rpath=/usr/local/lib/gcc7 -fno-strict-aliasing"
LDFLAGS=" -fstack-protector -Wl,-rpath=/usr/local/lib/gcc7 -L/usr/local/lib/gcc7"
. . .

But uninstalling and reinstalling still ended
up with configure using "cc" (system clang)
as a gcc compiler, despite what the ports
infrastructure reported (shown above). So
phoronix-test-suite ends up using clang to
compile benchmarks unless one adjusts
install.sh scripts manually and then uses
the adjusted script to rebuild code.


[I only tried: "phoronix-test-suite benchmark pts/hint" .]

===
Mark Millard
markmi at dsl-only.net



More information about the freebsd-ports mailing list