Re: [Mingw-w64-public] how to use ld.gold as the linker?
On May 17, 2015 8:40 PM, zhangxinghai zxh19750...@163.com wrote: Mm I have some another questions 1.As the ld.gold only supports elf format,why it is included in the binutils for build target windows?Does that mean I will never touch this tool under windows. It should not be included in a tool chain targeting windows 2.As the compile/link speed is so slow under windows,I hope to speed it up.Can I use the cross compiler (e.g. target nonwin) to compiler/link source code to nonwin target file format(e.g. elf),then have a convert tool converted to windows pe format.It is best that I can do that all under windows. How slow is slow? Is that possible?Is that worth to do? You'll get the best compiling speeds by cross compiling from linux to windows Great thanks. -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] how to use ld.gold as the linker?
I suggest you take a look at precompiled headers. (https://gcc.gnu.org/onlinedocs/gcc/Precompiled-Headers.html) According to my experience it could cut C++ compile time by about 40% on Windows (and about 60%-70% on Linux). -- Best regards, lh_mouse 2015-05-18 - 发件人:zhangxinghai zxh19750...@163.com 发送日期:2015-05-18 08:39 收件人:zhangxinghai 抄送:mingw-w64-public 主题:Re: [Mingw-w64-public] how to use ld.gold as the linker? Mm I have some another questions 1.As the ld.gold only supports elf format,why it is included in the binutils for build target windows?Does that mean I will never touch this tool under windows. 2.As the compile/link speed is so slow under windows,I hope to speed it up.Can I use the cross compiler (e.g. target nonwin) to compiler/link source code to nonwin target file format(e.g. elf),then have a convert tool converted to windows pe format.It is best that I can do that all under windows. Is that possible?Is that worth to do? Great thanks. -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] how to use ld.gold as the linker?
Mm I have some another questions 1.As the ld.gold only supports elf format,why it is included in the binutils for build target windows?Does that mean I will never touch this tool under windows. 2.As the compile/link speed is so slow under windows,I hope to speed it up.Can I use the cross compiler (e.g. target nonwin) to compiler/link source code to nonwin target file format(e.g. elf),then have a convert tool converted to windows pe format.It is best that I can do that all under windows. Is that possible?Is that worth to do? Great thanks. -- One dashboard for servers and applications across Physical-Virtual-Cloud Widest out-of-the-box monitoring support with 50+ applications Performance metrics, stats and reports that give you Actionable Insights Deep dive visibility with transaction tracing using APM Insight. http://ad.doubleclick.net/ddm/clk/290420510;117567292;y___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Re: [Mingw-w64-public] how to use ld.gold as the linker?
AFAIK, ld.gold is designed to output only ELF [1] binaries (and the specialization is what makes it superior to GNU ld when outputting ELF), while Windows use PE [2] binaries. So you cannot. [1] https://en.wikipedia.org/wiki/Executable_and_Linkable_Format [2] https://en.wikipedia.org/wiki/Portable_Executable Martin Dne 15. 5. 2015 v 6:41 zhangxinghai napsal(a): Hi,all My OS is xp sp3 I used the i686-4.9.2-release-posix-dwarf-rt_v4-rev2.7z build from site http://sourceforge.net/projects/mingw-w64 I write a helloworld.cpp program #includestdio.h #includeiostream int main() { int i1=1,i2=2; int sum = i1 + i2; printf(%d\n,sum); return 0; } when I use g++ -o hello.exe hello.cpp,It works well.Now I want it to be linked with ld.gold,I use g++ -o hello.exe hello.cpp -fuse-ld=gold -v,I get following error,what is the problem and how to resolve it. Great thanks Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=D:/mingw32-gcc-4.9.2/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.9.2/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../../../src/gcc-4.9.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw492/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/lib -L/c/mingw492/prerequisites/i686-zlib-static/lib -L/c/mingw492/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware' Thread model: posix gcc version 4.9.2 (i686-posix-dwarf-rev2, Built by MinGW-W64 project) COLLECT_GCC_OPTIONS='-o' 'hello.exe' '-fuse-ld=gold' '-v' '-shared-libgcc' '-mtune=generic' '-march=i686' D:/mingw32-gcc-4.9.2/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.9.2/cc1plus.exe -quiet -v -iprefix D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/ -D_REENTRANT hello.cpp -quiet -dumpbase hello.cpp -mtune=generic -march=i686 -auxbase hello -version -fuse-ld=gold -o d:\tmp\ccEEmv6M.s GNU C++ (i686-posix-dwarf-rev2, Built by MinGW-W64 project) version 4.9.2 (i686-w64-mingw32) compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p9, MPC version 1.0.2 warning: MPFR header version 3.1.2-p9 differs from library version 3.1.2-p10. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/include ignoring nonexistent directory C:/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32C:/msys64/mingw32/lib/gcc/i686-w64-mingw32/4.9.2/../../../../include ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/include ignoring nonexistent directory C:/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/mingw/include #include ... search starts here: #include ... search starts here: D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed
[Mingw-w64-public] how to use ld.gold as the linker?
Hi,all My OS is xp sp3 I used the i686-4.9.2-release-posix-dwarf-rt_v4-rev2.7z build from site http://sourceforge.net/projects/mingw-w64 I write a helloworld.cpp program #includestdio.h #includeiostream int main() { int i1=1,i2=2; int sum = i1 + i2; printf(%d\n,sum); return 0; } when I use g++ -o hello.exe hello.cpp,It works well.Now I want it to be linked with ld.gold,I use g++ -o hello.exe hello.cpp -fuse-ld=gold -v,I get following error,what is the problem and how to resolve it. Great thanks Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=D:/mingw32-gcc-4.9.2/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.9.2/lto-wrapper.exe Target: i686-w64-mingw32 Configured with: ../../../src/gcc-4.9.2/configure --host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 --prefix=/mingw32 --with-sysroot=/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32 --with-gxx-include-dir=/mingw32/i686-w64-mingw32/include/c++ --enable-shared --enable-static --disable-multilib --enable-languages=ada,c,c++,fortran,objc,obj-c++,lto --enable-libstdcxx-time=yes --enable-threads=posix --enable-libgomp --enable-libatomic --enable-lto --enable-graphite --enable-checking=release --enable-fully-dynamic-string --enable-version-specific-runtime-libs --disable-sjlj-exceptions --with-dwarf2 --disable-isl-version-check --disable-cloog-version-check --disable-libstdcxx-pch --disable-libstdcxx-debug --enable-bootstrap --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-gnu-as --with-gnu-ld --with-arch=i686 --with-tune=generic --with-libiconv --with-system-zlib --with-gmp=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpfr=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-mpc=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-isl=/c/mingw492/prerequisites/i686-w64-mingw32-static --with-cloog=/c/mingw492/prerequisites/i686-w64-mingw32-static --enable-cloog-backend=isl --with-pkgversion='i686-posix-dwarf-rev2, Built by MinGW-W64 project' --with-bugurl=http://sourceforge.net/projects/mingw-w64 CFLAGS='-O2 -pipe -I/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CXXFLAGS='-O2 -pipe -I/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/include -I/c/mingw492/prerequisites/i686-zlib-static/include -I/c/mingw492/prerequisites/i686-w64-mingw32-static/include' CPPFLAGS= LDFLAGS='-pipe -L/c/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/opt/lib -L/c/mingw492/prerequisites/i686-zlib-static/lib -L/c/mingw492/prerequisites/i686-w64-mingw32-static/lib -Wl,--large-address-aware' Thread model: posix gcc version 4.9.2 (i686-posix-dwarf-rev2, Built by MinGW-W64 project) COLLECT_GCC_OPTIONS='-o' 'hello.exe' '-fuse-ld=gold' '-v' '-shared-libgcc' '-mtune=generic' '-march=i686' D:/mingw32-gcc-4.9.2/mingw32/bin/../libexec/gcc/i686-w64-mingw32/4.9.2/cc1plus.exe -quiet -v -iprefix D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/ -D_REENTRANT hello.cpp -quiet -dumpbase hello.cpp -mtune=generic -march=i686 -auxbase hello -version -fuse-ld=gold -o d:\tmp\ccEEmv6M.s GNU C++ (i686-posix-dwarf-rev2, Built by MinGW-W64 project) version 4.9.2 (i686-w64-mingw32) compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p9, MPC version 1.0.2 warning: MPFR header version 3.1.2-p9 differs from library version 3.1.2-p10. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/include ignoring nonexistent directory C:/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32C:/msys64/mingw32/lib/gcc/i686-w64-mingw32/4.9.2/../../../../include ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed ignoring duplicate directory D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/include ignoring nonexistent directory C:/mingw492/i686-492-posix-dwarf-rt_v4-rev2/mingw32/mingw/include #include ... search starts here: #include ... search starts here: D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/include-fixed D:/mingw32-gcc-4.9.2/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/include D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../i686-w64-mingw32/include/c++ D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../i686-w64-mingw32/include/c++/i686-w64-mingw32 D:/mingw32-gcc-4.9.2/mingw32/lib/gcc/../../i686-w64-mingw32/include/c++/backward End of search list. GNU C++ (i686-posix-dwarf-rev2, Built by MinGW-W64 project) version 4.9.2 (i686-w64-mingw32) compiled by GNU C version 4.9.2, GMP version 6.0.0, MPFR version 3.1.2-p9, MPC version 1.0.2