libc++ on FreeBSD-11.1 powerpc32
Mark Millard
markmi at dsl-only.net
Fri Oct 20 22:09:51 UTC 2017
On 2017-Oct-20, at 1:40 PM, Thaison Nguyen <t_nguy28 at uni-muenster.de> wrote:
> . . .
> /bin/sh ../libtool --tag=CXX --mode=compile clang++50 -DHAVE_CONFIG_H -I. -I/usr/local/include -O2 -pipe -fno-strict-aliasing -MT tif_stream.lo -MD -MP -MF .deps/tif_stream.Tpo -c -o tif_stream.lo tif_stream.cxx
> libtool: compile: clang++50 -DHAVE_CONFIG_H -I. -I/usr/local/include -O2 -pipe -fno-strict-aliasing -MT tif_stream.lo -MD -MP -MF .deps/tif_stream.Tpo -c tif_stream.cxx -fPIC -DPIC -o .libs/tif_stream.o
> tif_stream.cxx:31:10: fatal error: 'iostream' file not found
> #include <iostream>
> ^~~~~~~~~~
> 1 error generated.
> *** [tif_stream.lo] Error code 1
> . . .
It looks to me that, even if iostream from
either libc++ or libstdc++ was present, the:
-I. -I/usr/local/include
would not normally be sufficient for finding
the libc++ or libstdc++ related headers in the
system headers (using amd64 as an example here,
so, libc++):
# find /usr/include/ -name iostream -print | more
/usr/include/c++/v1/tr1/iostream
/usr/include/c++/v1/iostream
As for a gcc 4.2.1 based powerpc buildworld
and its (old) libstdc++ (the below is from a
cross build environment, not on powerpc
itself):
# find /usr/obj/DESTDIRs/gcc421-powerpc-installworld -name iostream -print | more
/usr/obj/DESTDIRs/gcc421-powerpc-installworld/usr/include/c++/4.2/iostream
So, again, the -I usage looks insufficient for
finding the C++ headers involved:
-I/usr/include/c++/4.2
would find the system iostream file in this older
context.
You might be able to use the system libstdc++ and
its headers if you can get the proper options to
the compiles and links in your port builds. (This
is not a type of experiment that I've done.) As
I remember clang has a -stdlib=libstdc++ option
and a -stdlib=libc++ option but I've never tried
the non-default -stdlib=libstdc++ option and I
do not know just what it is supposed to do
differently than the default -stdlib=libc++ option.
Going in a different direction. . .
As far as I know there is no FreeBSD port that
includes libc++ sources to build. Nor do any
supply libstdc++ source to independently build
as far as I know. If those are correct then
you would be on your own for building and using
either library independent of the system
implementation of one or the other.
Just FYI:
Using lang/gcc7 as an example of its path to
its own installed iostream file:
# find /usr/local/ -name iostream -print | more
/usr/local/lib/gcc7/include/c++/iostream
So again the C++ specific path would not be just
. . ./include/ . This is a fairly general property
for finding C++ headers and the detailed paths
vary from library implementation to library
implementation.
===
Mark Millard
markmi at dsl-only.net
More information about the freebsd-ppc
mailing list