Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Oct 2017 15:09:47 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        Thaison Nguyen <t_nguy28@uni-muenster.de>
Cc:        Joe Nosay <superbisquit@gmail.com>, Justin Hibbits <chmeeedalf@gmail.com>, FreeBSD PowerPC ML <freebsd-ppc@freebsd.org>
Subject:   Re: libc++ on FreeBSD-11.1 powerpc32
Message-ID:  <14969DC7-E72B-4912-A4CE-014F9DB92FE0@dsl-only.net>
In-Reply-To: <permail-201710202040178218e1ae00007a75-t_nguy28@message-id.uni-muenster.de>
References:  <permail-201710202040178218e1ae00007a75-t_nguy28@message-id.uni-muenster.de>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2017-Oct-20, at 1:40 PM, Thaison Nguyen <t_nguy28 at uni-muenster.de> =
wrote:

> . . .
> /bin/sh ../libtool  --tag=3DCXX    --mode=3Dcompile 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                                                            =
                                            =20
=
/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=3Dlibstdc++ option
and a -stdlib=3Dlibc++ option but I've never tried
the non-default -stdlib=3Dlibstdc++ option and I
do not know just what it is supposed to do
differently than the default -stdlib=3Dlibc++ 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                          =
                                                                         =
                                =20
/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.

=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14969DC7-E72B-4912-A4CE-014F9DB92FE0>