Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503008 > unrolled thread

Difficulties around "fixdep" for the usage of a kernel build output directory

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2016-10-18 16:00 +0200
Last post2016-10-20 08:40 +0200
Articles 11 — 3 participants

Back to article view | Back to linux.kernel


Contents

  Difficulties around "fixdep" for the usage of a kernel build output  directory SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-18 16:00 +0200
    Re: Difficulties around "fixdep" for the usage of a kernel build  output directory Jim Davis <jim.epost@gmail.com> - 2016-10-18 17:20 +0200
      Re: Difficulties around "fixdep" for the usage of a kernel build  output directory SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-18 18:40 +0200
        Re: Difficulties around "fixdep" for the usage of a kernel build  output directory Jim Davis <jim.epost@gmail.com> - 2016-10-18 19:00 +0200
          Re: Difficulties around "fixdep" for the usage of a kernel build  output directory SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-18 19:30 +0200
            Re: Difficulties around "fixdep" for the usage of a kernel build  output directory Jim Davis <jim.epost@gmail.com> - 2016-10-18 22:50 +0200
              Re: Challenges around the usage of different "HOSTCFLAGS" for kernel  build configuration and module generation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-19 19:10 +0200
                Re: Challenges around the usage of different "HOSTCFLAGS" for kernel  build configuration and module generation Jim Davis <jim.epost@gmail.com> - 2016-10-19 22:00 +0200
                  Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation Segher Boessenkool <segher@kernel.crashing.org> - 2016-10-20 00:10 +0200
                    Re: Challenges around the usage of different "HOSTCFLAGS" for kernel  build configuration and module generation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-20 09:40 +0200
                  Re: Challenges around the usage of different "HOSTCFLAGS" for kernel  build configuration and module generation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-10-20 08:40 +0200

#1503008 — Difficulties around "fixdep" for the usage of a kernel build output directory

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-18 16:00 +0200
SubjectDifficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stD5U-2pf-25@gated-at.bofh.it>
Hello,

The file "README" contains a section "BUILD directory for the kernel".
I would like to use the functionality which is described there.

One of my commands for such a build try is working as desired.


elfring@Sonne:~/Projekte/Linux/next-patched> git checkout next-20161014 && my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && make O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="${my_parameters}" allmodconfig; done
…
#
# configuration written to .config
#


I stumble on the following messages for another build command.


elfring@Sonne:~/Projekte/Linux/next-patched> my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && LANG=C make V=2 O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="-S ${my_parameters}" drivers/md/; done
make[1]: Entering directory …
  HOSTCC  scripts/basic/fixdep - due to command line change
scripts/basic/fixdep: line 1: .file: command not found
scripts/basic/fixdep: line 2: .comm: command not found
…
scripts/basic/fixdep: line 6: .section: command not found
scripts/basic/fixdep: line 7: .align: command not found
scripts/basic/fixdep: line 8: .LC0:: command not found
scripts/basic/fixdep: line 9: .string: command not found
…


I wonder why this approach does not work so far.
I would appreciate your advices.

Regards,
Markus

[toc] | [next] | [standalone]


#1503091 — Re: Difficulties around "fixdep" for the usage of a kernel build output directory

FromJim Davis <jim.epost@gmail.com>
Date2016-10-18 17:20 +0200
SubjectRe: Difficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stElj-3tp-9@gated-at.bofh.it>
In reply to#1503008
On Tue, Oct 18, 2016 at 6:54 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
> Hello,
>
> The file "README" contains a section "BUILD directory for the kernel".
> I would like to use the functionality which is described there.
>
> One of my commands for such a build try is working as desired.
>
>
> elfring@Sonne:~/Projekte/Linux/next-patched> git checkout next-20161014 && my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && make O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="${my_parameters}" allmodconfig; done
> …
> #
> # configuration written to .config
> #
>
>
> I stumble on the following messages for another build command.
>
>
> elfring@Sonne:~/Projekte/Linux/next-patched> my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && LANG=C make V=2 O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="-S ${my_parameters}" drivers/md/; done
> make[1]: Entering directory …
>   HOSTCC  scripts/basic/fixdep - due to command line change
> scripts/basic/fixdep: line 1: .file: command not found
> scripts/basic/fixdep: line 2: .comm: command not found
> …
> scripts/basic/fixdep: line 6: .section: command not found
> scripts/basic/fixdep: line 7: .align: command not found
> scripts/basic/fixdep: line 8: .LC0:: command not found
> scripts/basic/fixdep: line 9: .string: command not found
> …
>
>
> I wonder why this approach does not work so far.
> I would appreciate your advices.

