VOGONS


First post, by Serious Callers Only

User metadata
Rank Member
Rank
Member

Do you people know how to make a program be compiled with whole program optimization if one of the o files is output from a different make toolchain (cmake in this case, for the mt32emu library) that what will be used for the rest of the o files and linker (make, from the dosbox svn, with the makefile changed to add the mt32emu lib:
+dosbox_LDADD += munt/libmt32emu.a
).

I suspect this can blow up.

Reply 1 of 4, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

All cmake does is generate make files for different platforms. I don't think it would blow up.

Reply 2 of 4, by Serious Callers Only

User metadata
Rank Member
Rank
Member

Ok then, so it's just compile with -flto on both and -flto -fwhole-program on the final step then?

Reply 3 of 4, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Yeah, I don't think it would be a problem.

Reply 4 of 4, by Serious Callers Only

User metadata
Rank Member
Rank
Member

Is there something extraordinarily broken about this?

#!/usr/bin/make -f

%:
dh $@
override_dh_auto_configure:
#build mt32emu from the nested launchpad repository prior to building dosbox
#the patch for using mt32driver also adds dosbox_LDADD += " munt/libmt32emu.a"; dosbox_CFLAGS = " -O3 -flto -fwhole-program"; to the dosbox makefile
#remember, each indented line in a rules file is run on a shell (this first line can't be separated)
cd src/munt;cmake mt32emu -D CMAKE_CXX_FLAGS "-O3 -flto";make
mv src/munt/include/mt32emu/ include
./autogen.sh
dh_auto_configure -- --enable-core-inline

Well, guess i will know when it builds tomorrow, but there isn't any weird problem with -O3, or something i'm missing for better performance in this hacked up compile right?