From owner-freebsd-toolchain@freebsd.org Wed Dec 6 04:46:35 2017 Return-Path: Delivered-To: freebsd-toolchain@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C037E901F9 for ; Wed, 6 Dec 2017 04:46:35 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-168.reflexion.net [208.70.210.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E9803390 for ; Wed, 6 Dec 2017 04:46:34 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 25817 invoked from network); 6 Dec 2017 04:46:33 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 6 Dec 2017 04:46:33 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.3) with SMTP; Tue, 05 Dec 2017 23:46:33 -0500 (EST) Received: (qmail 23395 invoked from network); 6 Dec 2017 04:46:33 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 6 Dec 2017 04:46:33 -0000 Received: from [192.168.1.25] (c-76-115-7-162.hsd1.or.comcast.net [76.115.7.162]) by iron2.pdx.net (Postfix) with ESMTPSA id 99622EC814E; Tue, 5 Dec 2017 20:46:32 -0800 (PST) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: powerpc64 & system-clang vs. building the likes of lang/gcc7 (at least): vec_step name pollution causes compile failures, should gcc7 source code avoid the name? Message-Id: Date: Tue, 5 Dec 2017 20:46:31 -0800 Cc: Gerald Pfeifer To: FreeBSD Toolchain , FreeBSD PowerPC ML , FreeBSD Ports X-Mailer: Apple Mail (2.3273) X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 04:46:35 -0000 [I experiment with clang-based worlds and kernels on powerpc64 and powerpc. But I'm not sure that such is the only type of context is required to see the below problem.] Attempting to build lang/gcc7 on a system-clang based powerpc64 (world and kernel) gets: = /wrkdirs/usr/ports/lang/gcc7/work/gcc-7.2.0/gcc/tree-vect-loop.c:3835:27: = error: expected unqualified-id tree new_vec, vec_init, vec_step, t; ^ = /wrkdirs/usr/ports/lang/gcc7/work/gcc-7.2.0/gcc/tree-vect-loop.c:3835:26: = error: expected ';' at end of declaration tree new_vec, vec_init, vec_step, t; ^ ; Well, it turns out that vec_step has the following potential naming conflicts, one for powerpc64 FreeBSD specifics, and one for clang specifics (for support of OpenCL). . . For powerpc64: /usr/src/contrib/gcc/config/rs6000/altivec.h:#define vec_step(x) = __builtin_vec_step (* (__typeof__ (x) *) 0) (I'm point the above out despite my clang-based context.) For clang: /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp:/// vec_step = and we are at the start of an expression or a parenthesized /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp:/// [OpenCL = 1.1 6.11.12] vec_step built-in function: /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp:/// = vec_step ( expressions ) /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp:/// = vec_step ( type-name ) /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp: "Not = a typeof/sizeof/alignof/vec_step expression!"); /usr/src/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp: "Not = a sizeof/alignof/vec_step expression!"); /usr/src/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp: // [OpenCL 1.1 = 6.11.12] "The vec_step built-in function takes a built-in /usr/src/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h: /// \brief = Build a new sizeof, alignof or vec_step expression with a /usr/src/contrib/llvm/tools/clang/include/clang/AST/Expr.h:/// vec_step = (OpenCL 1.1 6.11.12). = /usr/src/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h:= /// \brief Matches sizeof (C99), alignof (C++11) and vec_step (OpenCL) = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "invalid application of '%select{sizeof|alignof|vec_step}0' to a " = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "invalid application of '%select{sizeof|alignof|vec_step}0' to a = void " = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "invalid application of = '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to = a void type">; = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "invalid application of = '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to = an " = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "invalid application of = '%select{sizeof|alignof|vec_step|__builtin_omp_required_simd_align}0' to = a " = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.= td: "'vec_step' requires built-in scalar or vector type, %0 invalid">; = /usr/src/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def:KEYWO= RD(vec_step , KEYOPENCL|KEYALTIVEC|KEYZVECTOR) (The lists were extracted from a: grep -r "\" /usr/src/* Some material was omitted from the reported matches.) Given the clang extension for having vec_step for OpenCL, it might be best if lang/gcc7 was updated to avoid the name (upstream as well). devel/llvm50 likely has the same vec_step as system-clang. I'm not sure about devel/llvm40 . This might be true of some other lang/gcc*'s: I just happen to build lang/gcc7 but not the others (generally). Context details: # uname -apKU FreeBSD FBSDG5L 12.0-CURRENT FreeBSD 12.0-CURRENT r326192M powerpc = powerpc64 1200054 1200054 # svnlite info /usr/ports/ | grep "Re[plv]" Relative URL: ^/head Repository Root: svn://svn0.us-west.freebsd.org/ports Repository UUID: 35697150-7ecd-e111-bb59-0022644237b5 Revision: 455204 Last Changed Rev: 455204 (Last before FLAVORS is enabled.) =3D=3D=3D Mark Millard markmi at dsl-only.net