rumpkernel / rumprun

The Rumprun unikernel and toolchain for various platforms
Other
1.14k stars 128 forks source link

Compile error for CC=cc ./build-rr.sh hw #122

Open Ulrar opened 6 years ago

Ulrar commented 6 years ago

Hi,

I'm trying to compile rumprun on debian 9 (in docker, if that matters at all), but I get this :

$ CC=cc ./build-rr.sh hw >/dev/null
In file included from /builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind/UnwindCursor.hpp:19:0,
                 from /builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind/libunwind.cxx:18:
/builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind/AddressSpace.hpp: In member function '__int64_t _Unwind::LocalAddressSpace::getSLEB128(_Unwind::LocalAddressSpace::pint_t&, _Unwind::LocalAddressSpace::pint_t)':
/builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind/AddressSpace.hpp:143:27: error: left shift of negative value [-Werror=shift-negative-value]
       result |= (-1LL) << bit;
                           ^~~
cc1plus: all warnings being treated as errors

*** Failed target:  libunwind.o
*** Failed command: /builds/hosting/flex/unikernel-haproxy/rumprun/obj-amd64-hw/rumptools/bin/x86_64--netbsd-c++ -frandom-seed=1cdedddb -O2 -g -mno-red-zone -Wall -Wextra -Wno-unused-parameter -fno-stack-protector -Werror -D__NetBSD__ -Ulinux -U__linux -U__linux__ -U__gnu_linux__ --sysroot=/builds/hosting/flex/unikernel-haproxy/rumprun/obj-amd64-hw/rumptools/dest -isystem =/usr/include -isystem /builds/hosting/flex/unikernel-haproxy/rumprun/obj-amd64-hw/rumptools/dest/usr/include/c++ -I/builds/hosting/flex/unikernel-haproxy/rumprun/./obj-amd64-hw/include -c -std=c++0x -funwind-tables -fno-rtti -fno-exceptions -fvisibility=hidden -Wno-old-style-cast -I/builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind /builds/hosting/flex/unikernel-haproxy/rumprun/src-netbsd/sys/lib/libunwind/libunwind.cxx -o libunwind.o

*** Failed target:  dependall
*** Failed command: cd "/builds/hosting/flex/unikernel-haproxy/rumprun/lib/libunwind"; /builds/hosting/flex/unikernel-haproxy/rumprun/obj-amd64-hw/rumptools/bin/nbmake realall
make: *** [/builds/hosting/flex/unikernel-haproxy/rumprun/./obj-amd64-hw/lib/libunwind/libunwind.a] Error 1
krytarowski commented 6 years ago

This has been fixed in NetBSD-current:

----------------------------
revision 1.9
date: 2017-11-02 17:09:33 +0100;  author: christos;  state: Exp;  lines: +1 -1;  commitid: suMAMGeR2HNDKtdA;
Avoid negative shift.
----------------------------
MHassanNadeem commented 6 years ago

Link to the fix diff https://github.com/NetBSD/src/commit/713e2f607aad1cfffe1d814843fe7df5d1780bfc#diff-7a238ffcc3c5bd264217ae97b4c893df

Jksun88 commented 4 years ago

Just want to mention that the file to edit is in the directory where you clone rumprun. For example for me it was:

  1. /rumprun/src-netbsd/sys/lib/libunwind
  2. gedit AddressSpace.hpp (you can any editor that you want, I used gedit to see the lines number)
  3. Then change the line number 143 as @christos mentionned here