public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/11171] New: Wrong ctype/OS include files when using Newlib
@ 2003-06-12 12:26 ronald@landheer.com
  2003-06-12 13:13 ` [Bug bootstrap/11171] " bangerth@dealii.org
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: ronald@landheer.com @ 2003-06-12 12:26 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11171

           Summary: Wrong ctype/OS include files when using Newlib
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: bootstrap
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: ronald@landheer.com
                CC: gcc-bugs@gcc.gnu.org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i386-unknown-freebsd4.7

Used configuration line:
$ ../src/configure --prefix=/home/cross/tmp --target=i386-unknown-freebsd4.7
--with-newlib --disable-threads --disable-shared --enable-languages=c,c++,java 

When building for FreeBSD (and presumably any other platform that doesn't
automagically use Newlib as crt) the FreeBSD headers for ctype (and other
OS-specific headers) are used automatically, regardless of whether we're using
Newlib or not.

The bug is located in configure.target, in the block that starts at:
     106 # Set any OS-dependent bits.
     107 # Set the os_include_dir.
     108 # Set c_model, c_compatibility here.
     109 # If atomic ops and/or numeric limits are OS-specific rather than
     110 # CPU-specifc, set those here too.
     111 # THIS TABLE IS SORTED.  KEEP IT THAT WAY.
In my particular case, the bug is at:
     137   freebsd*)
     138     os_include_dir="os/bsd/freebsd"
     139     # The FreeBSD ABI is expressed in the major version number only.
     140     abi_baseline_triplet=`echo ${target} | sed 's,\(\.[0-9]*\)*$,,'`
     141     ;;
IMHO, after this table is passed, the --with-newlib option for configure should
be re-examined and the os_include_dir should be overridden accordingly.
Something like this:
if test x"$with_newlib" = "xyes"; then
   os_include_dir="os/newlib"
fi
should do nicely. This does require a two-liner in acinclude.m4:
  AC_ARG_WITH(newlib,
  [  --with-newlib    use newlib])
(in the GLIBCPP_CONFIGURE macro)

Stragely enough, the same change is required in configure.in: while the
GLIBCPP_CONFIGURE macro is called the block starting at 
     114   # Construct crosses by hand, eliminating bits that need ld...
     115   # GLIBCPP_CHECK_COMPILER_FEATURES
     116   # GLIBCPP_CHECK_BUILTIN_MATH_SUPPORT
     117   # GLIBCPP_CHECK_MATH_SUPPORT
overrides some of the settings. (specifically it overrides the os_include_dir
that was set in configure.target). I see no reason to do this twice, but had to
include 
     274 if test x"$with_newlib" = "xyes"; then
     275    os_include_dir="os/newlib"
     276 fi

I'll prepare a patch and send it to gcc-patches.

HTH

rlc


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-05-30 15:13 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-12 12:26 [Bug bootstrap/11171] New: Wrong ctype/OS include files when using Newlib ronald@landheer.com
2003-06-12 13:13 ` [Bug bootstrap/11171] " bangerth@dealii.org
2003-07-09  5:20 ` dhazeghi at yahoo dot com
2003-07-20  1:11 ` [Bug libstdc++/11171] " pme at gcc dot gnu dot org
2003-08-06  4:01 ` pinskia at physics dot uc dot edu
2003-08-06  8:20 ` blytkerchan at users dot sourceforge dot net
2003-08-11 19:23 ` dhazeghi at yahoo dot com
2003-08-23  0:26 ` dhazeghi at yahoo dot com
2003-10-30  7:07 ` pinskia at gcc dot gnu dot org
2003-12-19  9:50 ` pinskia at gcc dot gnu dot org
2004-03-18 20:49 ` bkoz at gcc dot gnu dot org
2004-03-22 16:07 ` ronald at landheer dot com
2004-05-26  4:05 ` bkoz at gcc dot gnu dot org
2004-05-26  4:22 ` cvs-commit at gcc dot gnu dot org
2004-05-26 13:53 ` bkoz at gcc dot gnu dot org
2004-05-31 16:55 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).