Re: devel/freebsd-gcc9@powerpc (for example) : it has the clang vs. gcc vec_step name conflict (for powerpc families): build fails under clang

Mark Millard via freebsd-toolchain <[email protected]>
Newsgroups gmane.os.freebsd.devel.toolchain,gmane.os.freebsd.devel.ppc,gmane.os.freebsd.devel.ports
Message-ID <[email protected]>

On 2019-Dec-26, at 15:21, Mark Millard <marklmi at yahoo.com> wrote:

> I tried to build devel/freebsd-gcc9@powerpc on a powerpc64 (in an
> ELFv1 clang environment) and it reported (listing just one of the
> examples that pointed to vec_step):
> 
> 
> /wrkdirs/usr/ports/devel/freebsd-gcc9/work-powerpc/gcc-9.2.0/gcc/tree-vect-loop.c:4595:12: error: expected unqualified-id
>      tree vec_step = build_vector_from_val (cr_index_vector_type, step);
>           ^
> 
> (Unsure if white handling will still end up with ^
> pointing to vec_step.)
> 
> clang reserves a name that the gcc source code uses:
> vec_step . (I'll not get into the long, messy history
> of this name and multiple standards built on top of
> C/C++, not necessarily in a language appropriate
> way.)
> 
> It turns out that:
> 
> # ls -laT /usr/ports/devel/freebsd-gcc9/files/
> total 44
> drwxr-xr-x  2 root  wheel    512 Dec 25 19:25:26 2019 .
> drwxr-xr-x  3 root  wheel    512 Dec 25 19:25:26 2019 ..
> -rw-r--r--  1 root  wheel   4781 Dec 25 19:25:26 2019 patch-freebsd-format-extensions
> -rw-r--r--  1 root  wheel   1413 Dec 25 19:25:26 2019 patch-freebsd-libdir
> -rw-r--r--  1 root  wheel    588 Dec 25 19:25:26 2019 patch-gcc-configure
> -rw-r--r--  1 root  wheel  16346 Dec 25 19:25:26 2019 patch-gcc-freebsd-mips
> -rw-r--r--  1 root  wheel    231 Dec 25 19:25:26 2019 xtoolchain.mk.in
> 
> is missing the patch-clang-vec_step that is in:
> 
> FBSDG5L2# ls -laT /usr/ports/lang/gcc9/files/
> total 32
> drwxr-xr-x  2 root  wheel   512 Dec 25 20:57:52 2019 .
> drwxr-xr-x  3 root  wheel   512 Dec 25 21:07:33 2019 ..
> -rw-r--r--  1 root  wheel  3450 Jun  1 18:44:50 2019 patch-arm-unwind-cxx-support
> -rw-r--r--  1 root  wheel   651 Sep 18 11:08:37 2019 patch-clang-vec_step
> -rw-r--r--  1 root  wheel  2148 Jun  1 18:44:50 2019 patch-gets-no-more
> -rw-r--r--  1 root  wheel  2897 Jun  1 18:44:50 2019 patch-gfortran-libgcc
> -rw-r--r--  1 root  wheel   932 Dec 25 19:25:10 2019 patch-powerpc32
> -rw-r--r--  1 root  wheel   294 Sep 15 13:10:46 2019 pkg-message.in
> 
> I do not know if other differences in the patch
> lists might be important to other aspects (in
> either direction).

I should have also noted that devel/freebsd-gcc6 has the same
issue:

# ls -laT /usr/ports/devel/freebsd-gcc6/files/
total 44
drwxr-xr-x  2 root  wheel    512 Dec 25 19:25:37 2019 .
drwxr-xr-x  3 root  wheel    512 Dec 25 19:25:37 2019 ..
-rw-r--r--  1 root  wheel   4657 Dec 25 19:25:37 2019 patch-freebsd-format-extensions
-rw-r--r--  1 root  wheel   1413 Dec 25 19:25:37 2019 patch-freebsd-libdir
-rw-r--r--  1 root  wheel  16435 Dec 25 19:25:37 2019 patch-gcc-freebsd-mips
-rw-r--r--  1 root  wheel    204 Dec 25 19:25:37 2019 xtoolchain.mk.in

It also needs patch-clang-vec_step (or some equivalent)
for powerpc and powerpc64 targeting to compile via clang,
because of clang reserving the vec_step identifier and
the gcc source code using that identifier.

===
Mark Millard
marklmi at yahoo.com
( dsl-only.net went
away in early 2018-Mar)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.