Skip to content

Commit

Permalink
shared.mk: install toolchain provided dynamic libraries
Browse files Browse the repository at this point in the history
JIRA: RTOS-664
  • Loading branch information
badochov committed Sep 2, 2024
1 parent 2310ddd commit cae7c5e
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions shared.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ $(PREFIX_SO)$(REALNAME): $(OBJS)

LOCAL_INSTALL_PATH := $(or $(LOCAL_INSTALL_PATH),$(DEFAULT_INSTALL_PATH_SO))

install-shared: $(PREFIX_SO)$(REALNAME) $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME) install-shared-libs
install-shared: $(PREFIX_SO)$(REALNAME) $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME) rootfs-install-shared-toolchain-libs install-shared-toolchain-libs install-shared-libs


# TODO: change copy to softlink
# TODO: second and third "for" should be reimplemented using ldconfig once provided
$(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME): $(PREFIX_SO)$(REALNAME)
$(INSTALL_FS)

Expand All @@ -59,3 +58,35 @@ install-shared-libs: $(PREFIX_SO)$(REALNAME) install-libs
fi \
done \
)

# During toolchain build shared toolchain libs are not yet ready.
ifeq ($(TOOLCHAIN_BUILD),y)

rootfs-install-shared-toolchain-libs:

install-shared-toolchain-libs:

else


GLOBAL_SYSROOT := $$($(CC) --print-sysroot)


rootfs-install-shared-toolchain-libs: GLOBAL_SYSROOT := $(GLOBAL_SYSROOT)
install-shared-toolchain-libs: GLOBAL_SYSROOT := $(GLOBAL_SYSROOT)

# TODO: do not hardcode versions of libs
rootfs-install-shared-toolchain-libs: $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME)
$(SIL)cp $(GLOBAL_SYSROOT)/lib/libstdc++.so.6.28 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
$(SIL)cp $(GLOBAL_SYSROOT)/lib/libgcc_s.so.1 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)


install-shared-toolchain-libs: install-shared-libs
$(SIL)ln -sf $(GLOBAL_SYSROOT)/lib/libstdc++.so.6.28 $(LIBC_INSTALL_DIR)
$(SIL)ln -sf $(GLOBAL_SYSROOT)/lib/libgcc_s.so.1 $(LIBC_INSTALL_DIR)
$(SIL)(cd $(LIBC_INSTALL_DIR) && \
ln -sf libstdc++.so.6.28 libstdc++.so.6 && ln -sf libstdc++.so.6.28 libstdc++.so && \
ln -sf libgcc_s.so.1 libgcc_s.so \
)

endif

0 comments on commit cae7c5e

Please sign in to comment.