adobe-flash / crossbridge

Welcome to visit the homepage!
http://www.crossbridge.io
543 stars 197 forks source link

Linker gets out of memory #37

Open crazyjul opened 10 years ago

crazyjul commented 10 years ago

Hi, I'm trying to build our project using crossbridge, but linking goes over 32bit memory limit.

Do you know any mean to link in several steps or some settings that lower the need for so much memory?

The project is not huge, so any advices would be great

Thanks

cbakgly commented 10 years ago

Basically 2 options: 1 dedicate a large memory to abc linking with -jvmopt=-Xmx2000M 2 try LTO to strip out unused symbols: https://github.com/adobe-flash/crossbridge/wiki/Enable-%E2%80%93flto-and-%E2%80%93flto-export-options-to-optimize-your-application-and-reduce-linking-time

On Dec 31, 2013, at 7:54 AM, Julien Hamaide notifications@github.com wrote:

Hi, I'm trying to build our project using crossbridge, but linking goes over 32bit memory limit.

Do you know any mean to link in several steps or some settings that lower the need for so much memory?

The project is not huge, so any advices would be great

Thanks

— Reply to this email directly or view it on GitHub.

crazyjul commented 10 years ago

Thanks for the quick answer : I already have jvmop=-Xmx14G, but it's ld that crashes in a C++ code ( got a std::bad_alloc exception )

I'll try your suggestion on next monday ( I'm off until that )

Thanks again

crazyjul commented 10 years ago

Unfortunately, the flag was the flto-api is already there.

No clue how to solve this issue, but compiling the toolchain in 64 bits

crazyjul commented 10 years ago

Just another question, can I use g++ to merge object together and do the linking in smaller part?

Thanks

cbakgly commented 10 years ago

If you compile them into LLVM IR (I mean before convert them into ABC), yes you can use llvm-link. But even linking into one file, you still have those symbols and still have to convert them into ABC. Whereas nothing is different in final linking under current design.

So IMHO, it's better to pass as few symbols as possible to decrease the memory demand. Yes, sometime it's hard. You depend a lib call where in chain you get a lot of dependencies automatically. Then a smaller code turns into a Big ABC.

On Jan 5, 2014, at 4:29 AM, Julien Hamaide notifications@github.com wrote:

Just another question, can I use g++ to merge object together and do the linking in smaller part?

Thanks

— Reply to this email directly or view it on GitHub.