Building llvmgcc using MinGW64

I was building llvmgcc using MinGW64 and met following error. Any idea how to get rid of this problem?

/home/xchen/MinGWSrcLLVM/llvmgcc/build/./gcc/xgcc -B/home/xchen/MinGWSrcLLVM/llv
mgcc/build/./gcc/ -L/home/xchen/MinGWSrcLLVM/llvmgcc/build/x86_64-w64-mingw32/wi
nsup/mingw -L/home/xchen/MinGWSrcLLVM/llvmgcc/build/x86_64-w64-mingw32/winsup/w3
2api/lib -isystem /home/xchen/MinGWSrcLLVM/llvmgcc/winsup/mingw/include -isystem
/home/xchen/MinGWSrcLLVM/llvmgcc/winsup/w32api/include -B/home/xchen/MinGWSrcLL
VM/myprefix/x86_64-w64-mingw32/bin/ -B/home/xchen/MinGWSrcLLVM/myprefix/x86_64-w
64-mingw32/lib/ -isystem /home/xchen/MinGWSrcLLVM/myprefix/x86_64-w64-mingw32/in
clude -isystem /home/xchen/MinGWSrcLLVM/myprefix/x86_64-w64-mingw32/sys-include
-O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -DNATIVE_CROSS -W -Wall -
Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -I. -I. -I…/…/gcc -I…/…/gcc/. -I…/…/gcc/…/include -I.
./…/gcc/…/libcpp/include -I…/…/gcc/…/libdecnumber -I…/libdecnumber -I/hom
e/xchen/llvm2.7-obj/include -I/home/xchen/llvm2.7/include -g0 -finhibit-size-di
rective -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-
toplevel-reorder -Dinhibit_libc -c -o crtbegin.o
…/…/gcc/config/i386/cygming-crtbegin.c
…/…/gcc/config/i386/cygming-crtbegin.c:1: error: -malign-double makes no sense
in the 64bit mode
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/home/xchen/MinGWSrcLLVM/llvmgcc/build/gcc’
make: *** [all-gcc] Error 2

…/llvmgcc/configure --prefix=/home/xchen/llvmgcc-install --enable-llvm=/home/xchen/llvm2.7-obj --enable-languages=c,c++ --disable-threads --program-prefix=llvm- --disable-bootstrap --enable-checking=release --disable-shared --disable-nls --disable-c-mbchar --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --disable-multilib

Thanks & Regards

2011/9/26 陈晓宇 <xychen0921@gmail.com>

I was building llvmgcc using MinGW64 and met following error. Any idea how to get rid of this problem?

/home/xchen/MinGWSrcLLVM/llvmgcc/build/./gcc/xgcc -B/home/xchen/MinGWSrcLLVM/llv
mgcc/build/./gcc/ -L/home/xchen/MinGWSrcLLVM/llvmgcc/build/x86_64-w64-mingw32/wi
nsup/mingw -L/home/xchen/MinGWSrcLLVM/llvmgcc/build/x86_64-w64-mingw32/winsup/w3
2api/lib -isystem /home/xchen/MinGWSrcLLVM/llvmgcc/winsup/mingw/include -isystem
/home/xchen/MinGWSrcLLVM/llvmgcc/winsup/w32api/include -B/home/xchen/MinGWSrcLL
VM/myprefix/x86_64-w64-mingw32/bin/ -B/home/xchen/MinGWSrcLLVM/myprefix/x86_64-w
64-mingw32/lib/ -isystem /home/xchen/MinGWSrcLLVM/myprefix/x86_64-w64-mingw32/in
clude -isystem /home/xchen/MinGWSrcLLVM/myprefix/x86_64-w64-mingw32/sys-include
-O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -DNATIVE_CROSS -W -Wall -
Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
-isystem ./include -I. -I. -I…/…/gcc -I…/…/gcc/. -I…/…/gcc/…/include -I.
./…/gcc/…/libcpp/include -I…/…/gcc/…/libdecnumber -I…/libdecnumber -I/hom
e/xchen/llvm2.7-obj/include -I/home/xchen/llvm2.7/include -g0 -finhibit-size-di
rective -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-
toplevel-reorder -Dinhibit_libc -c -o crtbegin.o
…/…/gcc/config/i386/cygming-crtbegin.c
…/…/gcc/config/i386/cygming-crtbegin.c:1: error: -malign-double makes no sense
in the 64bit mode
make[1]: *** [crtbegin.o] Error 1
make[1]: Leaving directory `/home/xchen/MinGWSrcLLVM/llvmgcc/build/gcc’
make: *** [all-gcc] Error 2

…/llvmgcc/configure --prefix=/home/xchen/llvmgcc-install --enable-llvm=/home/xchen/llvm2.7-obj --enable-languages=c,c++ --disable-threads --program-prefix=llvm- --disable-bootstrap --enable-checking=release --disable-shared --disable-nls --disable-c-mbchar --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --disable-multilib

If I’m not mistaken, llvm-gcc is based on GCC 4.2. MinGW-w64 only started existing around GCC 4.3, with a working implementation at GCC 4.4 (with lots of local patches required) and a vanilla (unpatched) implementation at GCC 4.5+. I think you’re currently out of luck here. Why not try Clang itself (if you don’t need fortran or any other non-C family language of course)?

Ruben

Thanks for your reply. The problem is we were not using pure llvmgcc(otherwise we should be able to use gcc4.6+dragonegg, I think), and a lot changes were made to llvmgcc for our own purpose. If we switch our compiler to clang, there will be a lot of manual patch work… Maybe the MinGW patch for gcc4.4 can be useful for me.

2011/9/26 Ruben Van Boxem <vanboxem.ruben@gmail.com>

2011/9/26 陈晓宇 <xychen0921@gmail.com>

Thanks for your reply. The problem is we were not using pure llvmgcc(otherwise we should be able to use gcc4.6+dragonegg, I think), and a lot changes were made to llvmgcc for our own purpose. If we switch our compiler to clang, there will be a lot of manual patch work… Maybe the MinGW patch for gcc4.4 can be useful for me.

GCC 4.2 is unusable for Windows x64. 4.3 is buggy, 4.4 is buggy but workable. I think you’ll have better luck using a standard released compiler (implying manual patchwork, I hope you mean to your codebase, not Clang’s).

MinGW-w64 + GCC’s older than 4.4 is a no-go. Sorry.

Ruben

Do you mean that your custom code in llvm-gcc is GCC-only and incompatible with Clang? You are not supposed to use Clang instead of your llvm-gcc version, but only to compile it.

Yes, that is because we changed llvm-gcc to add some new features. These new features will be used by our customers. We do not support windows 64 bit build before, but now we have to do so.
I hope to continue using llvmgcc and avoid porting these features to Clang, it will not be easy work.

2011/9/26 Konstantin Tokarev <annulen@yandex.ru>