Created
July 1, 2014 08:48
-
-
Save pichuang/7372af6d5d3bd1db5a88 to your computer and use it in GitHub Desktop.
OpenWrt Support libatomic patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Signed-off-by: Tobias Steinicke <tobias.steinicke at inet.tu-berlin.de> | |
#https://lists.openwrt.org/pipermail/openwrt-devel/2014-March/024286.html | |
--- a/package/libs/toolchain/Makefile 2014-07-01 16:33:40.734903000 +0800 | |
+++ b/package/libs/toolchain/Makefile 2014-07-01 15:02:10.730903000 +0800 | |
@@ -52,6 +52,31 @@ | |
endmenu | |
endef | |
+define Package/libatomic | |
+$(call Package/gcc/Default) | |
+ DEPENDS:=+libgcc | |
+ TITLE:=Atomic support library | |
+endef | |
+ | |
+define Package/libatomic/config | |
+ menu "Configuration" | |
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic | |
+ | |
+ config LIBATOMIC_ROOT_DIR | |
+ string | |
+ prompt "libatomic shared library base directory" | |
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic | |
+ default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN | |
+ default "/" if NATIVE_TOOLCHAIN | |
+ | |
+ config LIBATOMIC_FILE_SPEC | |
+ string | |
+ prompt "libatomic shared library files (use wildcards)" | |
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libatomic | |
+ default "./lib/libatomic.so.*" | |
+ | |
+ endmenu | |
+endef | |
define Package/libssp | |
$(call Package/gcc/Default) | |
@@ -289,9 +314,9 @@ | |
mkdir -p $(PKG_BUILD_DIR) | |
endef | |
-LIBGCC_A=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a)) | |
-LIBGCC_MAP=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map)) | |
-LIBGCC_SO=$(lastword $(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*)) | |
+LIBGCC_A=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc_pic.a) | |
+LIBGCC_MAP=$(wildcard $(TOOLCHAIN_DIR)/lib/gcc/*/*/libgcc.map) | |
+LIBGCC_SO=$(wildcard $(TOOLCHAIN_DIR)/lib/libgcc_s.so.*) | |
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),) | |
ifneq ($(if $(CONFIG_USE_UCLIBC),$(CONFIG_GCC_VERSION_LINARO)),) | |
BUILD_LIBGCC:=$(if $(CONFIG_avr32)$(CONFIG_m68k)$(CONFIG_powerpc),,$(PKG_BUILD_DIR)/libgcc_s.so.*) | |
@@ -316,6 +341,13 @@ | |
-Wl,-soname=libcrypt.so.0 | |
$(SCRIPT_DIR)/relink-lib.sh \ | |
"$(TARGET_CROSS)" \ | |
+ "$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic.so)" \ | |
+ "$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic.a)" \ | |
+ "$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libatomic*.so))" \ | |
+ $(BUILD_LIBGCC) \ | |
+ -Wl,-soname=libatomic.so.0 | |
+ $(SCRIPT_DIR)/relink-lib.sh \ | |
+ "$(TARGET_CROSS)" \ | |
"$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so)" \ | |
"$(wildcard $(TOOLCHAIN_DIR)/lib/libm_pic.a)" \ | |
"$(patsubst $(TOOLCHAIN_DIR)/lib/%,$(PKG_BUILD_DIR)/%,$(wildcard $(TOOLCHAIN_DIR)/lib/libm-*.so))" \ | |
@@ -367,6 +399,11 @@ | |
$(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgcc_s.so.* $(1)/lib/) | |
endef | |
+ define Package/libatomic/install | |
+ $(INSTALL_DIR) $(1)/lib | |
+ $(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/) | |
+ endef | |
+ | |
define Package/libgfortran/install | |
$(INSTALL_DIR) $(1)/usr/lib | |
$(if $(CONFIG_TARGET_avr32)$(CONFIG_TARGET_coldfire),,$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/) | |
@@ -414,7 +451,7 @@ | |
$(TOOLCHAIN_DIR)/lib/libc.so.* \ | |
$(TOOLCHAIN_DIR)/lib/libuClibc-$(LIBC_SO_VERSION).so \ | |
$(1)/lib/ | |
- for file in libcrypt libdl libm libutil; do \ | |
+ for file in libatomic libcrypt libdl libm libutil; do \ | |
$(CP) \ | |
$(TOOLCHAIN_DIR)/lib/$$$$file.so.* \ | |
$(TOOLCHAIN_DIR)/lib/$$$$file-$(LIBC_SO_VERSION).so \ | |
@@ -588,6 +625,7 @@ | |
$(eval $(call BuildPackage,libc)) | |
$(eval $(call BuildPackage,libgcc)) | |
+$(eval $(call BuildPackage,libatomic)) | |
$(eval $(call BuildPackage,libssp)) | |
$(eval $(call BuildPackage,libstdcpp)) | |
$(eval $(call BuildPackage,libpthread)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment