Refreshed patch.
Added PKG_LICENSE_FILES.
Added --as-needed linker flag for slightly smaller size.
Removed -O2 hack to get it to compile. As part of this, removed a bunch of
CFLAGS that are normally passed which potentially affect compilation with
Os.
Signed-off-by: Rosen Penev <rosenp@gmail.com>