From 0b652d72783d7fa432e357659b2b2ef4a140fa8a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 28 Aug 2017 16:04:54 +0200 Subject: 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. --- pkg/compiler/compiler.go | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'pkg/compiler') 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) } } -- cgit mrf-deployment