aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-08-28 16:04:54 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-08-28 16:04:54 +0200
commit0b652d72783d7fa432e357659b2b2ef4a140fa8a (patch)
treedda01c9495dfbff70f7970879bfb034bedd621c5 /pkg
parent4074aed7c0c28afc7d4a3522045196c3f39b5208 (diff)
pkg/compiler: tolerate unsupported consts everywhere
Currently unsupported consts in structs and resources break build. However, that can well happen for arch-specific devices (e.g. Android). Make this non-fatal as it used to be.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/compiler/compiler.go11
1 files changed, 3 insertions, 8 deletions
diff --git a/pkg/compiler/compiler.go b/pkg/compiler/compiler.go
index 3afab96d9..6de0219b1 100644
--- a/pkg/compiler/compiler.go
+++ b/pkg/compiler/compiler.go
@@ -386,17 +386,12 @@ func (comp *compiler) patchConsts(consts map[string]uint64) {
continue
}
// Produce a warning about unsupported syscall/resource/struct.
- // Unsupported syscalls are discarded.
- // Unsupported resource/struct lead to compilation error.
- // Fixing that would require removing all uses of the resource/struct.
+ // TODO(dvyukov): we should transitively remove everything that
+ // depends on unsupported things.
pos, typ, name := decl.Info()
- fn := comp.error
- if _, ok := decl.(*ast.Call); ok {
- fn = comp.warning
- }
if id := typ + " " + name; !comp.unsupported[id] {
comp.unsupported[id] = true
- fn(pos, "unsupported %v: %v due to missing const %v",
+ comp.warning(pos, "unsupported %v: %v due to missing const %v",
typ, name, missing)
}
}