Discussion:
[Texmacs-dev] libstdc++ problem
Kostas Oikonomou
2017-12-11 22:04:27 UTC
Permalink
Perhaps I was not clear in my last post.

Up to a few weeks ago, TeXmacs would build perfectly fine on FreeBSD,
using the system's standard compiler clang/clang++.

When the -stdlib=libstdc++ feature was introduced in configure,
configuration fails:

...
checking whether C++ compiler accepts -stdlib=libstdc++... yes
configure: added libstdc++ in compile flags
checking stdlibc++ linking... no
configure: error: Not able to link with libstdc++
...

I've looked at configure to try to disable this feature, which does not
seem necessary on FreeBSD, but the code is pretty complicated. Any
suggestions would be welcome.

                            Kostas
Zhaocong Jia
2017-12-21 07:50:43 UTC
Permalink
Hi, I have the same problem, and I think the bug is:

In SVN r10904, or git commit
2359ba694c250f47aec257282fc7737a2511e0fc,
https://github.com/texmacs/texmacs/commit/2359ba694c250f47aec257282fc7737a2511e0fc

it adds option "-stdlib=libstdc++".

But for some clang, it uses compiler-rt instead of libgcc
as the default rtlib and uses libc++ instead of libstdc++
as the default stdlib. So to use libstdc++ you'll have to use
libgcc too, for example:

clang++ -stdlib=libstdc++ -rtlib=libgcc conftest.cpp


I suggest Kostas Oikonomou to post your config.log here.
I suspect there's no GCC on your system.
A quick fix is to remove "libstdc++" part from "configure.in"
and run "autoconf" again.

On my system, the relevent part of config.log is:

configure:4543: added libstdc++ in compile flags
configure:4551: checking stdlibc++ linking
configure:4569: clang++ -o conftest -stdlib=libstdc++ conftest.cpp >&5
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/../../../../x86_64-pc-linux-gnu/bin/ld:
/tmp/conftest-6b28ea.o: undefined reference to
symbol '_Unwind_Resume@@GCC_3.0'
/usr/lib/gcc/x86_64-pc-linux-gnu/7.2.0/libgcc_s.so.1: error adding
symbols: DSO missing from command line
clang-5.0: error: linker command failed with exit code 1 (use -v to
see invocation)
configure:4569: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define USE_STACK_TRACE 1
| /* end confdefs.h. */
|
| #include <string>
| #include <iostream>
|
| int
| main ()
| {
|
| std::string t="CompileMe";
| std::cout <<t.size();
| ;
| return 0;
| }
configure:4580: result: no
configure:4582: error: Not able to link with libstdc++

Continue reading on narkive:
Loading...