From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) by dpdk.org (Postfix) with ESMTP id 6712D29B6 for ; Wed, 24 Feb 2016 03:24:49 +0100 (CET) Received: by mail-io0-f170.google.com with SMTP id z135so14596944iof.0 for ; Tue, 23 Feb 2016 18:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=ZtqvdLdS7i31EhrqE2rXA2+LBm7tgLOr9FxuGV0LhiI=; b=AaziLsbFArbJJvpEMfdoBZNexjBmJ2yJlhW0gr4WsRzyBl6OE4Zyt94krbDVSfJXH+ HeljeHJJF7QQ4niDYS6ZPGJgYhMvfxTLfaDgYM5cMWZyesodtKo4sFHaSpglxflFe+zq kFrPqBgyYF80teGRvQKQod5ETRpwUWDxj1xNisv/SbNAFGDSJ/qi27eLiODJ4+SngVAV 7pmtuZj79eQoc7MrTIBI8Cllklam2NPkGBe7yVdermigq4Qlv3kR42DNVo7q1gB1sTm8 RQnmFTh6UiFz7izd+h84VKvYkUOTOGe88Aa7P4vbxC3eYBe+F/wngvPamphFxVP0aC+Q yHNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=ZtqvdLdS7i31EhrqE2rXA2+LBm7tgLOr9FxuGV0LhiI=; b=ZQvpWgqfe5WOHMw79wB8n/TL2EbwSUTXvvbSLT5RU0cRis33XiNDx43IhE50TN3+I8 jWdMXyHYeiDQTDQnUiixwtWgJJbZ0HOhr5zSqe7LPEn3QyA2rzLQmH/d1fCKHdW5hYyT 4OPMHnXOQexfyK4N0jCZFrO4ftWHm4Jh/+borThFeMws8bLoonuRZNWTMwj5E5NTJ1tC WBMOezkEFvzfmP5AL9ZXEE/+LHpwdUCO8hUIqmXDSMZVGeWww8QsH45q54oMzA5LwJ/4 NuzAcwa+Y7XFhZRXGCyASdv3Mb7jHsQut8Hed1+wiQLsdhwZB4rkshAEhL7QaLrLhyAm KhmQ== X-Gm-Message-State: AG10YOT+QUPX1u/Vi0gp5niw+IP8x/mUukkzm/OFGbF03jZwknghB3b9ta6CCk9YKaCCLB3+IOvspXWKE58rKw== MIME-Version: 1.0 X-Received: by 10.107.28.82 with SMTP id c79mr34296467ioc.86.1456280688911; Tue, 23 Feb 2016 18:24:48 -0800 (PST) Received: by 10.36.203.131 with HTTP; Tue, 23 Feb 2016 18:24:48 -0800 (PST) Date: Tue, 23 Feb 2016 20:24:48 -0600 Message-ID: From: Stefan Puiu To: "dev@dpdk.org" Content-Type: text/plain; charset=UTF-8 Subject: [dpdk-dev] including rte.app.mk from a Makefile.am X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2016 02:24:49 -0000 Hi, I'm working on a Linux project that uses the DPDK and (unfornately, IMO) automake; so we have a Makefile.am where we include rte.extapp.mk and rte.vars.mk from the DPDK, add LDLIBS to the linker However, I've tried building against DPDK 2.2 and I'm getting linker errors about options like '--no-as-needed', '--whole-archive' etc not being recognized. Basically, we use libtool to link the binary, which behind the scenes ends up calling gcc to link the binary, and gcc doesn't know how to read linker options - they need to be prefixed with '-Wl,..'. I've traced this to this part of rte.app.mk: === DPDK 1.7.1 ifeq ($(LINK_USING_CC),1) LDLIBS := $(call linkerprefix,$(LDLIBS)) LDFLAGS := $(call linkerprefix,$(LDFLAGS)) === DPDK 2.2 (since DPDK 1.8, AFAICT) ifeq ($(LINK_USING_CC),1) O_TO_EXE = $(CC) $(CFLAGS) $(LDFLAGS_$(@)) \ -Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y) $(call linkerprefix,$(LDFLAGS)) \ $(EXTRA_LDFLAGS) $(call linkerprefix,$(LDLIBS)) Notice on 1.7.1 LDFLAGS gets the -Wl, prefix if linking with gcc; for 2.2, that doesn't happen anymore - note O_TO_EXE calls linkerprefix explicitly for LDLIBS and LDFLAGS. The change that removed the LDLIBS/LDFLAGS setting is 3c6a14f6, which ironically says "mk: fix link with CC" in the title. I've tried working around this, but apparently automake doesn't give you too much control of what you can do; overriding LDFLAGS with $(call linkerprefix,$(LDFLAGS) in Makefile.am doesn't work. Since LDFLAGS is treated as a user variable by automake, it's tricky to override it. Now my question is: is this supposed to work? Is there any point in trying to use the mk files from my outside project? I noticed dpdk-ovs doesn't seem to bother with that, and just builds one library to link against. I guess it's useful to pick up the defines that the DPDK was built against, so inline functions in headers are properly picked up. Are there people using the DPDK from projects using automake? IMO, It would be nice if you could extract the CPPFLAGS/LDFLAGS etc from the DPDK without including the mk files - maybe by running something like 'make showvars' or something like that in the DPDK dir. Then external projects could integrate those in their build system without too much extra baggage. Thanks, Stefan.