includeos / IncludeOS

A minimal, resource efficient unikernel for cloud services
https://www.includeos.org
Apache License 2.0
4.89k stars 360 forks source link

Compiler return error after compiled idt.cpp file. #1769

Closed rchatsiri closed 6 years ago

rchatsiri commented 6 years ago

I run command line for check full compiled flag by sudo make VERBOSE=1. Compiler show an error as below.

[ 69%] Building CXX object src/platform/x86_pc/CMakeFiles/x86_pc.dir/idt.cpp.o
cd /home/vagrant/IncludeOS/build_x86_64/src/platform/x86_pc && /usr/bin/c++   -DARCH=\"x86_64\" -DARCH_x86_64 -DINCLUDEOS_SINGLE_THREADED -D_LIBCPP_HAS_NO_THREADS -I/home/vagrant/IncludeOS/api/posix -I/home/vagrant/IncludeOS/build_x86_64/precompiled/src/PrecompiledLibraries/x86_64/libcxx/include -I/home/vagrant/IncludeOS/build_x86_64/precompiled/src/PrecompiledLibraries/x86_64/newlib/include -I/home/vagrant/IncludeOS/build_x86_64/precompiled/src/solo5_repo/kernel -I/home/vagrant/IncludeOS/src/include -I/home/vagrant/IncludeOS/api -I/home/vagrant/IncludeOS/mod -I/home/vagrant/IncludeOS/mod/GSL -I/home/vagrant/IncludeOS/mod/rapidjson/include -I/home/vagrant/IncludeOS/mod/uzlib/src -I/home/vagrant/IncludeOS/build_x86_64/botan/src/botan -I/home/vagrant/IncludeOS/build_x86_64/openssl/src/openssl_bundle -I/home/vagrant/IncludeOS/build_x86_64/openssl/src/openssl_bundle/include  -std=c++17 -MMD -msse3 -mfpmath=sse -fstack-protector-strong -D_STACK_GUARD_VALUE_=0x5A0362904D656F6B -DNO_DEBUG=1 -DOS_TERMINATE_ON_CONTRACT_VIOLATION  -O2 -m64 -Wall -Wextra -Wno-frame-address -nostdlib -fno-omit-frame-pointer -c  -DOS_VERSION=\"v0.12.0-dirty\"   -o CMakeFiles/x86_pc.dir/idt.cpp.o -c /home/vagrant/IncludeOS/src/platform/x86_pc/idt.cpp
/home/vagrant/IncludeOS/src/platform/x86_pc/idt.cpp:301:25: error: expected ‘)’ before ‘optnone’
 __attribute__((noreturn optnone, weak))
                         ^
/home/vagrant/IncludeOS/src/platform/x86_pc/idt.cpp:301:25: error: expected ‘)’ before ‘optnone’
/home/vagrant/IncludeOS/src/platform/x86_pc/idt.cpp:331:1: error: expected unqualified-id at end of input
 }
 ^
/home/vagrant/IncludeOS/src/platform/x86_pc/idt.cpp:183:20: warning: ‘exception_names’ defined but not used [-Wunused-variable]
 static const char* exception_names[] =
                    ^
cc1plus: warning: unrecognized command line option ‘-Wno-frame-address’
src/platform/x86_pc/CMakeFiles/x86_pc.dir/build.make:587: recipe for target 'src/platform/x86_pc/CMakeFiles/x86_pc.dir/idt.cpp.o' failed
make[2]: *** [src/platform/x86_pc/CMakeFiles/x86_pc.dir/idt.cpp.o] Error 1
make[2]: Leaving directory '/home/vagrant/IncludeOS/build_x86_64'
CMakeFiles/Makefile2:644: recipe for target 'src/platform/x86_pc/CMakeFiles/x86_pc.dir/all' failed
make[1]: *** [src/platform/x86_pc/CMakeFiles/x86_pc.dir/all] Error 2
make[1]: Leaving directory '/home/vagrant/IncludeOS/build_x86_64'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2

In Weak attribute is __attribute__((noreturn optnone, weak)) of function __cpu_exception(). I'm change attribute declaration from old to new is __attribute__((weak)). Compile can compile source code completed.

fwsGonzo commented 6 years ago

Thanks, I committed this, which should hopefully compile: https://github.com/fwsGonzo/IncludeOS/commit/505d07a9f5f96593c9868485f420956f7454c50c