Build pfp-cpp with rumpkernel - TODO: edit

From PeerFreedom Wiki
Jump to navigation Jump to search

to compile pfp-cpp with rumpkernel -1. Rumpkernel normal = git clone http://repo.rumpkernel.org/rumprun = git submodule update --init --recursive = ./build-rr.sh hw build install -- -F CFLAGS="-Wno-error=shift-negative-value" = CXXFLAGS="-Wno-error=shift-negative-value" ./build-rr.sh hw build install = export PATH="$(pwd)/rumprun/bin:$PATH"

0. Rumpkernel with sodium = git clone http://repo.rumpkernel.org/rumprun = git submodule update --init --recursive = ./build-rr.sh hw build install -- -F CFLAGS="-Wno-error=implicit-function-declaration -Wno-error=shift-negative-value" - diff ./src-netbsd - diff --git a/sys/lib/libunwind/libunwind.cxx b/sys/lib/libunwind/libunwind.cxx index e1897848..da023ad4 100644 --- a/sys/lib/libunwind/libunwind.cxx +++ b/sys/lib/libunwind/libunwind.cxx @@ -119,6 +119,7 @@ static _Unwind_Reason_Code unwind_phase2(ThisUnwindCursor &cursor,

    case _URC_INSTALL_CONTEXT:
      // Transfer control to landing pad.
      cursor.jumpto();

+ break;

    default:
      // Bad personality routine.
      return _URC_FATAL_PHASE2_ERROR;

