Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] help please
Date: Wed, 13 Jul 2016 20:21:35 +0200	[thread overview]
Message-ID: <20160713182135.GA3687@free.fr> (raw)
In-Reply-To: <CAAfO8NykMv=DCdn=rV6tCFOfRvZQf84V82ZrKgtJW-422F9nfQ@mail.gmail.com>

Mike, All,

On 2016-07-12 17:05 -0400, Mike King spake thusly:
> I have attached the build log.  I am now having compile errors.
> Before it was using the host kernel headers.  I "fixed" that by adding
> _CONF_OPTS line.

OK, so I've had a quick look at your build log, and it looks like
linux-gpib is quite a mess and will be difficult to package properly.

So, first, let's look at the configure log:

    Checking Linux kernel directory... ok
    checking Linux kernel compile flags... FATAL: /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/util/linux_flags/fake.o has no symtab?
    make[3]: *** [__modpost] Error 1
    make[2]: *** [modules] Error 2
    configure: WARNING: Failed to get compile flags from Linux kernel directory.
    ok
    checking for arm-buildroot-linux-uclibcgnueabihf-gcc... /home/vagrant/buildroot-2016.05/output/host/usr/bin/arm-buildroot-linux-uclibcgnueabihf-gcc

This sounds like it is incorrectly looking for Linux directory for the
build system and/or kernel-land headers. Besides, it did not already
checked for the cross-compiler, as we can see that it does so *after*,
so it is probably using the host compiler at that point (and this will
be confirmed later during the build, see below...).

That one will be very difficult to fix, especially since their
configure.ac is very badly written:

   90 dnl get compile flags for modules from linux kernel source tree
   91 AC_MSG_CHECKING([Linux kernel compile flags])
   92 FLAGDIR=$(pwd)/util/linux_flags
   93 env LDFLAGS="" CFLAGS="" make --quiet -C ${LINUX_SRCDIR} V=1 SUBDIRS=${FLAGDIR} LINUXDIR=${LINUX_SRCDIR} modules > /dev/null
   94 if [[ $? != 0 ]]; then
   95     AC_MSG_WARN([Failed to get compile flags from Linux kernel directory.])
   96 fi
   97 AC_MSG_RESULT([ok])

Since it is not using standard and not passing the compiler, we can't
override it will configure flags or any ac_cv_* variable. :-(

That will be tough to fix. Unless this is not really needed in fact, and
we can in fact pass the expected values in the environment or some such
afterwards. And it seems we could do that, as the intermediate file
generated in this command (util/linux_flags/flags) is only used later to
actually build the driver. So we don;t need it at configure time, and
the check can very well fail, we don;t care (but it is nonetheless
completely borked).

And then, it means we can also probably use our kernel-module infra as
well to build the kernel module instead of letting their weirdly borked
buildsystem do it.

Then not much of interest, until it starts trying to build the kernel
module. And there, everything goes down hill pretty quick (lines slightly
reformatted by me):

    /usr/bin/make -C /home/vagrant/buildroot-2016.05/output/build/linux-26f3b72a9c049be10e6af196252283e1f6ab9d1f/ V=1 modules\
        CC="gcc -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3 
                -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/include
                -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/include" \
        CONFIG_GPIB_ISA="no" \
        SUBDIRS="/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib"

Bing, it uses the host compiler! That's just so utterly broken... :-/

And then (again, reformatted and elided by me):

    gcc -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3
        -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/include
        -I/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/include
        -Wp,-MD,/home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/.ni_usb_gpib.o.d
        [--SNIP--]
        -DMODULE  -D"KBUILD_STR(s)=#s"
        -D"KBUILD_BASENAME=KBUILD_STR(ni_usb_gpib)"
        -D"KBUILD_MODNAME=KBUILD_STR(ni_usb_gpib)" -c -o
        /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/.tmp_ni_usb_gpib.o
        /home/vagrant/buildroot-2016.05/output/build/linux-gpib-4.0.3/drivers/gpib/ni_usb/ni_usb_gpib.c

So, really, it *is* using the host compiler, and there is no way, with
their infrastructure, to tell them to use another one. Definitely broken
beyond repair...

So, all we have to do is:
  - convince it not to try to build the kernel module,
  - build it ourselves with our kernel-module infra.

I'll try to have a deeper look latter... Dinner now. :-)

If you hang around on IRC tonight UTC+2, we can talk about it, too.

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  parent reply	other threads:[~2016-07-13 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 19:06 [Buildroot] help please Mike King
2016-07-12 20:44 ` Yann E. MORIN
     [not found]   ` <CAAfO8NykMv=DCdn=rV6tCFOfRvZQf84V82ZrKgtJW-422F9nfQ@mail.gmail.com>
2016-07-13 18:21     ` Yann E. MORIN [this message]
     [not found]       ` <CAAfO8NwwwFGA-gCeFnOYs0HAbDAAnKs6nHnWusA-LzWpTWQ8ag@mail.gmail.com>
2016-07-14 18:07         ` Yann E. MORIN
2016-07-15  1:26           ` Mike King

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=20160713182135.GA3687@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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