Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Jun 26, 2024
2 parents e3cabc1 + d28bff1 commit a0c0bdc
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
From 76c863fe607d7f457f6d1e9ca26f634383fb5f57 Mon Sep 17 00:00:00 2001
From: Carlos Miguel Ferreira <carlosmf.pt@gmail.com>
Date: Wed, 12 Jun 2024 01:20:59 +0100
Subject: [PATCH] libquadmath: Add libquadmath to the toolchain

This commit makes the libquadmath library available to the GCC
toolchain. This library is important for libraries such as
Boost.charconv

Signed-off-by: Carlos Miguel Ferreira <carlosmf.pt@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15637
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
package/libs/toolchain/Makefile | 41 +++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

diff --git a/package/libs/toolchain/Makefile b/package/libs/toolchain/Makefile
index f9f8ac9..8066e35 100644
--- a/package/libs/toolchain/Makefile
+++ b/package/libs/toolchain/Makefile
@@ -83,6 +83,33 @@ define Package/libatomic/config
endmenu
endef

+define Package/libquadmath
+$(call Package/gcc/Default)
+ DEPENDS:=@TARGET_x86||TARGET_x86_64 +libgcc
+ TITLE:=Quadmath support library
+ ABI_VERSION:=1
+endef
+
+define Package/libquadmath/config
+ menu "Configuration"
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
+
+ config LIBQUADMATH_ROOT_DIR
+ string
+ prompt "libquadmath shared library base directory"
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
+ default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
+ default "/" if NATIVE_TOOLCHAIN
+
+ config LIBQUADMATH_FILE_SPEC
+ string
+ prompt "libquadmath shared library files (use wildcards)"
+ depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
+ default "./lib/libquadmath.so.*"
+
+ endmenu
+endef
+
define Package/libstdcpp
$(call Package/gcc/Default)
NAME:=libstdc++
@@ -482,6 +509,11 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
$(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/
endef

+ define Package/libquadmath/install
+ $(INSTALL_DIR) $(1)/lib
+ $(CP) $(TOOLCHAIN_DIR)/lib/libquadmath.so.* $(1)/lib/
+ endef
+
define Package/libgfortran/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/
@@ -692,6 +724,14 @@ else
exit 0
endef

+ define Package/libquadmath/install
+ for file in $(call qstrip,$(CONFIG_LIBQUADMATH_FILE_SPEC)); do \
+ $(INSTALL_DIR) $(1)/lib ; \
+ $(CP) $(call qstrip,$(CONFIG_LIBQUADMATH_ROOT_DIR))/$$$$file $(1)/lib/ ; \
+ done ; \
+ exit 0
+ endef
+
define Package/libgomp/install
for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \
$(INSTALL_DIR) $(1)/lib ; \
@@ -723,6 +763,7 @@ endif
$(eval $(call BuildPackage,libc))
$(eval $(call BuildPackage,libgcc))
$(eval $(call BuildPackage,libatomic))
+$(eval $(call BuildPackage,libquadmath))
$(eval $(call BuildPackage,libstdcpp))
$(eval $(call BuildPackage,libasan))
$(eval $(call BuildPackage,libtsan))
3 changes: 3 additions & 0 deletions openwrt/scripts/00-prepare_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ curl -s https://$mirror/openwrt/patch/generic/0002-rootfs-add-upx-compression-su
# kernel: Add support for llvm/clang compiler
curl -s https://$mirror/openwrt/patch/generic/0003-kernel-Add-support-for-llvm-clang-compiler.patch | patch -p1

# toolchain: Add libquadmath to the toolchain
curl -s https://$mirror/openwrt/patch/generic/0004-libquadmath-Add-libquadmath-to-the-toolchain.patch | patch -p1

# meson: add platform variable to cross-compilation file
curl -s https://$mirror/openwrt/patch/generic/010-meson-add-platform-variable-to-cross-compilation-file.patch | patch -p1

Expand Down

0 comments on commit a0c0bdc

Please sign in to comment.