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 Aug 29, 2024
1 parent 34123b1 commit 9547eeb
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion shared.mk
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $(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-libgcc install-shared-libgcc install-shared-libs

# TODO: change copy to softlink
# TODO: second and third "for" should be reimplemented using ldconfig once provided
Expand Down Expand Up @@ -78,3 +78,34 @@ 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-libgcc:

install-shared-libgcc:

else

# Copy toolchain provided shared libs to fs
rootfs-install-shared-libgcc: GLOBAL_SYSROOT := $$($(CC) --print-sysroot)
install-shared-libgcc: GLOBAL_SYSROOT := $$($(CC) --print-sysroot)

# TODO: do not hardcode versions of libs
# TODO: change copy to softlink
rootfs-install-shared-libgcc: $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)/$(REALNAME)
$(SIL)cp $(GLOBAL_SYSROOT)/lib/libstdc++.so.6.28 $(GLOBAL_SYSROOT)/lib/libgcc_s.so.1 $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH)
$(SIL)(cd $(PREFIX_ROOTFS)$(LOCAL_INSTALL_PATH) && \
cp libstdc++.so.6.28 libstdc++.so.6 && cp libstdc++.so.6.28 libstdc++.so && \
cp libgcc_s.so.1 libgcc_s.so \
)

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

endif

0 comments on commit 9547eeb

Please sign in to comment.