For the 'Marvell Orion' target the iptables package does not compile.
See forum topic: https://forum.openwrt.org/viewtopic.php?pid=117520
Maybe for other targets as well?

In short: the problem is that /usr/lib/libc is used while linking
instead of the cross-compiled version.

I provided a patch for this problem, but I am unsure whether it is a
correct fix or just an ugly hack. I did not check whether this patch is
disturbing any of the other targets.
But, with a clean checkout (with the default configuration, Broadcom
BCM947xx/953xx) it builds fine.

So could someone take a look at it and eventually provide feedback for
improvements or tell that it is good as it is and it can be submitted?

Thanks,
  Maarten
Index: package/iptables/Makefile
===================================================================
--- package/iptables/Makefile	(revision 23239)
+++ package/iptables/Makefile	(working copy)
@@ -254,7 +254,10 @@
 	-I$(LINUX_DIR)/arch/$(LINUX_KARCH)/include \
 	$(TARGET_CPPFLAGS)
 
+IPTABLES_LIBDIR=$(TOOLCHAIN_DIR)/lib/
+
 CONFIGURE_ARGS += \
+        --libdir=$(IPTABLES_LIBDIR)\
 	--enable-shared \
 	--enable-devel \
 	--enable-ipv6 \
@@ -293,12 +296,12 @@
 
 	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
 	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.{a,so*} $(1)/usr/lib/
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libip*tc.{a,so*} $(1)/usr/lib/
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libipq.a $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/libxtables.{a,so*} $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/libip*tc.{a,so*} $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)libipq.a $(1)/usr/lib/
 	$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/xtables.pc $(1)/usr/lib/pkgconfig/
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libiptc.pc $(1)/usr/lib/pkgconfig/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/pkgconfig/xtables.pc $(1)/usr/lib/pkgconfig/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/pkgconfig/libiptc.pc $(1)/usr/lib/pkgconfig/
 endef
 
 define Package/iptables/install
@@ -335,20 +338,20 @@
 
 define Package/libiptc/install
 	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libip*tc.so* $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/libip*tc.so* $(1)/usr/lib/
 endef
 
 define Package/libxtables/install
 	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libxtables.so* $(1)/usr/lib/
+	$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/libxtables.so* $(1)/usr/lib/
 endef
 
 define BuildPlugin
   define Package/$(1)/install
 	$(INSTALL_DIR) $$(1)/usr/lib/iptables
 	for m in $(patsubst xt_%,ipt_%,$(2)) $(patsubst ipt_%,xt_%,$(2)); do \
-		if [ -f $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so ]; then \
-			$(CP) $(PKG_INSTALL_DIR)/usr/lib/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
+		if [ -f $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/iptables/lib$$$$$$$${m}.so ]; then \
+			$(CP) $(PKG_INSTALL_DIR)$(IPTABLES_LIBDIR)/iptables/lib$$$$$$$${m}.so $$(1)/usr/lib/iptables/ ; \
 		fi; \
 	done
 	$(3)
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to