You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123 lines
2.9 KiB

glib2: disable fortify source The glib2 package fails to build when CONFIG_PKG_FORTIFY_SOURCE_1 or CONFIG_PKG_FORTIFY_SOURCE_2 is enabled in the OpenWrt config: In file included from ../glib/libcharset/localcharset.c:28: /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-11.2.0_musl/include/fortify/stdio.h: In function 'snprintf': /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-11.2.0_musl/include/fortify/stdio.h:101:9: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] 101 | return __orig_snprintf(__s, __n, __f, __builtin_va_arg_pack()); | ^~~~~~ /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-11.2.0_musl/include/fortify/stdio.h: In function 'sprintf': /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-11.2.0_musl/include/fortify/stdio.h:110:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] 110 | __r = __orig_snprintf(__s, __b, __f, __builtin_va_arg_pack()); | ^~~ /home/stijn/Development/OpenWrt/openwrt/staging_dir/toolchain-powerpc64_e5500_gcc-11.2.0_musl/include/fortify/stdio.h:114:17: error: format not a string literal, argument types not checked [-Werror=format-nonliteral] 114 | __r = __orig_sprintf(__s, __f, __builtin_va_arg_pack()); | ^~~ Disable fortify source for the package as a workaround. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> (cherry picked from commit 723c4360c48a8483ab059e65dcd4a51cd6a5925b)
2 years ago
  1. #
  2. # Copyright (C) 2007-2019 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=glib2
  9. PKG_VERSION:=2.70.5
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=glib-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@GNOME/glib/2.70
  13. PKG_HASH:=f70bf76ebcc84e0705722f038be8e2f9a58d17e1a700810c635fcc18b8974b7e
  14. PKG_MAINTAINER:=Peter Wagner <tripolar@gmx.at>
  15. PKG_LICENSE:=LGPL-2.1-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_CPE_ID:=cpe:/a:gnome:glib
  18. PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
  19. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
  20. PKG_BUILD_DEPENDS:=libiconv/host
  21. HOST_BUILD_DEPENDS:=libiconv/host libffi/host pcre/host
  22. PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
  23. PKG_FORTIFY_SOURCE:=0
  24. PKG_INSTALL:=1
  25. include $(INCLUDE_DIR)/host-build.mk
  26. include $(INCLUDE_DIR)/package.mk
  27. include $(INCLUDE_DIR)/nls.mk
  28. include $(INCLUDE_DIR)/meson.mk
  29. define Package/glib2
  30. SECTION:=libs
  31. CATEGORY:=Libraries
  32. DEPENDS:=$(ICONV_DEPENDS) $(INTL_DEPENDS) +zlib +libpthread +libffi +libattr +libpcre
  33. TITLE:=glib 2.0
  34. URL:=http://www.gtk.org/
  35. endef
  36. define Package/glib2/description
  37. The GLib library of C routines
  38. endef
  39. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  40. TARGET_LDFLAGS += -Wl,--gc-sections
  41. COMP_ARGS= \
  42. -Dselinux=disabled \
  43. -Dlibmount=disabled \
  44. -Dman=false \
  45. -Ddtrace=false \
  46. -Dsystemtap=false \
  47. -Dsysprof=disabled \
  48. -Dgtk_doc=false \
  49. -Dbsymbolic_functions=true \
  50. -Dforce_posix_threads=true \
  51. -Dfam=false \
  52. -Dtests=false \
  53. -Dinstalled_tests=false \
  54. -Doss_fuzz=disabled \
  55. -Dglib_debug=disabled \
  56. -Dglib_assert=false \
  57. -Dglib_checks=true \
  58. -Dlibelf=disabled
  59. MESON_HOST_ARGS += $(COMP_ARGS) -Dxattr=false -Ddefault_library=static -Dnls=disabled
  60. MESON_ARGS += $(COMP_ARGS) -Dxattr=true -Db_lto=true -Ddefault_library=both -Dnls=$(if $(CONFIG_BUILD_NLS),en,dis)abled
  61. define Build/InstallDev
  62. $(INSTALL_DIR) $(1)/usr/bin
  63. $(CP) \
  64. $(PKG_INSTALL_DIR)/usr/bin/* \
  65. $(1)/usr/bin/
  66. $(INSTALL_DIR) $(1)/usr/include
  67. $(CP) \
  68. $(PKG_INSTALL_DIR)/usr/include/glib-2.0 \
  69. $(1)/usr/include/
  70. $(CP) \
  71. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0/include/*.h \
  72. $(1)/usr/include/glib-2.0/
  73. $(CP) \
  74. $(PKG_INSTALL_DIR)/usr/include/gio-unix-2.0 \
  75. $(1)/usr/include/
  76. $(INSTALL_DIR) $(1)/usr/lib
  77. $(CP) \
  78. $(PKG_INSTALL_DIR)/usr/lib/glib-2.0 \
  79. $(1)/usr/lib/
  80. $(CP) \
  81. $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a} \
  82. $(1)/usr/lib/
  83. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  84. $(INSTALL_DATA) \
  85. $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc \
  86. $(1)/usr/lib/pkgconfig
  87. $(INSTALL_DIR) $(2)/share/aclocal/
  88. $(INSTALL_DATA) \
  89. $(PKG_INSTALL_DIR)/usr/share/aclocal/*.m4 \
  90. $(2)/share/aclocal/
  91. $(INSTALL_DIR) $(1)/usr/share/glib-2.0
  92. $(CP) \
  93. $(PKG_INSTALL_DIR)/usr/share/glib-2.0/codegen \
  94. $(1)/usr/share/glib-2.0/
  95. endef
  96. define Package/glib2/install
  97. $(INSTALL_DIR) $(1)/usr/lib
  98. $(CP) \
  99. $(PKG_INSTALL_DIR)/usr/lib/*.so* \
  100. $(1)/usr/lib/
  101. endef
  102. $(eval $(call HostBuild))
  103. $(eval $(call BuildPackage,glib2))