This is the mail archive of the 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

Hash: SHA1


  After Mark's patch in:

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:

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

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
- ---------------------------- 8< ----------------------------
../gcc/configure  --prefix=/tmp/mgw --host=mingw32 \
  --target=mingw32 --disable-nls --disable-debug --disable-checking \
  --enable-threads=win32 --disable-win32-registry \
- ---------------------------- 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.


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

Bangalore, INDIA.    Web:

Version: GnuPG v1.4.2.2 (MingW32)
Comment: Using GnuPG with Mozilla -

Index: ChangeLog
from  Ranjit Mathew  <>

	* 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
-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]