OpenWrt Forum Archive

Topic: SDK and absolute paths

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

Hi!

I still have a problem with the SDK; some of my libs/programs fail with this error:

ld: cannot find -lgcc_s

Looking at:

https://lists.openwrt.org/pipermail/ope … 06021.html

it seems it is a problem of hard-coded paths. Where can I find the script mentionned to convert absolute paths to relative paths?

Thanks,

Provide more context.

I'm using the backfire 10.03.01 SDK, for x86, from here:

http://downloads.openwrt.org/backfire/1 … 86_generic

Here is the Makefile I'm using:

include $(TOPDIR)/rules.mk

PKG_NAME:=pthsem
PKG_VERSION:=2.0.7
PKG_RELEASE:=2
PKG_MD5SUM:=b277716ee1224ca9925176fa29e1f0c5

PKG_SOURCE_URL:=@SF/bcusdk
PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).tar.gz
PKG_CAT:=zcat

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install

include $(INCLUDE_DIR)/package.mk

define Package/pthsem
  SECTION:=libs
  CATEGORY:=Libraries
  TITLE:=Pth threads with semaphore support
  URL:=http://sourceforge.net/projects/bcusdk/
  TARGET_LDFLAGS += -rpath-link /data/tmp/OpenWrt-SDK-x86-for-Linux-i686-gcc-4.1.2_uClibc-0.9.30.1/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.30.1/lib/ld-uClibc.so.0
endef

define Build/Compile
    LDFLAGS="$(LIBGCC_S)" $(MAKE) -C $(PKG_BUILD_DIR) \
        DESTDIR="$(PKG_INSTALL_DIR)" \
        all install
endef

define Build/InstallDev
    mkdir -p $(STAGING_DIR)/usr/include
    $(CP) $(PKG_INSTALL_DIR)/usr/include/pthsem.h $(STAGING_DIR)/usr/include/
    mkdir -p $(STAGING_DIR)/usr/lib
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libpthsem.a $(STAGING_DIR)/usr/lib/
endef

define Build/UninstallDev
    rm -rf \
        $(STAGING_DIR)/usr/include/pthsem.h \
        $(STAGING_DIR)/usr/lib/libpthsem.a
endef

$(eval $(call BuildPackage,pthsem))

I also tried to recompile the complete toolchain of this backfire version, but I also encountered compilation errors sad

Why is it not possible to use the SDK? Is it supposed to work, or not? Do the mentionned scripts exist?

Yes this SDK version is broken wrt. absolute paths, you need to symlink the path it expects to the location it is in.

Ok, I understand.

How can I find the paths it is looking for?

BTW, I just tried the 12.09-rc1SDK, and it looks like it has same issues (with other errors, but same kind of problem).

(Last edited by fma on 18 Mar 2013, 13:02)

Well *paste* the actual errors.

jow, it seems like there are lots of these. Is the SDK page in docs wrong, or difficult to understand?

Ok, my fault; this was only a missing package on my host (I'm not a cross-compiling guru, and it is not easy to understand if the error comes from the host compiler or the cross-compiler!)

glad you fixed it.
Can you elaborate as an FYI for future fails?
Going the exigent route I linked above creates everything: it may well waste space and time, but it works.
Would be nice to get the SDK version bullet proof though.

Right now, I only switched to the attitude_adjustment/12.09-rc1 SDK. And so far, it seems to work (new issues are related to the packages I try to compile).

The package which was missing on my machine was 'ccache'.

The discussion might have continued from here.