This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

  After Mark's patch in:

  http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00122.html

I have been unable to build a crossed-native GCC for MinGW
with a prefix other than "/mingw" as I detailed in a
thread earlier:

  http://gcc.gnu.org/ml/gcc/2006-04/msg00441.html

Even using "--with-sysroot" helps only marginally:

  http://gcc.gnu.org/ml/gcc/2006-04/msg00510.html

So I propose that MinGW's NATIVE_SYSTEM_HEADER_DIR be
set relative to its configured prefix as shown by the
attached patch.

I've tested this patch on mainline (revision 114325)
with a crossed-native build and a native bootstrap
build for C/C++.

The crossed-native build was built on Linux and targetted
i686-pc-mingw32. It used the following configure command:
- ---------------------------- 8< ----------------------------
$GCC_SRC_DIR/configure --prefix=$PREFIX \
    --build=$BUILD --host=$HOST --target=$TARGET \
    --enable-languages=c,c++ \
    --with-as=$AS --with-ld=$LD \
    --with-gcc --with-gnu-as --with-gnu-ld \
    --disable-shared --disable-debug --disable-nls --disable-checking \
    --enable-threads=win32 --disable-win32-registry
- ---------------------------- 8< ----------------------------

The build was successful and smoke tests with the built
C and C++ compilers showed that they work.

The native bootstrap (using MSYS) targetted mingw32
(alias for i386-pc-mingw32) and used the following configure
command:
- ---------------------------- 8< ----------------------------
../gcc/configure  --prefix=/tmp/mgw --host=mingw32 \
  --target=mingw32 --disable-nls --disable-debug --disable-checking \
  --enable-threads=win32 --disable-win32-registry \
  --enable-languages=c,c++
- ---------------------------- 8< ----------------------------

Unfortunately, it failed bootstrap but for an unrelated
issue (as far as I can tell):
- ---------------------------- 8< ----------------------------
/tmp/build/./prev-gcc/xgcc -B/tmp/build/./prev-gcc/ -B/tmp/mgw/mingw32/bin/ -c   -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmissing-format-attribute -Werror    -DHAVE_CONFIG_H -I. -I. -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/include  -I../../gcc/gcc/../libdecnumber -I../libdecnumber    ../../gcc/gcc/tree-pretty-print.c -o tree-pretty-print.o
cc1.exe: warnings being treated as errors
../../gcc/gcc/tree-pretty-print.c: In function 'dump_bb_header':
../../gcc/gcc/tree-pretty-print.c:2652: warning: ISO C does not support the 'I' printf flag
../../gcc/gcc/tree-pretty-print.c:2652: warning: format '%I64d' expects type 'int', but argument 3 has type 'gcov_type'
- ---------------------------- 8< ----------------------------

Any insights into this issue? I don't see why the crossed-native
build succeeded but the native bootstrap didn't, except if the
targets (i686-pc-mingw32 for the former, i386-pc-mingw32 for the
latter) made all the difference or if bootstrap v/s "make" (for
the crossed-native build) brought out this issue.

Thanks,
Ranjit.

- --
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA.    Web: http://rmathew.com/


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEgFezYb1hx2wRS48RArZUAJ9M42PJjfsxuTch5AMggnlq4FaCpQCgk1Sb
Z6ax8TX0eCo7HbeH0c3yiZU=
=GwR5
-----END PGP SIGNATURE-----
Index: ChangeLog
from  Ranjit Mathew  <rmathew@gcc.gnu.org>

	* config/i386/t-mingw32: Set NATIVE_SYSTEM_HEADER_DIR to be relative
	to the configured prefix.

Index: config/i386/t-mingw32
===================================================================
--- config/i386/t-mingw32	(revision 114325)
+++ config/i386/t-mingw32	(working copy)
@@ -1,5 +1,4 @@
 # We hide calls to w32api needed for w32 thread support here:
 LIB2FUNCS_EXTRA = $(srcdir)/config/i386/gthr-win32.c
 
-# Match SYSTEM_INCLUDE_DIR
-NATIVE_SYSTEM_HEADER_DIR = /mingw/include
+NATIVE_SYSTEM_HEADER_DIR = $(prefix)/include

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]