[SLL] Cisco VPN Client on x86_64

Derek Simkowiak dereks at realloc.net
Fri Aug 8 11:08:54 PDT 2008


When it says "Fix it to use EXTRA_CFLAGS" what exactly is "it"?  The Makefile?

   Yes, it's talking about the file 
"/home/bradw/Desktop/vpnclient/Makefile".

    The variables "CFLAGS" and "EXTRA_CFLAGS" are frequently found in 
Makefiles.  They hold command-line options that are passed to the C 
compiler, gcc. 

    In this case, you can see that "make" was run with the file 
"/usr/src/kernels/2.6.25.11-97.fc9.x86_64/scripts/Makefile.build", which 
is part of the Linux kernel tree.  That Makefile sets some build 
environment settings for building kernel modules, like module versions, 
etc. 

    Part of what scripts/Makefile.build does is this:

 35 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L35> # For backward compatibility check that these variables do not change
 36 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L36> save-cflags := $(CFLAGS)
 37 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L37> 
 38 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L38> # The filename Kbuild has precedence over Makefile
 39 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L39> kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
 40 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L40> kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)
 41 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L41> include $(kbuild-file)
 42 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L42> 
 43 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L43> # If the save-* variables changed error out
 44 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L44> ifeq ($(KBUILD_NOPEDANTIC),)
 45 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L45>         ifneq ("$(save-cflags)","$(CFLAGS)")
 46 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L46>                 $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
 47 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L47>         endif
 48 <http://fxr.watson.org/fxr/source/scripts/Makefile.build?v=linux-2.6#L48> endif


    It saves the CFLAGS into "save-cflags", then imports the kernel 
build settings from $(kbuild-dir)/Kbuild or $(kbuild-dir)/Makefile, and 
then checks to make sure that "save-cflags" and "CFLAGS" are still the 
same.  In short, it makes sure the kernel build settings don't overwrite 
your project's default CFLAGS settings.

    In your case, the kernel build settings in $(kbuild-dir)/Kbuild or 
$(kbuild-dir)/Makefile are overwriting the value of CFLAGS in the 
vpnclient Makefile.  This means the vpnclient's CFLAGS variables have 
extra stuff in them that a kernel build process is not expecting.  To 
prevent compile-time problems with the kernel tree, the author of 
scripts/Makefile.build decided that it would be easiest to have you 
change your Makefile to use a different variable (EXTRA_CFLAGS).  So it 
gives you that "Fix it" error message.

    To appease the almighty Makefile.build file, try something like this:

cd /home/bradw/Desktop/vpnclient/
cp -af Makefile Makefile-dist     # make a backup first
replace "CFLAGS" "EXTRA_CFLAGS" -- Makefile


--Derek

Brad Willson wrote:
> While attempting to compile vpnclient-linux-x86_64-4.8.02.0030-k9 on my
> 2.6.25.11-97.fc9.x86_64 kernel, I receive the following errors...
>
> [root at bwil150nhp vpnclient]# make
> make -C /lib/modules/2.6.25.11-97.fc9.x86_64/build
> SUBDIRS=/home/bradw/Desktop/vpnclient modules
> make[1]: Entering directory `/usr/src/kernels/2.6.25.11-97.fc9.x86_64'
> scripts/Makefile.build:46: *** CFLAGS was changed in
> "/home/bradw/Desktop/vpnclient/Makefile". Fix it to use EXTRA_CFLAGS.  Stop.
> make[1]: *** [_module_/home/bradw/Desktop/vpnclient] Error 2
> make[1]: Leaving directory `/usr/src/kernels/2.6.25.11-97.fc9.x86_64'
> make: *** [default] Error 2
>
> When it says "Fix it to use EXTRA_CFLAGS" what exactly is "it"?  The
> Makefile? /usr/src/kernels/2.6.25.11-97.fc9.x86_64/scripts/Makefile.build?
> or something else?
>
> Oddly enough, with a package name like x86_64, I would presume that it was
> meant for the 64bit kernel, but it compiled and installed without errors on
> my old P4.
>
> Thoughts? Ideas? Verbose solutions?
>
> Thanks in advance!
>
> Brad
>   



More information about the linux-list mailing list