That's a very complicated command line.  Does something basic, like

make O=/tmp/$$ allmodconfig
make O=/tmp/$$

work for you?

-- 
Jim

[toc] | [prev] | [next] | [standalone]


#1503209 — Re: Difficulties around "fixdep" for the usage of a kernel build output directory

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-18 18:40 +0200
SubjectRe: Difficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stFAJ-4gM-13@gated-at.bofh.it>
In reply to#1503091
>> elfring@Sonne:~/Projekte/Linux/next-patched> my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && LANG=C make V=2 O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="-S ${my_parameters}" drivers/md/; done
…
> That's a very complicated command line.

I find it "advanced".

It shows a few of my imaginations around a specific software development task.


> Does something basic, like
> 
> make O=/tmp/$$ allmodconfig
> make O=/tmp/$$
> 
> work for you?

Not really. - I would like to achieve the automatic selection of a few
compilation settings by a for loop which I reduced in the shown example
to one element.

I am looking for a "convenient" way to get assembler source files from
the preferrred C compiler for some software build configurations.
I hope that I can avoid the switching of compilation results in the source
file directory hierarchy so that an occasional disassembly by a tool
like "objdump" could be compared.

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1503228 — Re: Difficulties around "fixdep" for the usage of a kernel build output directory

FromJim Davis <jim.epost@gmail.com>
Date2016-10-18 19:00 +0200
SubjectRe: Difficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stFU6-4q4-23@gated-at.bofh.it>
In reply to#1503209
On Tue, Oct 18, 2016 at 9:38 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>>> elfring@Sonne:~/Projekte/Linux/next-patched> my_off=-O0 && for X in off; do my_output_dir=${my_build_dir}unchanged/optimisation/${X} && my_var="my_${X}" && my_parameters="-Wall -std=gnu89 -fomit-frame-pointer ${!my_var}" && LANG=C make V=2 O="${my_output_dir}" HOSTCC='/usr/bin/gcc-6' HOSTCFLAGS="-S ${my_parameters}" drivers/md/; done
> …
>> That's a very complicated command line.
>
> I find it "advanced".
>
> It shows a few of my imaginations around a specific software development task.
>
>
>> Does something basic, like
>>
>> make O=/tmp/$$ allmodconfig
>> make O=/tmp/$$
>>
>> work for you?
>
> Not really. - I would like to achieve the automatic selection of a few
> compilation settings by a for loop which I reduced in the shown example
> to one element.

Fine, but my point was to check that the basic things worked before
trying the complicated, or "advanced" stuff.  If, somehow, fixdep
didn't work in a basic setup then you'd know it wasn't one of your
advanced features that was causing the problem.

And if fixdep did work with a basic setup , then that would suggest
something wrong with your advanced command line.
-- 
Jim

[toc] | [prev] | [next] | [standalone]


#1503249 — Re: Difficulties around "fixdep" for the usage of a kernel build output directory

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-18 19:30 +0200
SubjectRe: Difficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stGn8-4Sx-37@gated-at.bofh.it>
In reply to#1503228
> Fine, but my point was to check that the basic things worked before
> trying the complicated, or "advanced" stuff.

Your suggestion is fine in this sense. I can observe that the following command variant
works as expected here.

my_build_dir=/tmp/fixdep-check-20161018-1 && mkdir "${my_build_dir}" && my_cc=/usr/bin/gcc-6 && make O="${my_build_dir}" HOSTCC="${my_cc}" allmodconfig && make -j6 O="${my_build_dir}" HOSTCC="${my_cc}" drivers/md/


