Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross Compiling #36

Open
sirmuzz opened this issue Feb 22, 2021 · 0 comments
Open

Cross Compiling #36

sirmuzz opened this issue Feb 22, 2021 · 0 comments

Comments

@sirmuzz
Copy link

sirmuzz commented Feb 22, 2021

Hello,

I have a need to debug some lua code running on a remote router. I have been attempting to get this to compile in the cross-compiler and have little luck. I was unable to past an errorr_r error in the includes using the included asio library, but have been able to build it with boost.

I believe i have most of the includes needed to build it properly. Can you see anything i am doing wrong? I have not been able to get it to go in cross yet.

include $(TOPDIR)/rules.mk

PKG_NAME:=LRDB
PKG_VERSION:=0.5.4
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/satoren/LRDB.git
PKG_SOURCE_VERSION:=v0.5.4
PKG_HASH:=skip
PKG_INSTALL:=1

PKG_MAINTAINER:=<redacted>
PKG_LICENSE:=CC0-1.0

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk


MAKE_FLAGS+=VERBOSE=1
CMAKE_OPTIONS+=-g -std=c++11 -pthread -DLUA=lua -DCMAKE_INSTALL_PREFIX=/usr -DLRDB_USE_BOOST_ASIO=true -Wall -DBUILD_NO_TESTS=true -DEMSCRIPTEN=false
TARGET_LDFLAGS+=-lstdc++ -llua -lboost_system -lboost_coroutine -lboost_regex


define Package/LRDB
	SECTION:=Net
	CATEGORY:=Network
	TITLE:=Lua Remote DeBugger
	URL:=https://github.com/satoren/LRDB
	DEPENDS:=+libstdcpp +libpthread +boost-system +boost-coroutine +boost-regex +liblua
endef

define Package/LRDB/description
  Lua Remote DeBugger
endef

# define Package/LRDB/install
# 	$(INSTALL_DIR)	$(1)/usr/lib/lua
# 	$(INSTALL_DIR)	$(1)/usr/bin
# 	$(INSTALL_BIN) 	$(CMAKE_INSTALL_PREFIX)/lib/lrdb_server*	$(1)/usr/lib/lua/
# 	$(INSTALL_BIN) 	$(CMAKE_INSTALL_PREFIX)/bin/lrdb_server*	$(1)/usr/bin/

# # 	$(CP) ./files/* $(1)/
# endef

$(eval $(call BuildPackage,LRDB))
[100%] Linking CXX executable lua_with_lrdb_server
/package_builder/sdk/1806/ar71xx/staging_dir/host/bin/cmake -E cmake_link_script CMakeFiles/lua_with_lrdb_server.dir/link.txt --verbose=1
/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-musl-g++  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4:LRDB-0.5.4 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -static-libgcc -static-libstdc++ -DNDEBUG  -L/package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/usr/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib -znow -zrelro -lstdc++ -llua -lboost_system -lboost_coroutine -lboost_regex -rdynamic CMakeFiles/lua_with_lrdb_server.dir/src/lua_with_lrdb_server.cpp.o  -o lua_with_lrdb_server -llua -lm 
CMakeFiles/lua_with_lrdb_server.dir/build.make:83: recipe for target 'lua_with_lrdb_server' failed
make[5]: Leaving directory '/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4'
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/lua_with_lrdb_server.dir/all' failed
make[4]: Leaving directory '/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4'
Makefile:83: recipe for target 'all' failed
builder       | Wl,-z,relro" LD=mips-openwrt-linux-musl-ld NM="mips-openwrt-linux-musl-gcc-nm" CC="mips-openwrt-linux-musl-gcc" GCC="mips-openwrt-linux-musl-gcc" CXX="mips-openwrt-linux-musl-g++" RANLIB="mips-openwrt-linux-musl-gcc-ranlib" STRIP=mips-openwrt-linux-musl-strip OBJCOPY=mips-openwrt-linux-musl-objcopy OBJDUMP=mips-openwrt-linux-musl-objdump SIZE=mips-openwrt-linux-musl-size CROSS="mips-openwrt-linux-musl-" ARCH="mips" VERBOSE=1 CMAKE_COMMAND='/package_builder/sdk/1806/ar71xx/staging_dir/host/bin/cmake' CMAKE_DISABLE_cmake_check_build_system=1 VERBOSE=1 ;
builder       | /package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-musl-g++  -DLRDB_USE_BOOST_ASIO -Dlrdb_server_EXPORTS -isystem /package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/usr/include -I/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/third_party/picojson -I/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/include  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4:LRDB-0.5.4 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -static-libgcc -static-libstdc++ -DNDEBUG -fPIC   -Wall -W -pedantic -Wno-variadic-macros -Wno-unused-local-typedefs -Wno-unknown-warning-option -std=c++11 -fno-strict-overflow -o CMakeFiles/lrdb_server.dir/src/debug_server_module.cpp.o -c /package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/src/debug_server_module.cpp
builder       | /package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-musl-g++ -fPIC -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4:LRDB-0.5.4 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -static-libgcc -static-libstdc++ -DNDEBUG -L/package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/usr/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/usr/lib -L/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/lib -znow -zrelro -lstdc++ -llua -lboost_system -lboost_coroutine -lboost_regex -Wl,-Bsymbolic-functions -shared -Wl,-soname,liblrdb_server.so -o liblrdb_server.so CMakeFiles/lrdb_server.dir/src/debug_server_module.cpp.o -llua -lm 
builder       | /package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-musl-g++  -DLRDB_USE_BOOST_ASIO -isystem /package_builder/sdk/1806/ar71xx/staging_dir/target-mips_24kc_musl/usr/include -I/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/third_party/picojson -I/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/include  -Os -pipe -mno-branch-likely -mips32r2 -mtune=24kc -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -msoft-float -mips16 -minterlink-mips16 -iremap/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4:LRDB-0.5.4 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -static-libgcc -static-libstdc++ -DNDEBUG   -Wall -W -pedantic -Wno-variadic-macros -Wno-unused-local-typedefs -Wno-unknown-warning-option -std=c++11 -fno-strict-overflow -o CMakeFiles/lua_with_lrdb_server.dir/src/lua_with_lrdb_server.cpp.o -c /package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/src/lua_with_lrdb_server.cpp
builder       | /package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/mips-openwrt-linux-musl-g++  -Os -pipe -mno-branch-likely -mi/package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/bin/../lib/gcc/mips-openwrt-linux-musl/7.3.0/../../../../mips-openwrt-linux-musl/bin/ld: CMakeFiles/lua_with_lrdb_server.dir/src/lua_with_lrdb_server.cpp.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'
builder       | /package_builder/sdk/1806/ar71xx/staging_dir/toolchain-mips_24kc_gcc-7.3.0_musl/mips-openwrt-linux-musl/bin/../../../toolchain-mips_24kc_gcc-7.3.0_musl/lib/libgcc_s.so.1: error adding symbols: DSO missing from command line
builder       | collect2: error: ld returned 1 exit status
builder       | make[5]: *** [lua_with_lrdb_server] Error 1
builder       | make[4]: *** [CMakeFiles/lua_with_lrdb_server.dir/all] Error 2
builder       | make[3]: *** [all] Error 2
builder       | make[2]: *** [/package_builder/sdk/1806/ar71xx/build_dir/target-mips_24kc_musl/LRDB-0.5.4/.built] Error 2
builder       | Command exited with non-zero status 2

Any help would be appreciated. Im not a well versed C/C++ developer and this has gotten my goat for a week.

Thank you!
RD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant