
This commit changes a target triple like "armv6m-none-eabi" to "armv6m-unknown-unknow-eabi". The reason is that while the former is correctly parsed in Clang (due to normalization), it wasn't parsed correctly in LLVM meaning that the environment wasn't set to EABI. This change normalizes all target triples and uses the EABI environment (-eabi in the triple) for Cortex-M targets. This change also drops the `--target=` flag in the target JSON files, the flag is now added implicitly in `(*compileopts.Config).CFlags()`. This removes some duplication in target JSON files. Unfortunately, this change also increases code size for Cortex-M targets. It looks like LLVM now emits calls like __aeabi_memmove instead of memmove, which pull in slightly more code (they basically just call the regular C functions) and the calls themself don't seem to be as efficient as they could be. Perhaps this is a LLVM bug that will be fixed in the future, as this is a very common occurrence.
59 строки
1,7 КиБ
LLVM
59 строки
1,7 КиБ
LLVM
; ModuleID = 'pragma.go'
|
|
source_filename = "pragma.go"
|
|
target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"
|
|
target triple = "wasm32-unknown-wasi"
|
|
|
|
@extern_global = external global [0 x i8], align 1
|
|
@main.alignedGlobal = hidden global [4 x i32] zeroinitializer, align 32
|
|
@main.alignedGlobal16 = hidden global [4 x i32] zeroinitializer, align 16
|
|
@main.globalInSection = hidden global i32 0, section ".special_global_section", align 4
|
|
@undefinedGlobalNotInSection = external global i32, align 4
|
|
@main.multipleGlobalPragmas = hidden global i32 0, section ".global_section", align 1024
|
|
|
|
declare noalias nonnull i8* @runtime.alloc(i32, i8*, i8*)
|
|
|
|
define hidden void @main.init(i8* %context, i8* %parentHandle) unnamed_addr {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define void @extern_func() #0 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define hidden void @somepkg.someFunction1(i8* %context, i8* %parentHandle) unnamed_addr {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
declare void @somepkg.someFunction2(i8*, i8*)
|
|
|
|
; Function Attrs: inlinehint
|
|
define hidden void @main.inlineFunc(i8* %context, i8* %parentHandle) unnamed_addr #1 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
; Function Attrs: noinline
|
|
define hidden void @main.noinlineFunc(i8* %context, i8* %parentHandle) unnamed_addr #2 {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define hidden void @main.functionInSection(i8* %context, i8* %parentHandle) unnamed_addr section ".special_function_section" {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
define void @exportedFunctionInSection() #3 section ".special_function_section" {
|
|
entry:
|
|
ret void
|
|
}
|
|
|
|
declare void @main.undefinedFunctionNotInSection(i8*, i8*)
|
|
|
|
attributes #0 = { "wasm-export-name"="extern_func" }
|
|
attributes #1 = { inlinehint }
|
|
attributes #2 = { noinline }
|
|
attributes #3 = { "wasm-export-name"="exportedFunctionInSection" }
|