Skip to content

Commit b2ef729

Browse files
QuLogicdeadprogram
authored andcommitted
arm: Explicitly disable unwind tables
Some clang builds (e.g., Fedora's) enable unwind tables by default. As tinygo does not need nor support them, that leads to undefined symbols when linking.
1 parent 14ce531 commit b2ef729

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

builder/library.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func (l *Library) load(config *compileopts.Config, tmpdir string) (job *compileJ
149149
}
150150
}
151151
if strings.HasPrefix(target, "arm") || strings.HasPrefix(target, "thumb") {
152-
args = append(args, "-fshort-enums", "-fomit-frame-pointer", "-mfloat-abi=soft")
152+
args = append(args, "-fshort-enums", "-fomit-frame-pointer", "-mfloat-abi=soft", "-fno-unwind-tables")
153153
}
154154
if strings.HasPrefix(target, "riscv32-") {
155155
args = append(args, "-march=rv32imac", "-mabi=ilp32", "-fforce-enable-int128")

compileopts/target.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) {
265265
spec.Features = "+cx8,+fxsr,+mmx,+sse,+sse2,+x87"
266266
case "arm":
267267
spec.CPU = "generic"
268+
spec.CFlags = append(spec.CFlags, "-fno-unwind-tables")
268269
switch strings.Split(triple, "-")[0] {
269270
case "armv5":
270271
spec.Features = "+armv5t,+strict-align,-aes,-bf16,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-mve.fp,-neon,-sha2,-thumb-mode,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"

0 commit comments

Comments
 (0)