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 99B62A04F6; Mon, 6 Jan 2020 22:24:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0AF0D1D708; Mon, 6 Jan 2020 22:24:51 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by dpdk.org (Postfix) with ESMTP id B73EB1D707 for ; Mon, 6 Jan 2020 22:24:48 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id n9so19647289pff.13 for ; Mon, 06 Jan 2020 13:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=RJdS0TMnAOCitBqkhWBwo6KJbs7+tVm/wRXqzEP262Q=; b=KX4r4ZHhTLhIX3SgfMd8aZ8jfloRsartEDGIrO750wxd/Kn7kLzsy2CRpcKpJ4xorU hgadiqoK2EzMX1ef/AEf0GxYokJzLhELpGqVY9FLjR4gNBKXYyNHFIfMWO3y9LKp9VrS /t6S7VLf7M/eePNFplchEfpRFgRA2Io6aFT7AFsOM+oJknZuWkTzGG5PBoquwt93xxtV 2wucC7m7b+i8oWZ8A3/M8vCrIT2mvpHkteMEWlVCPC0TyJ4ehbnBBR2kq539Q8dFqeTD sslXofJAz4LUbGqcOxDkZkL7tK0Eyg8z4MuAcMDdEU3zzqOV1Gi6N2Nnw59rXbt7koUy aZtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=RJdS0TMnAOCitBqkhWBwo6KJbs7+tVm/wRXqzEP262Q=; b=AHHj6GnM7ForBO2hS7rZFnj/jLn5cbR2Ct5+cXe2ZBwbfK6W5/RgynzcKuml2pTPxT lfYBGxtEFQRjMGCTtNA800JR29LW2cQzbDqF6//Ea8teqD7d2B9WuNO4G9MfFdkpjqeZ fgTjlJ5LguwPvG0fKI2NIteXx5HKlJ1xdsDdPewJB+RIDrwnqc+5a8OjeQTHVurcjeCD YYvoCLLNieF65AQmBGRcpa6dfStvsnvXjC1AYp3IzL3mhlIzVDlV4LgR3Of6nSuthbkV YqYA8sHr068D5WaSfospIgJKBZGpTuEaX7GyG0/XKEP5iObC2QPjOK6CTuYpkH7/Gosv r6Bw== X-Gm-Message-State: APjAAAUHJny6D8leC3wiT2B5IVMM+x2WUs+tbgy3tE+Vu6Yjk27KMUsg zbj9kv7ZySc86XlTNRD6zo86IInJ9W6BfFV4bMSS+5L0 X-Google-Smtp-Source: APXvYqxGfbushqh+MjAchQdBh5nSX2BFM9nLz7zVsGu99Ui3Xj3SvHRKZ3f9MA6LU1jR38AJjw4gHl5ppWrC0xoP3KI= X-Received: by 2002:a65:58ce:: with SMTP id e14mr112632756pgu.153.1578345887540; Mon, 06 Jan 2020 13:24:47 -0800 (PST) MIME-Version: 1.0 From: Sachin Jain Date: Mon, 6 Jan 2020 13:24:36 -0800 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] C++ app does not execute DPDK constructors. 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" Hi *What am I trying to do?* I am trying to write Gtests for my application based on DPDK. *Details about the app:* The application compiles dpdk as static library. Its a pretty simple. For now it just runs a dummy Gtest and create a memory pool. The key is, its a C++ file. I see no issue if it were a C app. *Issue I am facing:* The call to rte_mempool_create fails() with "Err: No such file or directory". *More debugging:* The reason for the above failure is, the constructor for the ring driver is not getting called. Specifically below code in ~/driver/mempool/ring/rte_mempool_ring.c. MEMPOOL_REGISTER_OPS(ops_mp_mc); MEMPOOL_REGISTER_OPS(ops_sp_sc); MEMPOOL_REGISTER_OPS(ops_mp_sc); MEMPOOL_REGISTER_OPS(ops_sp_mc); So when I look at the C app which has these constructors called, I see the init_array size to be much larger than the the C++ app. Considering the two code are almost identical, I don't know what am I missing to have these constructors run. They are definitely getting compiled but are not called. *What have I tried:* 1. I tried the --whole-archive LD option but I dont think that should play a part here since the constructors does get called with C app. Any suggestions? Regards Sachin.