[Bug bootstrap/54260] New: GCC 4.7.1 fails to build.

2012-08-14 Thread Fetrovsky at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54260

 Bug #: 54260
   Summary: GCC 4.7.1 fails to build.
Classification: Unclassified
   Product: gcc
   Version: 4.7.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: fetrov...@gmail.com


I don't know where to report this problem --- apologies if this is the wrong
place.  GCC 4.7.1 is not building for me.  I ran configure without any
arguments and this is what I get when I do make:

mkdir -p -- x86_64-unknown-linux-gnu/libgcc
Checking multilib configuration for libgcc...
Configuring stage 1 in x86_64-unknown-linux-gnu/libgcc
configure: creating cache ./config.cache
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for --enable-version-specific-runtime-libs... no
checking for a BSD-compatible install... /usr/bin/install -c
checking for gawk... gawk
checking for x86_64-unknown-linux-gnu-ar... ar
checking for x86_64-unknown-linux-gnu-lipo... lipo
checking for x86_64-unknown-linux-gnu-nm...
/home/Feto/sw/gcc/host-x86_64-unknown-linux-gnu/gcc/nm
checking for x86_64-unknown-linux-gnu-ranlib... ranlib
checking for x86_64-unknown-linux-gnu-strip... strip
checking whether ln -s works... yes
checking for x86_64-unknown-linux-gnu-gcc...
/home/Feto/sw/gcc/host-x86_64-unknown-linux-gnu/gcc/xgcc
-B/home/Feto/sw/gcc/host-x86_64-unknown-linux-gnu/gcc/
-B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include
checking for suffix of object files... configure: error: in
`/home/Feto/sw/gcc/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/Feto/sw/gcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/Feto/sw/gcc'
make: *** [all] Error 2
[Feto@fet gcc]$


Thank you!


- Daniel


[Bug bootstrap/54260] GCC 4.7.1 fails to build.

2012-08-15 Thread Fetrovsky at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54260

--- Comment #3 from Feto  2012-08-15 23:48:07 UTC 
---
Hi,

Thanks for the response.  I've looked at the corresponding config.log, and
looked into the problems there, but I can't seem to make sense of what's going
on.  I get:

 98 configure:3373: /home/Feto/sw/gcc/build/./gcc/xgcc
-B/home/Feto/sw/gcc/build/./gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include-o conftest -g -O2  
conftest.c  >&5
 99 /home/Feto/sw/gcc/build/./gcc/cc1: error while loading shared libraries:
libmpc.so.2: cannot open shared object
file: No such file or directory
100 configure:3376: $? = 1
101 configure:3564: checking for suffix of object files
102 configure:3586: /home/Feto/sw/gcc/build/./gcc/xgcc
-B/home/Feto/sw/gcc/build/./gcc/ -B/usr/local/x86_64-unknown-
linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -
isystem /usr/local/x86_64-unknown-linux-gnu/sys-include-c -g -O2 
conftest.c >&5
103 /home/Feto/sw/gcc/build/./gcc/cc1: error while loading shared libraries:
libmpc.so.2: cannot open shared object
file: No such file or directory
104 configure:3590: $? = 1
105 configure: failed program was:
106 | /* confdefs.h */
107 | #define PACKAGE_NAME "GNU C Runtime Library"
108 | #define PACKAGE_TARNAME "libgcc"
109 | #define PACKAGE_VERSION "1.0"
110 | #define PACKAGE_STRING "GNU C Runtime Library 1.0"
111 | #define PACKAGE_BUGREPORT ""
112 | #define PACKAGE_URL "http://www.gnu.org/software/libgcc/";
113 | /* end confdefs.h.  */
114 |
115 | int
116 | main ()
117 | {
118 |
119 |   ;
120 |   return 0;
121 | }
122 configure:3604: error: in
`/home/Feto/sw/gcc/build/x86_64-unknown-linux-gnu/libgcc':
123 configure:3607: error: cannot compute suffix of object files: cannot
compile
124 See `config.log' for more details.


So I tried compiling the test file (conftest.c) like so:

/home/Feto/sw/gcc/build/./gcc/xgcc -B/home/Feto/sw/gcc/build/./gcc/
-B/usr/local/x86_64-unknown-linux-gnu/bin/
-B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem
/usr/local/x86_64-unknown-linux-gnu/include -isystem
/usr/local/x86_64-unknown-linux-gnu/sys-include-o conftest -g -O2  
conftest.c

I made sure libmpc is properly installed, the proper location is passed to
configure, and so on.  I'm not sure what else to try.

[Feto@fet libgcc]$ ll /usr/local/lib/libmpc*
-rw-r--r-- 1 root root 211870 Aug 14 15:27 /usr/local/lib/libmpc.a
-rwxr-xr-x 1 root root946 Aug 14 15:27 /usr/local/lib/libmpc.la
lrwxrwxrwx 1 root root 15 Aug 14 15:27 /usr/local/lib/libmpc.so ->
libmpc.so.2.0.0
lrwxrwxrwx 1 root root 15 Aug 14 15:27 /usr/local/lib/libmpc.so.2 ->
libmpc.so.2.0.0
-rwxr-xr-x 1 root root  98008 Aug 14 15:27 /usr/local/lib/libmpc.so.2.0.0
[Feto@fet libgcc]$ ld -lmpc
ld: warning: cannot find entry symbol _start; not setting start address
[Feto@fet libgcc]$


Thank you,


- Daniel


[Bug c++/50681] New: A constexpr identifier in a header file generates undefined symbols in object code.

2011-10-09 Thread Fetrovsky at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50681

 Bug #: 50681
   Summary: A constexpr identifier in a header file generates
undefined symbols in object code.
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: fetrov...@gmail.com


kMaxValue in class template Cursor generates an undefined symbol in the object
code.  Since the value isn't defined anywhere else, I get an undefined symbol
error from the linker.

template
class Cursor {
 public:
  typedef std::pair Pair;

 private:
  Pair _position;

 public:
  static Type constexpr kMaxValue =
   std::numeric_limits::max();

  Cursor(Pair const& size = Pair(kMaxValue, kMaxValue)):
   _position(size.first, size.first) {}
};


Example usage:

class UI {
 private:
  Cursor<> _cursor;

 public:
  virtual Cursor<>::Pair GetSize() {
   return make_pair(0, 0);
  }
};

int main() {
 return UI().GetSize().first;
}


Linker message:

x.cpp:(.text._ZN2UIC2Ev[_ZN2UIC5Ev]+0x1c): undefined reference to
`Cursor::kMaxValue'
x.cpp:(.text._ZN2UIC2Ev[_ZN2UIC5Ev]+0x21): undefined reference to
`Cursor::kMaxValue'


[Bug c++/50681] A constexpr identifier in a header file generates undefined symbols in object code.

2011-10-09 Thread Fetrovsky at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50681

Feto  changed:

   What|Removed |Added

URL||http://ideone.com/kfs6n
 CC||Fetrovsky at gmail dot com
   Severity|normal  |major


[Bug c++/51048] New: Class template inheritance doesn't work well with function-local types

2011-11-08 Thread Fetrovsky at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51048

 Bug #: 51048
   Summary: Class template inheritance doesn't work well with
function-local types
Classification: Unclassified
   Product: gcc
   Version: 4.7.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: fetrov...@gmail.com


#include 

template
struct A { 
 X x;

 virtual X const& Push(X const& x) = 0;

 template
 X const& Push(Y const& y) {
  for (std::size_t i = 0; i < y.size(); ++i)
   Push(y[i]);
 }   
};

template
struct B: A {
 using A::Push;
 virtual X const& Push(X const& x) { return A::x = x; }
};

int F() {
 enum S { x, y };
 return B().Push(std::vector(3, x));
}

int main() {
 return F();
}


I get the following:
prog.cpp:7:23: error: 'const X& A::Push(const X&) [with X = F()::S]',
declared using local type 'const F()::S', is used but never defined

If I take S out of F() and define it in the global namespace, it works fine.