Missing dependencies libstdc++.so.6

I have an openwrt sdk with external toolchain (crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1).

The errors is as follows
Package helloworldcpp is missing dependencies for the following libraries:
libstdc++.so.6

This error is in the install phase of the package build. So, the package doesn't provide it, because it is already in the sysroot folder of the external toolchain. Yet the openwrt install script complains. A workaround is to echo libstdc++.so.6 into staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/libstdcpp.provides. This has to be repeated because sometimes the build, or some other package, will erase that file.

If anyone know another workaround from this, please let us know.

Hellowroldcpp package used:

include $(TOPDIR)/rules.mk

# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)

PKG_NAME:=helloworldcpp
PKG_VERSION:=1.0
PKG_RELEASE:=1
PKG_FIXUP:=autoreconf

TARGET_CFLAGS += -std=gnu99
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
define Package/helloworldcpp
	SECTION:=examples
	CATEGORY:=Examples
	DEPENDS:=+libstdcpp
	TITLE:=Hello, World!
endef

# Package description; a more verbose description on what our package does
define Package/helloworldcpp/description
	A simple "Hello, world!" -application.
endef

# Package preparation instructions; create the build directory and copy the source code. 
# The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

# Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
define Package/helloworldcpp/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworldcpp $(1)/usr/bin
endef

# This command is always the last, it uses the definitions and variables we give above in order to get the job done
$(eval $(call BuildPackage,helloworldcpp))

Full Build output:

root@a7644fecf410:/src/openwrt# make package/helloworldcpp/compile V=s VERBOSE=1

make[1]: Entering directory '/src/openwrt'

make[2]: Entering directory '/src/openwrt/package/libs/toolchain'

echo "libc" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

echo "libgcc" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

echo "libssp" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

echo "libstdcpp" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

echo "libpthread" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

echo "librt" >> /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo/toolchain.default.install

make[2]: Leaving directory '/src/openwrt/package/libs/toolchain'

time: package/libs/toolchain/compile#0.12#0.04#0.16

make[2]: Entering directory '/src/helloworldcpp'

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.prepared_e0e9dbcb571e6752cb790fa2cce79255_6664517399ebbbc92a37c5bb081b5c53_check

mkdir -p /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0

