diff --git a/.github/workflows/demo_test.yml b/.github/workflows/demo_test.yml index 366efbaa..34c9a1a7 100644 --- a/.github/workflows/demo_test.yml +++ b/.github/workflows/demo_test.yml @@ -47,8 +47,9 @@ jobs: - name: C++ test run: docker exec language_support_test bash -c "cd /root/occlum/demos/hello_cc && make; occlum new occlum_instance; - cp hello_world occlum_instance/image/bin; - cd occlum_instance && SGX_MODE=SIM occlum build; + cd occlum_instance && rm -rf image; + copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template; + SGX_MODE=SIM occlum build; occlum run /bin/hello_world" - name: Rust test diff --git a/demos/hello_cc/README.md b/demos/hello_cc/README.md index 9c98dcae..4b8a979c 100644 --- a/demos/hello_cc/README.md +++ b/demos/hello_cc/README.md @@ -24,8 +24,8 @@ Either way, the resulting `hello_world` can be found in the current directory. 3. Run `hello_world` on Occlum ``` mkdir occlum_workspace && cd occlum_workspace -occlum init -cp ../hello_world image/bin +occlum init && rm -rf image +copy_bom -f ../hello.yaml --root image --include-dir /opt/occlum/etc/template occlum build occlum run /bin/hello_world ``` diff --git a/demos/hello_cc/hello.yaml b/demos/hello_cc/hello.yaml new file mode 100644 index 00000000..0171a4c3 --- /dev/null +++ b/demos/hello_cc/hello.yaml @@ -0,0 +1,7 @@ +includes: + - base.yaml +targets: + - target: /bin + copy: + - files: + - ../hello_world diff --git a/tools/toolchains/glibc/build.sh b/tools/toolchains/glibc/build.sh index 4c45c3f8..b004a417 100755 --- a/tools/toolchains/glibc/build.sh +++ b/tools/toolchains/glibc/build.sh @@ -31,3 +31,7 @@ CFLAGS="-O2 -g ${EXTRA_CFLAGS}" ${SRC_DIR}/configure \ --enable-stack-protector=strong --disable-nscd ${EXTRA_CONFIG_OPTION} make make install + +# prepare softlinks to enable autodep for C++ +ln -sf /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /opt/occlum/glibc/lib/libstdc++.so.6 +ln -sf /lib/x86_64-linux-gnu/libgcc_s.so.1 /opt/occlum/glibc/lib/libgcc_s.so.1 \ No newline at end of file