linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Andi Kleen <andi@firstfloor.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	samitolvanen@google.com, alxmtvv@gmail.com,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 20/21] Kbuild, lto: Add Link Time Optimization support
Date: Sat, 27 Jan 2018 01:15:49 +0100	[thread overview]
Message-ID: <CAK8P3a3RQhiEkh6uUjdX-juXggNdZxvxRPJbE6M3e6Dy-ycGxw@mail.gmail.com> (raw)
In-Reply-To: <20171127213423.27218-21-andi@firstfloor.org>

On Mon, Nov 27, 2017 at 10:34 PM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
> - Add a new LDFINAL variable that controls the final link
> for vmlinux or module. In this case we call gcc-ld instead
> of ld, to run the LTO step.

When I tried this out on allmodconfig (following the lwn article), I ran into
a number of warnings:

WARNING: modpost: missing MODULE_LICENSE() in
drivers/isdn/hardware/eicon/diva_mnt.o
see include/linux/module.h for more information
WARNING: modpost: missing MODULE_LICENSE() in drivers/isdn/hysdn/hysdn.o
see include/linux/module.h for more information
WARNING: modpost: missing MODULE_LICENSE() in drivers/vhost/vhost_scsi.o
see include/linux/module.h for more information
WARNING: modpost: missing MODULE_LICENSE() in drivers/scsi/pcmcia/qlogic_cs.o
see include/linux/module.h for more information
WARNING: modpost: missing MODULE_LICENSE() in drivers/scsi/pcmcia/fdomain_cs.o
...

These are apparently all compound modules that do have a valid
license, and modinfo
shows it correctly:

modinfo build/tmp/drivers/isdn/hardware/eicon/diva_mnt.ko
filename:
/home/arnd/arm-soc/build/tmp/drivers/isdn/hardware/eicon/diva_mnt.ko
license:        GPL
author:         Cytronics & Melware, Eicon Networks
description:    Maint driver for Eicon DIVA Server cards
...

but something in the LTO build conuses modpost to the point that it doesn't
see it.

I also get 131 errors in x86 allmodconfig along the lines of

/git/arm-soc/include/linux/slab.h:298:0: error: type of
'kmalloc_caches' does not match original declaration
[-Werror=lto-type-mismatch]
 extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
 /git/arm-soc/mm/slab_common.c:958:1: note: 'kmalloc_caches' was
previously declared here
 EXPORT_SYMBOL(kmalloc_caches);

/git/arm-soc/include/linux/seq_file.h:109:5: error: type of 'seq_open'
does not match original declaration [-Werror=lto-type-mismatc
h]
 int seq_open(struct file *, const struct seq_operations *);
     ^
/git/arm-soc/fs/seq_file.c:48:0: note: 'seq_open' was previously declared here
 int seq_open(struct file *file, const struct seq_operations *op)

I found a fix for some of these issues attached to
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83954
but am still doing more randconfig build testing.

        Arnd

  reply	other threads:[~2018-01-27  0:15 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 21:34 Link time optimization for LTO/x86 Andi Kleen
2017-11-27 21:34 ` [PATCH 01/21] x86/xen: Mark pv stub assembler symbol visible Andi Kleen
2017-11-27 21:34 ` [PATCH 02/21] afs: Fix const confusion in AFS Andi Kleen
2017-11-27 21:34 ` [PATCH 03/21] x86/timer: Don't inline __const_udelay Andi Kleen
2017-11-27 21:34 ` [PATCH 04/21] locking/spinlocks: Mark spinlocks noinline when inline spinlocks are disabled Andi Kleen
2017-11-27 21:34 ` [PATCH 05/21] x86/kvm: Make steal_time visible Andi Kleen
2017-11-27 21:34 ` [PATCH 06/21] x86/syscalls: Make x86 syscalls use real prototypes Andi Kleen
2017-11-27 21:34 ` [PATCH 07/21] x86: Make exception handler functions visible Andi Kleen
2017-11-27 21:34 ` [PATCH 08/21] x86/idt: Make const __initconst Andi Kleen
2017-11-27 21:34 ` [PATCH 09/21] lto: Use C version for SYSCALL_ALIAS Andi Kleen
2017-11-27 21:34 ` [PATCH 10/21] Fix read buffer overflow in delta-ipc Andi Kleen
2017-11-27 21:34 ` [PATCH 11/21] trace: Use -mcount-record for dynamic ftrace Andi Kleen
2017-12-01  0:22   ` Steven Rostedt
2018-05-01 18:42     ` Steven Rostedt
2017-11-27 21:34 ` [PATCH 12/21] ftrace: Mark function tracer test functions noinline/noclone Andi Kleen
2017-11-27 21:34 ` [PATCH 13/21] ftrace: Disable LTO for ftrace self tests Andi Kleen
2017-11-27 21:34 ` [PATCH 14/21] lto, fs: Avoid static variable in linux/fs.h Andi Kleen
2017-11-27 21:34 ` [PATCH 15/21] lto, x86, mm: Disable vmalloc BUILD_BUG_ON for LTO Andi Kleen
2017-11-27 21:34 ` [PATCH 16/21] lto: Add __noreorder and mark initcalls __noreorder Andi Kleen
2017-11-27 21:34 ` [PATCH 17/21] lto, workaround: Disable LTO for BPF Andi Kleen
2017-11-27 21:34 ` [PATCH 18/21] lto, crypto: Disable LTO for camelia glue Andi Kleen
2017-11-27 21:34 ` [PATCH 19/21] lto, x86: Disable LTO for realmode / vDSO / head64 Andi Kleen
2017-11-27 21:34 ` [PATCH 20/21] Kbuild, lto: Add Link Time Optimization support Andi Kleen
2018-01-27  0:15   ` Arnd Bergmann [this message]
2018-01-27  0:55     ` Andi Kleen
2018-01-27 14:26       ` Arnd Bergmann
2018-01-28 18:33         ` Andi Kleen
2017-11-27 21:34 ` [PATCH 21/21] x86: Enable Link Time Optimization Andi Kleen
2017-11-28 16:04 ` [PATCH 02/21] afs: Fix const confusion in AFS David Howells
2017-11-28 16:50   ` Andi Kleen
2017-11-29 23:09 ` Link time optimization for LTO/x86 Sami Tolvanen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK8P3a3RQhiEkh6uUjdX-juXggNdZxvxRPJbE6M3e6Dy-ycGxw@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=ak@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=alxmtvv@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samitolvanen@google.com \
    --cc=x86@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).