From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43B14A04F1; Fri, 13 Dec 2019 15:05:20 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D4D6A1BF8E; Fri, 13 Dec 2019 15:05:15 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 79CE41BF76 for ; Thu, 12 Dec 2019 18:53:22 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id p27so896724pli.10 for ; Thu, 12 Dec 2019 09:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4mXmzVm3gxF4Cs8Mdb/Y2D0F+ZEYi5t2CQRkHR1/gHQ=; b=PApHFNo5klXdlj9lBzombEvVx0yiuXNdSrRsEy5d2A48E6ghpv95iGtkETEphcfjYb aPt6TTJ584nopzC8jDB45f3rNOT6AsKl+lkNFZlODLKtN2hPQf5r5ZMjqTfunHN+vNd6 mr3iHwn2HfTR7EHxyWHflkAWKFKbkFuJZeVr96Plc4x66xw5SCmIRpoOmlrUMzsSFwgR yqQQhB/4+/cwQBV5MhaT78m/LUKhc/qyM41wX6W1A7Fg7uE2/kCww48y/n6CACJ/ZqSH gOVntIipES3n5F48WBivWRpPxynQL5jXm4E+abDLNAh2+15ZrHIiXyGzhf53NcmxnURN XvgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=4mXmzVm3gxF4Cs8Mdb/Y2D0F+ZEYi5t2CQRkHR1/gHQ=; b=A+xlYkPlg0TZQ0F0ipi5shlze7VGr+7xVeyw/W4SoWU3pdK1vughOHlkmfqG1gMheK wExpUMP8pujQuOasUArUxoXx0kX/jGNDsCqMVOnLFwUSM1ZZqa/uL9vE8UtLYV3E+AmM 252iFiscdUDgN88NBBXYOyIMEZ4B+LXOBKsheRatzO2+SiJglAIMz06y1F3t2Gqo0Yzj eAhI3fRVScF3+m/D63FeG9SqspNnUL61aHe4Nv1fMCgb/PNPH1LlXFScRX+jIZphNv+z mJOQS+JR7v8d0aoMdFANLIg0RgJGcMTY+lNzeRv0foEafwhNBID/M/Su5L8oVegyKSQU nF8w== X-Gm-Message-State: APjAAAX6v0YGBPn0HEWpzjwnvYgJp4i8omYoKg+yqdFKvheFpIQqI4QC s12wIbyOQQHj+7sqqe/LI18r40jhka4= X-Google-Smtp-Source: APXvYqw0oDgKxBD+SIZsCcTJ1ppImqJW3ES4Brj/TOfmW4/1JNCgk+KTZRt1TrAwcqJJ7UnTqvVwpw== X-Received: by 2002:a17:902:14f:: with SMTP id 73mr10961817plb.19.1576173201004; Thu, 12 Dec 2019 09:53:21 -0800 (PST) Received: from localhost (node-1w7jr9ss2r87ipezt91bdu6xx.ipv6.telus.net. [2001:569:bdb0:bb00::7a5]) by smtp.gmail.com with ESMTPSA id o31sm7045469pgb.56.2019.12.12.09.53.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 09:53:20 -0800 (PST) From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= To: dev@dpdk.org Cc: thomas@monjalon.net, =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Thu, 12 Dec 2019 09:53:12 -0800 Message-Id: <20191212175312.343458-1-espindola@scylladb.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Fri, 13 Dec 2019 15:05:12 +0100 Subject: [dpdk-dev] [PATCH v2] Don't combine -r and -export-dynamic linker options X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Running ld with -r switches the linker to a very special mode where some other linker options don't make sense. In particular, -export-dynamic normally requires that all global symbols be included in the dynamic symbol table, but a .o file doesn't even have a dynamic symbol table. When given both options it looks like the gnu linker just ignores -export-dynamic. Unfortunately some versions of lld (https://lld.llvm.org/) have a bug that causes it to try to create a dynamic symbol table in the output .o file and ends up corrupting it (https://bugs.llvm.org/show_bug.cgi?id=43552). Current (git) version of lld now issues an error. This patch filters out -export-dynamic from $(LDFLAGS) when using -r. With this patch I can build dpdk with lld. Signed-off-by: Rafael Ávila de Espíndola --- mk/internal/rte.compile-pre.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/internal/rte.compile-pre.mk b/mk/internal/rte.compile-pre.mk index 0cf3791b4..82fe098f7 100644 --- a/mk/internal/rte.compile-pre.mk +++ b/mk/internal/rte.compile-pre.mk @@ -61,7 +61,7 @@ CHECK_EXPERIMENTAL = $(EXPERIMENTAL_CHECK) $(SRCDIR)/$(EXPORT_MAP) $@ PMDINFO_GEN = $(RTE_SDK_BIN)/app/dpdk-pmdinfogen $@ $@.pmd.c PMDINFO_CC = $(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@.pmd.o $@.pmd.c -PMDINFO_LD = $(CROSS)ld $(LDFLAGS) -r -o $@.o $@.pmd.o $@ +PMDINFO_LD = $(CROSS)ld -r $(filter-out -export-dynamic,$(LDFLAGS)) -o $@.o $@.pmd.o $@ PMDINFO_TO_O = if grep -q 'RTE_PMD_REGISTER_.*(.*)' $<; then \ echo "$(if $V,$(PMDINFO_GEN), PMDINFO $@.pmd.c)" && \ $(PMDINFO_GEN) && \ -- 2.23.0