> If, somehow, fixdep didn't work in a basic setup then you'd know it wasn't one of your
> advanced features that was causing the problem.

The command example above is an approximation for the configuration approach
which I would really want instead.


> And if fixdep did work with a basic setup , then that would suggest
> something wrong with your advanced command line.

How do you think about to clarify further which implementation detail could trigger
the shown software build difficulty?

Can it be that the passing of the adjusted parameter "HOSTCFLAGS" has got a significant
influence (with unwanted side effects) in this use case?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1503341 — Re: Difficulties around "fixdep" for the usage of a kernel build output directory

FromJim Davis <jim.epost@gmail.com>
Date2016-10-18 22:50 +0200
SubjectRe: Difficulties around "fixdep" for the usage of a kernel build output directory
Message-ID<stJuF-759-25@gated-at.bofh.it>
In reply to#1503249
On Tue, Oct 18, 2016 at 10:25 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:

> Can it be that the passing of the adjusted parameter "HOSTCFLAGS" has got a significant
> influence (with unwanted side effects) in this use case?

That's probably it.  If I strip down your advanced original example to just

make defconfig
make HOSTCFLAGS=-S

then I get a similar error:

  HOSTCC  scripts/basic/fixdep
scripts/basic/fixdep: 1: scripts/basic/fixdep: .file: not found
scripts/basic/fixdep: 2: scripts/basic/fixdep: .comm: not found
scripts/basic/fixdep: 3: scripts/basic/fixdep: .comm: not found
scripts/basic/fixdep: 4: scripts/basic/fixdep: .comm: not found
scripts/basic/fixdep: 5: scripts/basic/fixdep: .comm: not found
scripts/basic/fixdep: 6: scripts/basic/fixdep: .section: not found

and so forth.  The problem is that, with -S, fixdep isn't build as an
executable:

jim@krebstar:~/linux-next/scripts/basic$ file fixdep
fixdep: assembler source, ASCII text
jim@krebstar:~/linux-next/scripts/basic$ more fixdep
    .file    "fixdep.c"
    .comm    insert_extra_deps,4,4
    .comm    target,8,8
    .comm    depfile,8,8
    .comm    cmdline,8,8
    .section    .rodata

I'm guessing that in your original example you wanted to look at the
assembly output gcc produced; you'd probably have better luck using
objdump for that.

-- 
Jim

[toc] | [prev] | [next] | [standalone]


#1504150 — Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-19 19:10 +0200
SubjectRe: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation
Message-ID<su2xk-4eW-27@gated-at.bofh.it>
In reply to#1503341
>> Can it be that the passing of the adjusted parameter "HOSTCFLAGS" has got a significant
>> influence (with unwanted side effects) in this use case?
> 
> That's probably it.  If I strip down your advanced original example to just
> 
> make defconfig
> make HOSTCFLAGS=-S
> 
> then I get a similar error:
> 
>   HOSTCC  scripts/basic/fixdep
> scripts/basic/fixdep: 1: scripts/basic/fixdep: .file: not found
…
> and so forth.

Thanks that you could reproduce my observation also with a simple example
on your test system.


> The problem is that, with -S, fixdep isn't build as an executable:
> 
> jim@krebstar:~/linux-next/scripts/basic$ file fixdep
> fixdep: assembler source, ASCII text

Are you interested that a software generation parameter like "-S"
(for output of assembler source files) could be directly supported
for a special build variant?

* Does this issue indicate further development challenges?

* How are the chances that the involved software dependencies can be
  handled better in more detail?


> I'm guessing that in your original example you wanted to look at the
> assembly output gcc produced;

Yes. - I became interested in this use case once more.


> you'd probably have better luck using objdump for that.

This approach can occasionally work to some degree. I am looking for
a better (or more convenient) solution.

I got the impression that I need to put special build parameters into
the make files directly so far while I would prefer to pass extra settings
as command line arguments for the tool "make".

Will it make sense to distinguish such parameters for development phases
(or stages) like "kernel build configuration" and corresponding
"module generation" any more?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1504300 — Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation

