add -ffunction-sections arg when building C objects

the other changes in this commit are minor tidying up
This commit is contained in:
Andrew Kelley
2019-07-03 15:46:27 -04:00
parent 2f4faf306d
commit 4606baee07
2 changed files with 8 additions and 3 deletions

View File

@@ -145,8 +145,9 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
TargetOptions opt;
opt.FunctionSections = function_sections;
return reinterpret_cast<LLVMTargetMachineRef>(const_cast<TargetMachine *>(
reinterpret_cast<Target*>(T)->createTargetMachine(Triple, CPU, Features, opt, RM, CM, OL, JIT)));
TargetMachine *TM = reinterpret_cast<Target*>(T)->createTargetMachine(Triple, CPU, Features, opt, RM, CM,
OL, JIT);
return reinterpret_cast<LLVMTargetMachineRef>(TM);
}
bool ZigLLVMTargetMachineEmitToFile(LLVMTargetMachineRef targ_machine_ref, LLVMModuleRef module_ref,