build: remove .SECONDARY

Somehow this confuses make, causing it to ignore the explicit dependency
between libstatic-thread-variable.so and tst-static-thread-variable.so,
breaking a parallel build.

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>
Fix 'sign-compare' error in unordered_ring_mpsc.hh

Fixes the following error when compiling osv on my Archlinux machine
with gcc 4.9:

  In file included from tst-unordered-ring-mpsc.cc:12:0:
  unordered_ring_mpsc.hh:40:22: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
               if (_idx >= _ring.rings.size()) {
                      ^
  unordered_ring_mpsc.hh:48:33: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
               do {} while (++_idx < _ring.rings.size() && !_ring.rings[_idx].pop(_element));

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: change libgcc_s.a to libgcc.a

Fixes the following error with gcc 4.9 (build_env=host)
  osv/include/api/sched.h:125: undefined reference to `__popcountdi2'

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Reported-by: Minoru KANATSU <icc.pot.tyew272@gmail.com>
Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
build: fix tst-static-thread-variable.so dependencies (again)

Commit 7a69d0d8 and 99d80368 introduced:

  tests/tst-static-thread-variable.so: COMMON += -L./tests -lstatic-thread-variable

However make variables are inherited by prerequisites, which will cause
libstatic-thread-variable.so being added as its dependencies itself,
resulting in this error:

  ./tests/libstatic-thread-variable.so: file not recognized: File truncated

Add 'private' keyword [1] to surpass the inheritance.

[1]: https://www.gnu.org/software/make/manual/html_node/Suppressing-Inheritance.html

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
scripts: encode string before use it as buffer

In python3, string and bytearray are now different.

This patch fixes:
  Adding /usr/lib/jvm/java/lib/tools.jar...
  Traceback (most recent call last):
    File "osv/scripts/upload_manifest.py", line 192, in <module>
        main()
      File "osv/scripts/upload_manifest.py", line 180, in main
        upload(osv, manifest, depends)
      File "osv/scripts/upload_manifest.py", line 120, in upload
        cpio_send(link)
      File "osv/scripts/upload_manifest.py", line 80, in cpio_send
        s.sendall(data)
    TypeError: 'str' does not support the buffer interface.

Signed-off-by: Zifei Tong <zifeitong@gmail.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Merge branch 'archlinux-build-fixes'
Adding libtools.so library

The libtools will hold code that is not part of the kernel but is
required by both tools and the API.

As a first step it holds the logic for lsroute and remove it from
kernel.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: Write a text to a file

This adds the ability to write a text to a file.
The new op code WRITE will write the content to a file, if the overwrite
flag is set to true, the file will be truncated, if not, the text will
be append.

Calling PUT /file/f.txt?op=WRITE&overwrite=true&content=hello
will write hello to /f.txt overwrite its content if exist.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Http Server: code generation improve error handling

This series changes the somehow cryptic code generation error messages
to more meaningful ones.

It catches all exception and print an error message with the current
file being parsed.

It also tries to identify if a missing attribute causes an error and
report the missing attribute with its whereabout.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>