@@ -181,6 +182,7 @@ static _Unwind_Reason_Code unwind_phase2_forced(ThisUnwindCursor &cursor,

    case _URC_INSTALL_CONTEXT:
      // Transfer control to landing pad.
      cursor.jumpto();

+ break;

    default:
      // Bad personality routine.
      return _URC_FATAL_PHASE2_ERROR;

diff --git a/platform/makepseudolinkstubs.sh b/platform/makepseudolinkstubs.sh index bac374e..ccc954e 100644 --- a/platform/makepseudolinkstubs.sh +++ b/platform/makepseudolinkstubs.sh @@ -20,7 +20,7 @@ rm -f ${OUTPUT}

printf '/* AUTOMATICALLY GENERATED */\n\n' >> ${OUTPUT}
printf '#include <sys/cdefs.h>\n\n' >> ${OUTPUT}
printf 'extern int main(int, char**);\n' >> ${OUTPUT}

-printf 'int _want_main(void); int _want_main(void) {return main(0, 0);}\n' \ +printf 'int _want_main(void); int _want_main(void) {return _main(0, 0);}\n' \

    >> ${OUTPUT}
printf 'int _stubnosys(void); int _stubnosys(void) {return -1;}\n' \
    >> ${OUTPUT}

diff --git a/src-netbsd b/src-netbsd --- a/src-netbsd +++ b/src-netbsd @@ -1 +1 @@ -Subproject commit b8b951e911a2fc555848a2785a9998bc128530b6 +Subproject commit b8b951e911a2fc555848a2785a9998bc128530b6-dirty - diff ./src-netbsd/ diff --git a/sys/lib/libunwind/libunwind.cxx b/sys/lib/libunwind/libunwind.cxx index e1897848..da023ad4 100644 --- a/sys/lib/libunwind/libunwind.cxx +++ b/sys/lib/libunwind/libunwind.cxx @@ -119,6 +119,7 @@ static _Unwind_Reason_Code unwind_phase2(ThisUnwindCursor &cursor,

    case _URC_INSTALL_CONTEXT:
      // Transfer control to landing pad.
      cursor.jumpto();

+ break;

    default:
      // Bad personality routine.
      return _URC_FATAL_PHASE2_ERROR;

@@ -181,6 +182,7 @@ static _Unwind_Reason_Code unwind_phase2_forced(ThisUnwindCursor &cursor,

    case _URC_INSTALL_CONTEXT:
      // Transfer control to landing pad.
      cursor.jumpto();

+ break;

    default:
      // Bad personality routine.
      return _URC_FATAL_PHASE2_ERROR;

1. libsodium • ./autogen.sh • ./configure --prefix=/home/user/.local/rumpkernel_libsodium --disable-shared --host=x86_64-rumprun-netbsd CC=x86_64-rumprun-netbsd-gcc CXX=x86_64-rumprun-netbsd-g++ • add to file src/libsodium/sodium/core.c at the end ???? int start() {

       printf("libsodium main() from rumpkernel\n");
       return 0;

} • make && make install

2. Boost: • ./bootstrap.sh --prefix=/home/user/.local/rumpkernel_boost/ • project-config.jam -> using gcc : : /home/user/workspace/rumprun/rumprun/bin/x86_64-rumprun-netbsd-g++ : <compileflags>--sysroot=/home/user/workspace/rumprun/rumprun/rumprun-x86_64 ; • ./b2 --prefix=/home/user/.local/rumpkernel_boost --with-system --with-filesystem --with-thread --with-program_options toolset=gcc link=static runtime-link=static -q install • in file include/boost/config/user.hpp add the lines

  1. define BOOST_NO_CXX14_CONSTEXPR

//#define BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG

  1. define BOOST_ASIO_DISABLE_CXX11_ALLOCATORS


3. pfpcpp export CMAKE_TOOLCHAIN_FILE=$(pwd)/cmake/toolchain_rumpkernel.cmake.in cmake .. && VERBOSE=1 make -j3 test-pfp

-todo : check the cstddef.cpp is for common in votecnode / fix the auto my_fd = ::dirfd(dir); in /home/user/.local/rumpkernel_boost/include/boost/process/detail/posix/handles.hpp / ...

4. rumpctrl - compile with gcc 7.1.0 CC=/home/user/.local/bin/gcc CXX=/home/user/.local/bin/g++ REALCC=/home/user/.local/bin/gcc ./buildnb.sh | tee -a out.log - with path in src-netbsd/ diff --git a/sbin/dump/Makefile b/sbin/dump/Makefile index 11de7316..0f15f770 100644 --- a/sbin/dump/Makefile +++ b/sbin/dump/Makefile @@ -26,7 +26,7 @@ WARNS?= 3 # XXX: sign-compare issues

PROG=  dump
LINKS= ${BINDIR}/dump ${BINDIR}/rdump

-CPPFLAGS+=-DRDUMP -I${.CURDIR} +CPPFLAGS+=-DRDUMP -I${.CURDIR} -Wno-format-truncation

# CPPFLAGS+= -DDEBUG -DTDEBUG -DFDEBUG -DWRITEDEBUG -DSTATS -DDIAGNOSTICS
SRCS=  itime.c main.c optr.c dumprmt.c rcache.c snapshot.c tape.c \
       traverse.c unctime.c ffs_inode.c ffs_bswap.c

diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c index 96b78cf0..bfe997e1 100644 --- a/sbin/dump/tape.c +++ b/sbin/dump/tape.c @@ -634,8 +634,10 @@ restore_check_point:

               switch(status) {
                       case X_FINOK:
                               Exit(X_FINOK);

+ break;

                       case X_ABORT:
                               Exit(X_ABORT);

+ break;

                       case X_REWRITE:
                               goto restore_check_point;
                       default:

diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 17e7b587..bdb1dbfd 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -199,6 +199,7 @@ mapfiles(ino_t maxino, u_int64_t *tape_size, char *diskname, char * const *dirv)

                       case FTS_NS:
                               msg("Can't fts_read %s: %s\n", entry->fts_path,
                                   strerror(errno));

+ break;

                       case FTS_DP:            /* already seen dir */
                               continue;
                       }

diff --git a/usr.sbin/rtadvd/advcap.c b/usr.sbin/rtadvd/advcap.c index 010c62fa..0a82eea9 100644 --- a/usr.sbin/rtadvd/advcap.c +++ b/usr.sbin/rtadvd/advcap.c @@ -280,6 +280,7 @@ tskip(char *bp)

                                       ;
                       } else
                               bp++;

+ break;

               case '"':
                       dquote = (dquote ? 0 : 1);
                       bp++;

- start server from dir buildrump.sh/ ./rump/bin/rump_server -lrumpnet_netinet -lrumpnet_net -lrumpnet unix:///tmp/rcs sudo ~/workspace/rumprun/rumprun/bin/rumprun qemu -i -I 'qnet0,vioif,-net type=tap' -W qnet0,inet,static,1.2.3.4/24 ./seed_server.bin

XXX rest of build pfp and vc diff --git a/include/boost/config/user.hpp b/include/boost/config/user.hpp index 28e7476..32e874c 100644 --- a/include/boost/config/user.hpp +++ b/include/boost/config/user.hpp @@ -131,3 +131,8 @@

// to ensure the correct libraries are selected at link time.
// #define BOOST_LIB_BUILDID amd64

+#define BOOST_NO_CXX14_CONSTEXPR +//#define BOOST_ASIO_DISABLE_STD_ALLOCATOR_ARG +#define BOOST_ASIO_DISABLE_CXX11_ALLOCATORS +#define BOOST_ASIO_HAS_STD_FUTURE_CLASS +#define BOOST_ASIO_HAS_CONSTEXPR diff --git a/include/boost/process/detail/posix/handles.hpp b/include/boost/process/detail/posix/handles.hpp index 1572f05..5d81b8b 100644 --- a/include/boost/process/detail/posix/handles.hpp +++ b/include/boost/process/detail/posix/handles.hpp @@ -31,7 +31,7 @@ inline std::vector<native_handle_type> get_handles(std::error_code & ec)

    else
        ec.clear();

- auto my_fd = ::dirfd(dir.get()); + auto my_fd = dirfd(dir.get());

    struct ::dirent * ent_p;

@@ -115,7 +115,7 @@ struct limit_handles_ : handler_base_ext

            return;
        }

- auto my_fd = ::dirfd(dir); + auto my_fd = dirfd(dir);

        struct ::dirent * ent_p;
        while ((ent_p = readdir(dir)) != nullptr)