comp: add support for -fdata-sections

This commit is contained in:
Jakub Konka
2023-10-04 15:16:52 +02:00
committed by Andrew Kelley
parent a306bfcd8e
commit 8b4e3b6aee
10 changed files with 85 additions and 12 deletions

View File

@@ -82,7 +82,8 @@ static const bool assertions_on = false;
LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple,
const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc,
LLVMCodeModel CodeModel, bool function_sections, ZigLLVMABIType float_abi, const char *abi_name)
LLVMCodeModel CodeModel, bool function_sections, bool data_sections, ZigLLVMABIType float_abi,
const char *abi_name)
{
std::optional<Reloc::Model> RM;
switch (Reloc){
@@ -130,6 +131,7 @@ LLVMTargetMachineRef ZigLLVMCreateTargetMachine(LLVMTargetRef T, const char *Tri
TargetOptions opt;
opt.FunctionSections = function_sections;
opt.DataSections = data_sections;
switch (float_abi) {
case ZigLLVMABITypeDefault:
opt.FloatABIType = FloatABI::Default;