FromJim Davis <jim.epost@gmail.com>
Date2016-10-19 22:00 +0200
SubjectRe: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation
Message-ID<su5bP-5KC-5@gated-at.bofh.it>
In reply to#1504150
On Wed, Oct 19, 2016 at 12:25 AM, SF Markus Elfring
<elfring@users.sourceforge.net> wrote:
>
> Are you interested that a software generation parameter like "-S"
> (for output of assembler source files) could be directly supported
> for a special build variant?

No, if you want to see the assembly code then something like

make defconfig; make EXTRA_CFLAGS="-g" drivers/md/; objdump -S
drivers/md/whatever.o

seems easy enough.  You could write a little shell wrapper to save
some keystrokes if you find you're running those commands frequently.

-- 
Jim

[toc] | [prev] | [next] | [standalone]


#1504359 — Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation

FromSegher Boessenkool <segher@kernel.crashing.org>
Date2016-10-20 00:10 +0200
SubjectRe: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation
Message-ID<su7dE-7iT-5@gated-at.bofh.it>
In reply to#1504300
On Wed, Oct 19, 2016 at 12:51:44PM -0700, Jim Davis wrote:
> On Wed, Oct 19, 2016 at 12:25 AM, SF Markus Elfring
> <elfring@users.sourceforge.net> wrote:
> >
> > Are you interested that a software generation parameter like "-S"
> > (for output of assembler source files) could be directly supported
> > for a special build variant?
> 
> No, if you want to see the assembly code then something like
> 
> make defconfig; make EXTRA_CFLAGS="-g" drivers/md/; objdump -S
> drivers/md/whatever.o
> 
> seems easy enough.  You could write a little shell wrapper to save
> some keystrokes if you find you're running those commands frequently.

Don't forget -r when running objdump on an object file.  But, you
want to use  make drivers/md/whatever.s  if you want to see the
assembler code.

And that doesn't work for build-time tools, which I think is what
the original discussion was about.


Segher

[toc] | [prev] | [next] | [standalone]


#1504587 — Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-20 09:40 +0200
SubjectRe: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation
Message-ID<sug7g-4u4-31@gated-at.bofh.it>
In reply to#1504359
> Don't forget -r when running objdump on an object file.

Thanks for your reminder.


> But, you want to use  make drivers/md/whatever.s  if you want to see
> the assembler code.

Thanks for your advice!

This is one kind of "generation convenience" I was looking for.

Was my software development attention too limited for another moment
so that I did not directly pick an opportunity up from the description
like "dir/file.[ois]  - Build specified target only"
(by the command "make help") that I can get assembler source files
for Linux modules so easy on demand?

Would you like to point any places out in the make scripts which
show relevant commands for such build targets?


> And that doesn't work for build-time tools,

I got the impression that they can trigger further software development challenges.
Should their source files (and corresponding make parameters) be improved anyhow?


> which I think is what the original discussion was about.

I see a few change possibilities there. Will it be useful to reconsider
the generation parameters for build-time tools in comparison to components
from other Linux software areas?

Will a variable like "EXTRA_CFLAGS" achieve a desired effect at more places?

Regards,
Markus

[toc] | [prev] | [next] | [standalone]


#1504540 — Re: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2016-10-20 08:40 +0200
SubjectRe: Challenges around the usage of different "HOSTCFLAGS" for kernel build configuration and module generation
Message-ID<sufbb-3SB-5@gated-at.bofh.it>
In reply to#1504300
> make defconfig; make EXTRA_CFLAGS="-g" drivers/md/; objdump -S drivers/md/whatever.o

Such a command looks promising.

* I find it safer when double ampersand will be used as control operator
  instead of semicolon there.

* I get the impression from an other command like "find . -name '?akefile' -exec ack --with-filename EXTRA_CFLAGS '{}' \;"
  that the suggested parameter "EXTRA_CFLAGS" will not achieve an effect
  at places where I am interested in at the moment.


It seems that further fine-tuning can become interesting and challenging
for involved make variables.

Regards,
Markus

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web