Bug 227650 - devel/avr-gcc: fails to build on 11.1-STABLE amd64 r331989
Summary: devel/avr-gcc: fails to build on 11.1-STABLE amd64 r331989
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Christoph Moench-Tegeder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-20 04:20 UTC by Kenji Rikitake
Modified: 2018-07-06 22:01 UTC (History)
4 users (show)

See Also:
bugzilla: maintainer-feedback? (joerg)


Attachments
Fix avr-gcc build for C++11 and later mode (563 bytes, patch)
2018-06-07 09:53 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Rikitake 2018-04-20 04:20:40 UTC
Synopsis:

avr-gcc-5.4.0_2 fails to build on 11.1-STABLE amd64 r331989 (on Clang 6.0.0)

Clang version info:

clang --version
FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)
Target: x86_64-unknown-freebsd11.1
Thread model: posix
InstalledDir: /usr/bin

Workaround: 

Setting "CXXFLAGS+= -std=gnu++03" for clang compiler in the Makefile prevents halting compilation due to the C++11 errors. A small patch here for devel/avr-gcc/Makefile:

Index: Makefile
===================================================================
--- Makefile    (revision 467805)
+++ Makefile    (working copy)
@@ -37,6 +37,8 @@

 CONFLICTS=     avr-gcc-devel*

+CXXFLAGS+=     -std=gnu++03
+
 CONFIGURE_ARGS=        --target=avr --disable-libssp --with-gmp=${LOCALBASE} --enable-languages="c c++"

 WITHOUT_CPU_CFLAGS=This is a cross-compiler.

Error log:

c++ -c   -O2 -pipe -fno-omit-frame-pointer -fno-strict-aliasing  -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../.././gcc -I../.././gcc/build -I../.././gcc/../include  -I../.././gcc/../libcpp/include -I/usr/local/include \
        -o build/genopinit.o ../.././gcc/genopinit.c
In file included from ../.././gcc/gencheck.c:25:
../.././gcc/coretypes.h:62:1: warning: class 'rtx_def' was previously declared
      as a struct [-Wmismatched-tags]
class rtx_def;
^
../.././gcc/coretypes.h:55:8: note: previous use is here
struct rtx_def;
       ^
In file included from ../.././gcc/gencheck.c:26:
In file included from ./tm.h:18:
../.././gcc/config/elfos.h:102:25: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
   fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
                        ^

../.././gcc/config/elfos.h:170:27: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",          \
                          ^

1 warning and 2 errors generated.
gmake[4]: *** [Makefile:2428: build/gencheck.o] Error 1
gmake[4]: *** Waiting for unfinished jobs....
c++: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
In file included from ../.././gcc/genopinit.c:23:
../.././gcc/coretypes.h:62:1: warning: class 'rtx_def' was previously declared
      as a struct [-Wmismatched-tags]
class rtx_def;
^
../.././gcc/coretypes.h:55:8: note: previous use is here
struct rtx_def;
       ^
In file included from ../.././gcc/genopinit.c:24:
In file included from ./tm.h:18:
../.././gcc/config/elfos.h:102:25: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
   fprintf ((FILE), "%s"HOST_WIDE_INT_PRINT_UNSIGNED"\n",\
                        ^

../.././gcc/config/elfos.h:170:27: error: invalid suffix on literal; C++11
      requires a space between literal and identifier
      [-Wreserved-user-defined-literal]
      fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED",%u\n",          \
                          ^

In file included from ../.././gcc/genopinit.c:25:
In file included from ../.././gcc/rtl.h:26:
In file included from ../.././gcc/real.h:25:
../.././gcc/wide-int.h:1116:1: warning: 'fixed_wide_int_storage' defined as a
      class template here but previously declared as a struct template
      [-Wmismatched-tags]
class GTY(()) fixed_wide_int_storage
^
../.././gcc/wide-int.h:284:18: note: did you mean class here?
template <int N> struct fixed_wide_int_storage;
                 ^~~~~~
                 class
In file included from ../.././gcc/genopinit.c:25:
../.././gcc/rtl.h:282:1: warning: 'rtx_def' defined as a struct here but
      previously declared as a class [-Wmismatched-tags]
struct GTY((desc("0"), tag("0"),
^
../.././gcc/coretypes.h:62:1: note: did you mean struct here?
class rtx_def;
^~~~~
struct
3 warnings and 2 errors generated.
gmake[4]: *** [Makefile:2428: build/genopinit.o] Error 1
rm gcc.pod
gmake[4]: Leaving directory '/usr/ports/devel/avr-gcc/work/gcc-5.4.0/host-x86_64-portbld-freebsd11.1/gcc'
gmake[3]: *** [Makefile:4095: all-gcc] Error 2
Comment 1 Alexander Sieg 2018-05-05 08:11:49 UTC
This port also does not build on 12-CUURENT whit the same error.
Comment 2 Andriy Gapon freebsd_committer 2018-06-07 06:28:33 UTC
Can anyone please act on this?
Comment 3 Dimitry Andric freebsd_committer 2018-06-07 09:53:26 UTC
Created attachment 194060 [details]
Fix avr-gcc build for C++11 and later mode

Here is a patch similar to the one in r458581 for the regular gcc ports.
Comment 4 commit-hook freebsd_committer 2018-07-06 21:55:03 UTC
A commit references this bug:

Author: cmt
Date: Fri Jul  6 21:54:44 UTC 2018
New revision: 474039
URL: https://svnweb.freebsd.org/changeset/ports/474039

Log:
  devel/avr-gcc: fix build with recent clang

  PR:		227650
  Submitted by:	dim@
  Reported by:	 Kenji Rikitake
  Approved by:	maintainer-timeout
  MFH:		2018Q3

Changes:
  head/devel/avr-gcc/Makefile
Comment 5 Christoph Moench-Tegeder freebsd_committer 2018-07-06 21:57:18 UTC
Taking this dut to maintainer timeout. Fix has been tested on "native" lang/gcc* ports before, so very low risk expected.
Comment 6 commit-hook freebsd_committer 2018-07-06 22:00:09 UTC
A commit references this bug:

Author: cmt
Date: Fri Jul  6 21:59:12 UTC 2018
New revision: 474040
URL: https://svnweb.freebsd.org/changeset/ports/474040

Log:
  MFH: r474039

  devel/avr-gcc: fix build with recent clang

  PR:		227650
  Submitted by:	dim@
  Reported by:	 Kenji Rikitake
  Approved by:	maintainer-timeout

  Approved by:	portmgr (blanket: build fixes)

Changes:
_U  branches/2018Q3/
  branches/2018Q3/devel/avr-gcc/Makefile
Comment 7 Christoph Moench-Tegeder freebsd_committer 2018-07-06 22:01:45 UTC
committed and MFH'ed. Thanks to all involved.