Re: [OS-BUILD PATCH] redhat/kernel.spec.template: Fix intel-speed-select compile

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prarit Bhargava <prarit@xxxxxxxxxx> writes:
>> So this papers over the real problem. I looked at the Makefile and wonder why
>> CFLAGS wasn't being passed over even with "override" being used to append the
>> flags. Seems the real problem is that the updated CFLAGS aren't being passed
>> to the submake used to build the tool. I did this here and it seems to have
>> fixed the problem:

There's a HUGE difference between "CFLAGS=x make" and "make CFLAGS=x",
or setting CFLAGS inside a Makefile.  That make treats environment
variables as makefile variables doesn't mean they're equal.

Make variables are NOT passed to child processes if they originate in
the Makefile, but environment variables are, and sometimes make
variables start off as environment variables, which can make it seem
otherwise:

    When 'make' runs a recipe, variables defined in the makefile are
  placed into the environment of each shell.  This allows you to pass
  values to sub-'make' invocations (*note Recursive Use of 'make':
  Recursion.).  By default, only variables that came from the
  environment or the command line are passed to recursive invocations.
  You can use the 'export' directive to pass other variables.  *Note
  Communicating Variables to a Sub-'make': Variables/Recursion, for full
  details.

I will add that, noted during testing, using the "FLAG+=something" form
on the command line does NOT trigger the "from the command line" rule if
the FLAG otherwise didn't trigger it itself.  This might be the specific
case here.

So I don't think this is papering over the real problem, I think this is
the right solution (or use export), for when you don't collect such
variables in a .included file.

>> ```
>> $ git diff
>> diff --git a/tools/power/x86/intel-speed-select/Makefile
>> b/tools/power/x86/intel-speed-select/Makefile
>> index d2fba1297d96..0858aba12d21 100644
>> --- a/tools/power/x86/intel-speed-select/Makefile
>> +++ b/tools/power/x86/intel-speed-select/Makefile
>> @@ -40,7 +40,7 @@ prepare: $(OUTPUT)include/linux/isst_if.h
>> $(OUTPUT)include/linux/thermal.h
>>   ISST_IN := $(OUTPUT)intel-speed-select-in.o
>> 
>>   $(ISST_IN): prepare FORCE
>> -       $(Q)$(MAKE) $(build)=intel-speed-select
>> +       $(Q)$(MAKE) CFLAGS="$(CFLAGS)" $(build)=intel-speed-select

You could throw an "env" in there somewhere to see what ended up in the
environment (and thus passed down by default) and what didn't.
_______________________________________________
kernel mailing list -- kernel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to kernel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/kernel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora General Discussion]     [Older Fedora Users Archive]     [Fedora Advisory Board]     [Fedora Security]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Mentors]     [Fedora Package Announce]     [Fedora Package Review]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Coolkey]     [Yum Users]     [Tux]     [Yosemite News]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [USB]     [Asterisk PBX]

  Powered by Linux