Re: libtool uses cc to link a mixed C/C++ project and fails to find operator new

2019-06-24 Thread Roumen Petrov

Dunno what is wrong in Yuri's FreeBSD environment

Bob Friesenhahn wrote:

On Sun, 23 Jun 2019, Yuri wrote:


So is there an easy way to override this and always use C++ way of 
linking?


To do this you might need to set LD or CC to your C++ compiler.  A 
better way is to make your main program be C++ since that assures it can 
work.


Consider that C++ exceptions can not be thrown into C code unless a 
special compiler option is used so that C supports the exception 
framework.  Without this you are likely to get a core dump.


C++ is very good at using C code but C code is not very good at using 
C++ code.


Bob


In my environment /usr/bin/cc is link to gcc , linked to gcc-5.5.0, and 
c++ is linked to g++, linked to g++-gcc-5.5.0.


In my environment.
At configure time both compiles are detected as usable. At build time I 
could see:

- for C code:
  CC foo
  CCLD bar
- for C++ code:
  CXX alice
  CXXLD bob
And projects builds just fine!
Conclusion - there is no defect neither in libtool nor in automake nor 
in project autotool files.


Reporter still does not provide feedback with information from 
configuration time (requested in a previous post) => resolution is - 
broken build environment.



Regards,
Roumen

___
https://lists.gnu.org/mailman/listinfo/libtool


Re: libtool uses cc to link a mixed C/C++ project and fails to find operator new

2019-06-24 Thread Yuri

On 2019-06-24 09:55, Roumen Petrov wrote:


And projects builds just fine!
Conclusion - there is no defect neither in libtool nor in automake nor 
in project autotool files.


Reporter still does not provide feedback with information from 
configuration time (requested in a previous post) => resolution is - 
broken build environment.



configure and Makefile.in contain -lstdc++. These could be different 
between systems. On FreeBSD it should be -lc++.


It worked when I patched these lines, but this is error-prone because 
some other toolchains might use a different C++ library.



Once the error-prone -lstdc++ are removed, libtool fails because it 
links with the C compiler.



Yuri


___
https://lists.gnu.org/mailman/listinfo/libtool


Re: libtool uses cc to link a mixed C/C++ project and fails to find operator new

2019-06-24 Thread Bob Friesenhahn

On Mon, 24 Jun 2019, Roumen Petrov wrote:


Reporter still does not provide feedback with information from configuration 
time (requested in a previous post) => resolution is - broken build 
environment.


I think the problem is an unreasonable expectation which is becoming 
more unreasonable as time goes by.


C++ supports exceptions and C does not.  If the run-time used does not 
provide an exception handling framework then there will be a core dump 
either when the C++ exception is initially thrown, or at the boundary 
of C/C++.


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/
Public Key, http://www.simplesystems.org/users/bfriesen/public-key.txt

___
https://lists.gnu.org/mailman/listinfo/libtool