From patchwork Mon Jun 24 19:31:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 11014027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03BEF13AF for ; Mon, 24 Jun 2019 19:40:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8ED528448 for ; Mon, 24 Jun 2019 19:40:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA56E288C7; Mon, 24 Jun 2019 19:40:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61C6F28448 for ; Mon, 24 Jun 2019 19:40:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728401AbfFXTkL (ORCPT ); Mon, 24 Jun 2019 15:40:11 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:38320 "EHLO mx1.polytechnique.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbfFXTkL (ORCPT ); Mon, 24 Jun 2019 15:40:11 -0400 X-Greylist: delayed 477 seconds by postgrey-1.27 at vger.kernel.org; Mon, 24 Jun 2019 15:40:10 EDT Received: from localhost.localdomain (85-168-38-217.rev.numericable.fr [85.168.38.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id A37C95647AC for ; Mon, 24 Jun 2019 21:32:11 +0200 (CEST) From: Nicolas Iooss To: selinux@vger.kernel.org Subject: [PATCH 1/1] libsepol: include module.c internal header in module_to_cil.c Date: Mon, 24 Jun 2019 21:31:54 +0200 Message-Id: <20190624193154.8453-1-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Mon Jun 24 21:32:11 2019 +0200 (CEST)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In module_to_cil.c, sepol_ppfile_to_module_package() calls functions from module.c without including the internal header. This makes building libsepol with "gcc -flto -fuse-ld=gold" fails when linking libsepol.so: /tmp/ccHYAKVZ.ltrans21.ltrans.o::function sepol_ppfile_to_module_package: error: undefined reference to 'sepol_module_package_free' /tmp/ccHYAKVZ.ltrans21.ltrans.o::function sepol_ppfile_to_module_package: error: undefined reference to 'sepol_module_package_create' /tmp/ccHYAKVZ.ltrans21.ltrans.o::function sepol_ppfile_to_module_package: error: undefined reference to 'sepol_module_package_create' collect2: error: ld returned 1 exit status Fixes: https://github.com/SELinuxProject/selinux/issues/165 Signed-off-by: Nicolas Iooss --- libsepol/src/module_to_cil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libsepol/src/module_to_cil.c b/libsepol/src/module_to_cil.c index da62c8aaf0ef..1af166c9abd0 100644 --- a/libsepol/src/module_to_cil.c +++ b/libsepol/src/module_to_cil.c @@ -54,6 +54,7 @@ #include "kernel_to_common.h" #include "private.h" +#include "module_internal.h" #ifdef __GNUC__ # define UNUSED(x) UNUSED_ ## x __attribute__((__unused__))