targets supports code-model, target-abi, relocation-model
This commit is contained in:
@@ -22,9 +22,6 @@ type Export struct {
|
||||
LDFLAGS []string
|
||||
|
||||
// Additional fields from target configuration
|
||||
LLVMTarget string
|
||||
CPU string
|
||||
Features string
|
||||
BuildTags []string
|
||||
GOOS string
|
||||
GOARCH string
|
||||
@@ -525,6 +522,22 @@ func useTarget(targetName string) (export Export, err error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Handle code generation configuration
|
||||
if config.CodeModel != "" {
|
||||
ccflags = append(ccflags, "-mcmodel="+config.CodeModel)
|
||||
}
|
||||
if config.TargetABI != "" {
|
||||
ccflags = append(ccflags, "-mabi="+config.TargetABI)
|
||||
}
|
||||
if config.RelocationModel != "" {
|
||||
switch config.RelocationModel {
|
||||
case "pic":
|
||||
ccflags = append(ccflags, "-fPIC")
|
||||
case "static":
|
||||
ccflags = append(ccflags, "-fno-pic")
|
||||
}
|
||||
}
|
||||
|
||||
// Handle Linker - keep it for external usage
|
||||
if config.Linker != "" {
|
||||
export.Linker = filepath.Join(clangRoot, "bin", config.Linker)
|
||||
|
||||
Reference in New Issue
Block a user