OpenWrt Forum Archive

Topic: compile problem

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I tried to compile srelay for openwrt.

make
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c init.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c readconf.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c util.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c socks.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c relay.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c main.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c auth-pwd.c
mips-openwrt-linux-uclibc-gcc-4.8.3 -I.  -DHAVE_CONFIG_H -DSYSCONFDIR=\"/usr/local/etc\" -Wall -Wno-unused-result -Wno-unused-but-set-variable -static -c get-bind.c
mips-openwrt-linux-uclibc-gcc-4.8.3 init.o readconf.o util.o socks.o relay.o main.o auth-pwd.o get-bind.o -lcrypt -L/usr/local/lib  -pthread -o srelay

file srelay
srelay: ELF 32-bit MSB executable, MIPS, MIPS32 rel2 version 1, dynamically linked, interpreter /lib/ld-uClibc.so.0, not stripped

This works fine, but when I try to execute it on my openwrt based router I onlyy get this error:

root@Host:/tmp# ./srelay
-ash: ./srelay: not found
root@Host:/tmp#

I would execute "ldd ./srleay" and see if it is missing any library.

Thanks.

Yes, one libary file was missing - now, it runs.

ldd ./srelay
        /lib/ld-uClibc.so.0 (0x557d8000)
        libcrypt.so.0 => /lib/libcrypt.so.0 (0x7748e000)
        libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x7746a000)
        libc.so.0 => /lib/ld-uClibc.so.0 (0x557d8000)
Error relocating ./srelay: __uClibc_main: symbol not found

What does this relocatin error mean?

(Last edited by onlineuser on 28 Nov 2017, 14:29)

The discussion might have continued from here.