[cfe-dev] clang with mingw feedback
Vincent Richomme
forumer at smartmobili.com
Wed Jan 27 02:54:39 PST 2010
On Mon, 25 Jan 2010 20:55:41 +0100, Vincent Richomme
<forumer at smartmobili.com> wrote:
> On Sat, 23 Jan 2010 00:07:30 +0100, "Vincent R."
<forumer at smartmobili.com>
> wrote:
>> Hi,
>>
>> I am trying to compile clang on windows using lateste msys/mingw on
>> Windows 7 and I get a compilation error :
>>
>> llvm[4]: Linking Debug executable clang
>> "C:/Developer/msys/1.0/bin/ld.exe": warning: --export-dynamic is not
>> supported for PE targets, did you mean --export-all-symbols?
>> C:/Developer/msys/1.0/home/Vincent/tmp/llvm/Debug/lib/libLLVMCodeGen.a:
>> could not read symbols: Memory exhausted
>> collect2: ld returned 1 exit status
>> make[4]: *** [/home/Vincent/tmp/llvm/Debug/bin/clang.exe] Error 1
>> make[4]: Leaving directory
>> `/home/Vincent/tmp/llvm/tools/clang/tools/driver'
>>
>> I suppose this problem is in the way autotools are configured, as the
>> message says I suppose it should be --export-all-symbols.
>> About the memory exhausted it may be due to some bug on msys so I will
>> retry mingw from a linux box.
>> I search for "--export-dynamic and here is the result :
>>
>> Makefile.config:RDYNAMIC := -Wl,-export-dynamic
>> autoconf/configure.ac:dnl Determine whether the linker supports the
>> -export-dynamic option.
>> autoconf/configure.ac: RDYNAMIC="-Wl,-export-dynamic"
>> autoconf/ltmain.sh: -export-dynamic)
>> autoconf/ltmain.sh: # If -module or -export-dynamic was specified, set
> the
>> dlname.
>> autoconf/ltmain.sh: test -n "$library_names" && $echo "$modename:
>> warning: \`$file' was not linked with \`-export-dynamic'"
>> autoconf/ltmain.sh: -export-dynamic allow symbols from OUTPUT-FILE
to
>> be resolved with dlsym(3)
>> autoconf/m4/libtool.m4: _LT_AC_TAGVAR(export_dynamic_flag_spec,
>> $1)='${wl}--export-dynamic'
>> autoconf/m4/libtool.m4: _LT_AC_TAGVAR(export_dynamic_flag_spec,
>> $1)='${wl}--export-dynamic'
>> autoconf/m4/libtool.m4: _LT_AC_TAGVAR(export_dynamic_flag_spec,
>> $1)='${wl}--export-dynamic'
>> autoconf/m4/libtool.m4: _LT_AC_TAGVAR(export_dynamic_flag_spec,
>> $1)='${wl}--export-dynamic'
>> autoconf/m4/libtool.m4: _LT_AC_TAGVAR(export_dynamic_flag_spec,
>> $1)='${wl}--export-dynamic'
>> autoconf/m4/link_options.m4:[AC_CACHE_CHECK([for compiler
>> -Wl,-export-dynamic option],
>> autoconf/m4/link_options.m4: CFLAGS="$CFLAGS -Wl,-export-dynamic"
>> autoconf/m4/link_options.m4:
>> AC_DEFINE([HAVE_LINK_EXPORT_DYNAMIC],[1],[Define if you can use
>> -Wl,-export-dynamic.])
>> config.status:s, at RDYNAMIC@,|#_!!_#|-Wl\,-export-dynamic,g
>> configure:{ echo "$as_me:$LINENO: checking for compiler
>> -Wl,-export-dynamic option" >&5
>> configure:echo $ECHO_N "checking for compiler -Wl,-export-dynamic
>> option... $ECHO_C" >&6; }
>> configure: CFLAGS="$CFLAGS -Wl,-export-dynamic"
>> configure: export_dynamic_flag_spec='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_F77='${wl}--export-dynamic'
>> configure: export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
>> configure: RDYNAMIC="-Wl,-export-dynamic"
>> include/llvm/Config/config.h:/* Define if you can use
> -Wl,-export-dynamic.
>> */
>> include/llvm/Config/config.h.in:/* Define if you can use
>> -Wl,-export-dynamic. */
>> lib/ExecutionEngine/JIT/Intercept.cpp: * linking with libc_nonshared.a
> and
>> -Wl,--export-dynamic doesn't make 'stat'
>> mklib:export_dynamic_flag_spec="\${wl}--export-dynamic"
>> mklib: -export-dynamic)
>> mklib: # If -module or -export-dynamic was specified, set the dlname.
>> mklib: test -n "$library_names" && $echo "$modename: warning:
\`$file'
>> was not linked with \`-export-dynamic'"
>> mklib: -export-dynamic allow symbols from OUTPUT-FILE to be resolved
>> with dlsym(3)
>> mklib:export_dynamic_flag_spec="\${wl}--export-dynamic"
>> mklib:export_dynamic_flag_spec="\${wl}--export-dynamic"
>> tools/llvm-ld/Optimize.cpp:static cl::alias
>> ExportDynamic("export-dynamic",
>>
>>
>> Which one should I modify ?
>
> After having replaced export-dynamic by export-all-symbols I got an
error
> from the linker : memory exhausted.
> Since I was compiling on Windows with msys/mingw and we cannot be sure
> that the bug is not from msys, I am
> trying to compile it on linux/macos.
>
> CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32
>
> configure: error: Already configured in /Users/vrichomme/src/llvm
> make[1]: *** No targets specified and no makefile found. Stop.
> make: *** [cross-compile-build-tools] Error 1
>
> how can I cross-compile it ?
Finally I managed to compile llvm/clang using msys/mingw with compiler
from mingw-w64(no more
memory exhausted error - seems they provide a compiler of better quality).
Only surprise is size in Debug : 323 MB for clang (21 MB once stripped)...
More information about the cfe-dev
mailing list