building a newlib cross compiler with "C" compatibility includes
Benjamin Kosnik
bkoz@redhat.com
Tue Jun 25 11:02:00 GMT 2002
The general instructions on how to build a cross compiler are here:
http://gcc.gnu.org/simtest-howto.html
People interested in building a cross compiler with the "c" header
scheme should probably first follow the instructions above exactly,
and make sure that they understand the process and that their sources
are buildable for the given target. Once they are comfortable with the
process and the state of their sources, the switch to
--enable-cheaders=c can be attempted.
Three patches are necessary for successful "c" model builds....
assuming current gcc-3.2 sources are the basis for experimentation.
If not, the "C" compatibility patches from last week will need to be
applied.
1) newlib patch
This patch should be applied soon-ish to the newlib sources, and may
not be necessary in the near future:
http://sources.redhat.com/ml/newlib/2002/msg00257.html
In addition, "_HAVE_STD_CXX" must be defined. This can be passed down
with CFLAGS or manually hardwired in libc/include/_ansi.h.
2) gcc patch
http://gcc.gnu.org/ml/libstdc++/2002-06/msg00200.html
3) libstdc++ patch
At this point, the "C" compatibility headers must be switched on by
hand. Because of this, the c header scheme will also be hardwired to
"c" instead of the default, "c_std".
Here's that patch:
Index: configure.target
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.target,v
retrieving revision 1.45
diff -c -p -r1.45 configure.target
*** configure.target 24 Jun 2002 05:47:02 -0000 1.45
--- configure.target 25 Jun 2002 17:53:53 -0000
*************** else
*** 54,61 ****
cpu_include_dir="cpu/generic"
fi
! c_model=c_std
! c_compatibility=no
# TARGET-SPECIFIC OVERRIDES
--- 54,61 ----
cpu_include_dir="cpu/generic"
fi
! c_model=c
! c_compatibility=yes
# TARGET-SPECIFIC OVERRIDES
Not so hard.
At this point, everything is in place.
make CFLAGS="-D_HAVE_STD_CXX" all
should build the cross compiler, and
make install
should install it, ready to use.
-benjamin
More information about the Libstdc++
mailing list