I'm compiling a package with cl6x compiler and using xdc tools. The build process is configured by the following file package.bld:
var Build = xdc.useModule('xdc.bld.BuildEnvironment');
var Pkg = xdc.useModule('xdc.bld.PackageContents');
Pkg.attrs.exportSrc =true;
Pkg.generatedFiles.$add("lib/");
Pkg.otherFiles.$add("package.bld");
var SRCS = ["file0", "file1"];
for (var i = 0; i < Build.targets.length; i++) {
var targ = Build.targets[i];
for (var profile in targ.profiles) {
var libName = "lib/" + profile + "/mylib";
var fullLibName = libName + '.a' + targ.suffix;
print("building for target " + targ.name + " profile " + profile + " ...");
Pkg.attrs.profile = profile;
Pkg.addLibrary(libName, targ, {
profile: profile,
copts: "-k -mw --opt_level=3 --auto_inline=100 --gen_opt_info=2"
}).addObjects(SRCS);
Since file0.c and file1.c belong to different compilation units, it is not possible for the compiler to perform a deeper optimization, as for example inlining of a function defined in file1.c and called in both files.
Is there a way in the xdc tools to tell the compiler to compile both files in one compilation unit, in order to perform all the optimization?
Thank you
Best regards