cp -fpR ./src/* /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.prepared_e0e9dbcb571e6752cb790fa2cce79255_6664517399ebbbc92a37c5bb081b5c53

rm -f /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.configured_*

rm -f /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/stamp/.helloworldcpp_installed

(cd /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0; rm -f aclocal.m4; if [ -f ./configure.ac ] || [ -f ./configure.in ]; then [ -d ./autom4te.cache ] && rm -rf autom4te.cache; [ -e ./config.rpath ] || ln -s /src/openwrt/scripts/config.rpath ./config.rpath; touch NEWS AUTHORS COPYING ABOUT-NLS ChangeLog; AUTOM4TE=/src/openwrt/staging_dir/host/bin/autom4te AUTOCONF=/src/openwrt/staging_dir/host/bin/autoconf AUTOMAKE=/src/openwrt/staging_dir/host/bin/automake ACLOCAL=/src/openwrt/staging_dir/host/bin/aclocal AUTOHEADER=/src/openwrt/staging_dir/host/bin/autoheader LIBTOOLIZE=/src/openwrt/staging_dir/host/bin/libtoolize LIBTOOL=/src/openwrt/staging_dir/host/bin/libtool M4=/src/openwrt/staging_dir/host/bin/m4 AUTOPOINT=true LIBTOOLIZE='/src/openwrt/staging_dir/host/bin/libtoolize --install' /src/openwrt/staging_dir/host/bin/autoreconf -v -f -i -s -B /src/openwrt/staging_dir/host/share/aclocal -I /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/host/share/aclocal -I /src/openwrt/staging_dir/hostpkg/share/aclocal -I /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/share/aclocal -I m4 -I . . || true; fi; );

mkdir -p /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0

(cd /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0; CFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro " CXXFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro " LDFLAGS="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro " cmake -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=arm -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG" -DCMAKE_C_COMPILER="/src/openwrt/staging_dir/host/bin/ccache" -DCMAKE_C_COMPILER_ARG1="arm-buildroot-linux-gnueabi-gcc" -DCMAKE_CXX_COMPILER="/src/openwrt/staging_dir/host/bin/ccache" -DCMAKE_CXX_COMPILER_ARG1="arm-buildroot-linux-gnueabi-g++" -DCMAKE_ASM_COMPILER="/src/openwrt/staging_dir/host/bin/ccache" -DCMAKE_ASM_COMPILER_ARG1="arm-buildroot-linux-gnueabi-gcc" -DCMAKE_EXE_LINKER_FLAGS:STRING="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro" -DCMAKE_MODULE_LINKER_FLAGS:STRING="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro -Wl,-Bsymbolic-functions" -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro -Wl,-Bsymbolic-functions" -DCMAKE_AR="/src/openwrt/staging_dir/toolchain-arm-buildroot-linux-gnueabi/bin/arm-buildroot-linux-gnueabi-ar" -DCMAKE_NM="/src/openwrt/staging_dir/toolchain-arm-buildroot-linux-gnueabi/bin/arm-buildroot-linux-gnueabi-nm" -DCMAKE_RANLIB="/src/openwrt/staging_dir/toolchain-arm-buildroot-linux-gnueabi/bin/arm-buildroot-linux-gnueabi-ranlib" -DCMAKE_FIND_ROOT_PATH="/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr;/src/openwrt/staging_dir/toolchain-arm-buildroot-linux-gnueabi;"/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1"" -DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM=BOTH -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY -DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY -DCMAKE_STRIP=: -DCMAKE_INSTALL_PREFIX=/usr -DDL_LIBRARY=/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc -DCMAKE_PREFIX_PATH=/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc -DCMAKE_SKIP_RPATH=TRUE /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 )

Re-run cmake no build system arguments

-- The C compiler identification is GNU 5.5.0

-- The CXX compiler identification is GNU 5.5.0

-- Check for working C compiler: /src/openwrt/staging_dir/host/bin/ccache

-- Check for working C compiler: /src/openwrt/staging_dir/host/bin/ccache -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /src/openwrt/staging_dir/host/bin/ccache

-- Check for working CXX compiler: /src/openwrt/staging_dir/host/bin/ccache -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Configuring done

-- Generating done

CMake Warning:

Manually-specified variables were not used by the project:

CMAKE_ASM_COMPILER

CMAKE_ASM_COMPILER_ARG1

CMAKE_FIND_ROOT_PATH_MODE_LIBRARY

CMAKE_MODULE_LINKER_FLAGS

CMAKE_SHARED_LINKER_FLAGS

DL_LIBRARY

-- Build files have been written to: /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.configured_68b329da9893e34099c7d8ad5cb9c940

rm -f /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.built

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.built_check

CFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/include -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/include " CXXFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/include -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/include " LDFLAGS="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro " make -j1 -C /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/. AR="arm-buildroot-linux-gnueabi-ar" AS="ccache_cc -c -Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro" LD=arm-buildroot-linux-gnueabi-ld NM="arm-buildroot-linux-gnueabi-nm" CC="ccache_cc" GCC="ccache_cc" CXX="ccache_cxx" RANLIB="arm-buildroot-linux-gnueabi-ranlib" STRIP=arm-buildroot-linux-gnueabi-strip OBJCOPY=arm-buildroot-linux-gnueabi-objcopy OBJDUMP=arm-buildroot-linux-gnueabi-objdump SIZE=arm-buildroot-linux-gnueabi-size CROSS="arm-buildroot-linux-gnueabi-" ARCH="arm" CMAKE_COMMAND='/src/openwrt/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 ;

make[3]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

/src/openwrt/staging_dir/host/bin/cmake -S/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 -B/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 --check-build-system CMakeFiles/Makefile.cmake 0

/src/openwrt/staging_dir/host/bin/cmake -E cmake_progress_start /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/progress.marks

make -f CMakeFiles/Makefile2 all

make[4]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make -f CMakeFiles/helloworldcpp.dir/build.make CMakeFiles/helloworldcpp.dir/depend

make[5]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

cd /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 && /src/openwrt/staging_dir/host/bin/cmake -E cmake_depends "Unix Makefiles" /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/helloworldcpp.dir/DependInfo.cmake --color=

Dependee "/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/helloworldcpp.dir/DependInfo.cmake" is newer than depender "/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/helloworldcpp.dir/depend.internal".

Dependee "/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/helloworldcpp.dir/depend.internal".

Scanning dependencies of target helloworldcpp

make[5]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make -f CMakeFiles/helloworldcpp.dir/build.make CMakeFiles/helloworldcpp.dir/build

make[5]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

[ 50%] Building CXX object CMakeFiles/helloworldcpp.dir/main.cpp.o

/src/openwrt/staging_dir/host/bin/ccache arm-buildroot-linux-gnueabi-g++ -Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -DNDEBUG -std=gnu++11 -o CMakeFiles/helloworldcpp.dir/main.cpp.o -c /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/main.cpp

cc1plus: warning: command line option '-std=gnu99' is valid for C/ObjC but not for C++

[100%] Linking CXX executable helloworldcpp

/src/openwrt/staging_dir/host/bin/cmake -E cmake_link_script CMakeFiles/helloworldcpp.dir/link.txt --verbose=1

/src/openwrt/staging_dir/host/bin/ccache arm-buildroot-linux-gnueabi-g++ -Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -DNDEBUG -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro CMakeFiles/helloworldcpp.dir/main.cpp.o -o helloworldcpp

make[5]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

[100%] Built target helloworldcpp

make[4]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

/src/openwrt/staging_dir/host/bin/cmake -E cmake_progress_start /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles 0

make[3]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

CFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/include -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/include " CXXFLAGS="-Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/include -I/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/include -I/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/include " LDFLAGS="-L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/usr/lib -L/src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/usr/lib -L/opt/crosstools-arm-gcc-5.5-linux-4.1-glibc-2.26-binutils-2.28.1/lib -znow -zrelro " make -C /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/. AR="arm-buildroot-linux-gnueabi-ar" AS="ccache_cc -c -Os -pipe -fno-caller-saves -mfloat-abi=soft -std=gnu99 -Wformat -Werror=format-security -Wl,-z,now -Wl,-z,relro" LD=arm-buildroot-linux-gnueabi-ld NM="arm-buildroot-linux-gnueabi-nm" CC="ccache_cc" GCC="ccache_cc" CXX="ccache_cxx" RANLIB="arm-buildroot-linux-gnueabi-ranlib" STRIP=arm-buildroot-linux-gnueabi-strip OBJCOPY=arm-buildroot-linux-gnueabi-objcopy OBJDUMP=arm-buildroot-linux-gnueabi-objdump SIZE=arm-buildroot-linux-gnueabi-size CROSS="arm-buildroot-linux-gnueabi-" ARCH="arm" CMAKE_COMMAND='/src/openwrt/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 DESTDIR="/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-install" install;

make[3]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

/src/openwrt/staging_dir/host/bin/cmake -S/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 -B/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 --check-build-system CMakeFiles/Makefile.cmake 0

/src/openwrt/staging_dir/host/bin/cmake -E cmake_progress_start /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/progress.marks

make -f CMakeFiles/Makefile2 all

make[4]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make -f CMakeFiles/helloworldcpp.dir/build.make CMakeFiles/helloworldcpp.dir/depend

make[5]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

cd /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 && /src/openwrt/staging_dir/host/bin/cmake -E cmake_depends "Unix Makefiles" /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles/helloworldcpp.dir/DependInfo.cmake --color=

make[5]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make -f CMakeFiles/helloworldcpp.dir/build.make CMakeFiles/helloworldcpp.dir/build

make[5]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make[5]: Nothing to be done for 'CMakeFiles/helloworldcpp.dir/build'.

make[5]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

[100%] Built target helloworldcpp

make[4]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

/src/openwrt/staging_dir/host/bin/cmake -E cmake_progress_start /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/CMakeFiles 0

make -f CMakeFiles/Makefile2 preinstall

make[4]: Entering directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

make[4]: Nothing to be done for 'preinstall'.

make[4]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

Install the project...

/src/openwrt/staging_dir/host/bin/cmake -P cmake_install.cmake

-- Install configuration: "Release"

-- Installing: /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-install/usr/usr/bin/helloworldcpp

make[3]: Leaving directory '/src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0'

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.built

rm -rf /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp.installed /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp

mkdir -p /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp

install -d -m0755 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp/usr/bin

install -m0755 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/helloworldcpp /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp/usr/bin

touch /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp.installed

mkdir -p /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/root-bcm53xx/stamp

SHELL= flock /src/openwrt/tmp/.root-copy.flock -c 'cp -fpR /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/.pkgdir/helloworldcpp/. /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/root-bcm53xx/'

touch /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/root-bcm53xx/stamp/.helloworldcpp_installed

mkdir -p /src/openwrt/bin/targets/bcm53xx/generic/packages /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-arm_cortex-a9/helloworldcpp/CONTROL /src/openwrt/staging_dir/target-arm-buildroot-linux-gnueabi_glibc/pkginfo

install -d -m0755 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-arm_cortex-a9/helloworldcpp/usr/bin

install -m0755 /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/helloworldcpp /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-arm_cortex-a9/helloworldcpp/usr/bin

find /src/openwrt/build_dir/target-arm-buildroot-linux-gnueabi_glibc/helloworldcpp-1.0/ipkg-arm_cortex-a9/helloworldcpp -name 'CVS' -o -name '.svn' -o -name '.#*' -o -name '*~'| xargs -r rm -rf

Package helloworldcpp is missing dependencies for the following libraries:

libstdc++.so.6

make[2]: *** [Makefile:51: /src/openwrt/bin/packages/arm_cortex-a9/hans/helloworldcpp_1.0-1_arm_cortex-a9.ipk] Error 1

make[2]: Leaving directory '/src/helloworldcpp'

time: package/feeds/hans/helloworldcpp/compile#0.58#0.24#0.83

make[1]: *** [package/Makefile:113: package/feeds/hans/helloworldcpp/compile] Error 2

make[1]: Leaving directory '/src/openwrt'

make: *** [/src/openwrt/include/toplevel.mk:227: package/helloworldcpp/compile] Error 2

Wat's wrong with the included toolchain?

the toolchain is working fine.
I'm building for a broadcom box for a customer.

That has nothing to do with OpenWrt, whatever SDK you are using is NOT OpenWrt

Then you will have to ask the provider of the toolchain/SDK.

Well, we are cloning openwrt with an external toolchain.
It's not an sdk, but just a toolchain.

... which is not OpenWrt and thus not supported. Nobody here knows what toolchain you are referring to or what the provider of the toolchain has done. Hence all comments are pure guesswork and you're better off asking the provider of the toolchain.

You may be right that its not a openwrt fault.

I have had this problem with other external toolchains as well. I'm suspecting either the problem is with the toolchain's location of libstdc++.so.6, the ext-toolchains.sh script used to set up openwrt with external toolchain, or scripts/install.mk where it looks for depends.

The binaries runs fine on the target when transferred manually, also for more advanced C and C++ builds. Its just the ipk package build that fails.

Thanks,
Hans

There’s no maybe about it, the Broadcom SDK has almost nothing to do with openwrt

For broadcom, yes. They are not supported, I get it, and I understand why.

But this is not the only toolchain I've had problems with over the years. Not going to dig up old work of mine just to find out which, but hear me out. It's usually just this libstdcpp problem each time. Some of us use OpenWRT sdk to build packages only, not the full firmware. Then the external toolchain is very useful. With many targets to build for, and many sdks, it is difficult to make the same sources work for all of them.

When you build for a c++ project, you put DEPENDS:=+libstdcpp in your makefile, you imply that there is a package libstdcpp that provides libstdc++.so. In openwrt this package is made by toolchain/Makefile. Now this doesn't make sense for external toolchain IN GENERAL. Because then the toolchain is already built and is not a package. so the libstdc++ is already on the router, and the libstdcpp.provides file is empty.

OpenWrt SDK does not support external toolchain, it supports whatever toolchain was used to create it. So You can't mix official OpenWrt SDK with whatever toolchain someone created and expect it to work.
With that out of the way, Your libstdcpp package in DEPENDS array does not provide libstdc++ that
helloworldcpp is linked to. So fix libstdcpp package recipe (package/libs/toolchain/Makefile) to provide valid library.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.