[LEDE-DEV] It seems to me like the build system ignores EXTRA_FLAGS?

Dan Lüdtke mail at danrl.com
Thu Dec 1 01:17:21 PST 2016


Hi Jo,


> try using TARGET_LDFLAGS += -largp

Makefile for reference below and here: https://paste.fedoraproject.org/494537/05830811/

Result:
> x86_64-openwrt-linux-musl-gcc -Wall -O2 -I./../../include -I/home/danrl/lede/nat64/source/staging_dir/target-x86_64_musl-1.1.15/usr/include/libnl3     -o jool ../../common/netlink/jool-config.o ../../common/stateful/jool-xlat.o ../common/jool-cJSON.o ../common/jool-dns.o ../common/jool-file.o ../common/jool-jool.o ../common/jool-netlink2.o ../common/jool-str_utils.o ../common/argp/jool-options.o ../common/nl/jool-buffer.o ../common/target/jool-bib.o ../common/target/jool-eam.o ../common/target/jool-global.o ../common/target/jool-instance.o ../common/target/jool-joold.o ../common/target/jool-json.o ../common/target/jool-log_time.o ../common/target/jool-pool.o ../common/target/jool-pool4.o ../common/target/jool-pool6.o ../common/target/jool-session.o -L/home/danrl/lede/nat64/source/staging_dir/target-x86_64_musl-1.1.15/usr/lib -lnl-genl-3 -lnl-3 -lpthread -lm 
> ../common/jool-jool.o: In function `main':
> jool.c:(.text.startup+0x89): undefined reference to `argp_parse'
> collect2: error: ld returned 1 exit status
> Makefile:504: recipe for target 'jool' failed
> make[6]: *** [jool] Error 1

The flags don't show up in the final command as far as I can tell. But even if it would, the error stays the same. (See other mail). I am puzzled why this happens.


I don't think it is a good idea, but would it be possible to make this Package depend on using glibc for the toolchain? I tried to squeeze it into DEPENDS:= but that wasn't working well.

The package works for me, as I use glibc in the toolchain. I like to upstream it into LEDE/OpenWRT so that others can use it, too, but it breaks the build currently. Frustrating. Why is argp such a rocket science? Can't believe something as basic as this isn't in musl.


Dan


Makefile:
#
# Copyright (C) 2016 Dan Luedtke <mail at danrl.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.

include $(TOPDIR)/rules.mk

PKG_NAME:=jool
PKG_VERSION:=3.5.1
PKG_RELEASE:=1

PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/danrl/Jool.git
PKG_SOURCE_VERSION:=c3463caf91781c1ebb40249f236f6ae028c88f74
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=+argp-standalone +automake
PKG_AUTOMAKE_PATHS:=usr
#PKG_FIXUP:=autoreconf
MAKE_PATH:=usr

TARGET_LDFLAGS += -largp

# does not work
#EXTRA_CFLAGS:=-largp-standalone
#EXTRA_LDFLAGS:=-largp-standalone

# does not work either
#EXTRA_CFLAGS:=-largp
#EXTRA_LDFLAGS:=-largp

include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk

define Package/jool/Default
	SECTION:=net
	CATEGORY:=Network
	URL:=https://www.jool.mx
	MAINTAINER:=Dan Luedtke <mail at danrl.com>
endef

define Package/jool/Default/description
	Jool is an Open Source SIIT and NAT64 for Linux.
endef

define Package/jool
	$(call Package/jool/Default)
	TITLE:=Jool meta-package
	DEPENDS:=+kmod-jool +jool-tools
endef

define Package/jool/description
	$(call Package/jool/Default/description)
endef

include $(INCLUDE_DIR)/kernel-defaults.mk
include $(INCLUDE_DIR)/package-defaults.mk

define KernelPackage/jool
	SECTION:=kernel
	CATEGORY:=Kernel modules
	SUBMENU:=Network Support
	TITLE:=Jool kernel module
	DEPENDS:= \
		@IPV6 \
		+kmod-crypto-md5 \
		+kmod-nf-conntrack \
		+kmod-nf-conntrack6
	FILES:= \
		$(PKG_BUILD_DIR)/mod/stateful/jool.$(LINUX_KMOD_SUFFIX) \
		$(PKG_BUILD_DIR)/mod/stateless/jool_siit.$(LINUX_KMOD_SUFFIX)
endef

define KernelPackage/jool/description
	$(call Package/jool/Default/description)

	This package provides the kernel module for Jool.
endef

define Package/jool-tools
	$(call Package/jool/Default)
	TITLE:=Jool userspace control programs
	DEPENDS:=+libnl +ethtool
endef

define Package/jool-tools/description
	$(call Package/jool/Default/description)

	This package provides the userspace control programs for Jool.
endef

define Package/jool-tools/install
	$(INSTALL_DIR) $(1)/usr/sbin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/stateful/jool       $(1)/usr/sbin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/usr/stateless/jool_siit $(1)/usr/sbin/
endef

define Build/Configure
	( cd $(PKG_BUILD_DIR)/usr; ./autogen.sh )
	( cd $(PKG_BUILD_DIR)/usr; ./configure )
endef

define Build/Compile
	$(MAKE) -C "$(LINUX_DIR)" \
		KERNEL_DIR="$(LINUX_DIR)" \
		ARCH="$(LINUX_KARCH)" \
		CROSS_COMPILE="$(TARGET_CROSS)" \
		SUBDIRS="$(PKG_BUILD_DIR)/mod/stateful" \
		V="$(V)" \
		modules
	$(MAKE) -C "$(LINUX_DIR)" \
		KERNEL_DIR="$(LINUX_DIR)" \
		ARCH="$(LINUX_KARCH)" \
		CROSS_COMPILE="$(TARGET_CROSS)" \
		SUBDIRS="$(PKG_BUILD_DIR)/mod/stateless" \
		V="$(V)" \
		modules
	$(call Build/Compile/Default)
endef

$(eval $(call BuildPackage,jool))
$(eval $(call KernelPackage,jool))
$(eval $(call BuildPackage,jool-tools))




More information about the Lede-dev mailing list