gcc4.6,how to remove werror

tknv rreedd555 at gmail.com
Thu Dec 1 08:31:38 UTC 2011


I could not find that WERROR override code at my kernels...

Sorry delay it, I did make V=1.
There are three kinds test.
All targets are ARM.
All Makefiles(top of kernel tree)-KBUILD_CFLAGS are same.
KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common \
                   -Wno-format-security \
                   -fno-delete-null-pointer-checks

I think linaro Werror behaviour is different or I need to add FLAGS more.

Compile CM-kernel with android SDK
make -f scripts/Makefile.build obj=drivers/net/wireless/bcm4329
     rm -f drivers/net/wireless/bcm4329/built-in.o;
     /home/tknv/android/Oxygen/prebuil
     t/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-ar rcs
     drivers/net/wireless/bcm43  29/built-in.o
         /home/tknv/android/Oxygen/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eab
	 i-gcc -Wp,-MD,drivers/net/wireless/bcm4329/.dhd_linux.o.d
	 -nostdinc -isystem /home
	 /tknv/android/Oxygen/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm
	 -eabi/4.4.3/include
	 -I/home/tknv/android/SuperSonic/kernels/CM-kernel/arch/arm/incl
	 ude -Iinclude  -include include/generated/autoconf.h
	 -D__KERNEL__ -mlittle-endian -  Iarch/arm/mach-msm/include
	 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-st
	 rict-aliasing -fno-common -Wno-format-security
	 -fno-delete-null-pointer-checks -Os   -marm -mabi=aapcs-linux
	 -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7
	 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024
	 -fno-stack-protector -f  omit-frame-pointer
	 -Wdeclaration-after-statement -Wno-pointer-sign
	 -fno-strict-over  flow -fno-dwarf2-cfi-asm -fconserve-stack
	 -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHD  THREAD -DBCMWPA2
	 -DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64
	 -DDHD_  FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE
	 -DDHD_BCMEVENTS -DSHOW_EVENTS -DBCMS  DIO -DDHD_GPL
	 -DBCMLXSDMMC -DBCMPLATFORM_BUS -Wall -Wstrict-prototypes
	 -Werror -DOO  B_INTR_ONLY -DCUSTOMER_HW2 -DDHD_USE_STATIC_BUF
	 -DMMC_SDIO_ABORT -DDHD_DEBUG_TRAP -  DSOFTAP
	 -DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT
	 -DGET_CUSTOM  _MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP -DHW_OOB
	 -Idrivers/net/wireless/bcm4329 -Idrive
	 rs/net/wireless/bcm4329/include  -DMODULE -D"KBUILD_STR(s)=#s"
	 -D"KBUILD_BASENAME=K  BUILD_STR(dhd_linux)"
	 -D"KBUILD_MODNAME=KBUILD_STR(bcm4329)"  -c -o drivers/net/wi
	 reless/bcm4329/dhd_linux.o
	 drivers/net/wireless/bcm4329/dhd_linux.
	 ...
[1]+  Done                    make V=1 > build.log 2>&1

Compile CM-kernel with linaro.
make -f scripts/Makefile.build obj=drivers/net/wireless/bcm4329
   rm -f drivers/net/wireless/bcm4329/built-in.o;
   /usr/bin/arm-linux-gnueabi-ar rcs
   drivers/net/wireless/bcm4329/built-in.o
     /usr/bin/arm-linux-gnueabi-gcc
     -Wp,-MD,drivers/net/wireless/bcm4329/.dhd_linux.o.d  -nostdinc
     -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6.1/include
     -I/home/tknv/android/SuperSonic/kernels/CM-kernel/arch/arm/include
     -Iinclude  -include include/generated/autoconf.h -D__KERNEL__
     -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef
     -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
     -Wno-format-security -fno-delete-null-pointer-checks -Os -marm
     -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables
     -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm
     -Wframe-larger-than=1024 -fno-stack-protector -fomit-frame-pointer
     -Wdeclaration-after-statement -Wno-pointer-sign
     -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -DLINUX
     -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD -DBCMWPA2 -DUNRELEASEDCHIP
     -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64 -DDHD_FIRSTREAD=64
     -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS -DSHOW_EVENTS
     -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS -Wall
     -Wstrict-prototypes -Werror -DOOB_INTR_ONLY -DCUSTOMER_HW2
     -DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DDHD_DEBUG_TRAP -DSOFTAP
     -DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT
     -DGET_CUSTOM_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP -DHW_OOB
     -Idrivers/net/wireless/bcm4329
     -Idrivers/net/wireless/bcm4329/include  -DMODULE
     -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(dhd_linux)"
     -D"KBUILD_MODNAME=KBUILD_STR(bcm4329)"  -c -o
     drivers/net/wireless/bcm4329/dhd_linux.o
     drivers/net/wireless/bcm4329/dhd_linux.c
     drivers/net/wireless/bcm4329/dhd_linux.c: In function ‘
     dhd_rx_frame’:
     drivers/net/wireless/bcm4329/dhd_linux.c:1282:24: error: variable
     ‘save_pktbuf’ set but not used [-Werror=unused-but-set-variable]
     drivers/net/wireless/bcm4329/dhd_linux.c: In function ‘
     dhd_os_wd_timer’:
     drivers/net/wireless/bcm4329/dhd_linux.c:2737:14: error: variable
     ‘save_dhd_watchdog_ms’ set but not used
     [-Werror=unused-but-set-variable]
     cc1: all warnings being treated as errors

     make[4]: *** [drivers/net/wireless/bcm4329/dhd_linux.o] Error 1
     make[3]: *** [drivers/net/wireless/bcm4329] Error 2
     make[2]: *** [drivers/net/wireless] Error 2
     make[1]: *** [drivers/net] Error 2
     make: *** [drivers] Error 2
     ^C[1]+  Exit 2                  make V=1 > build.log 2>&1

Compile tiamatat-kernel with linaro.
make -f scripts/Makefile.build obj=drivers/net/wireless/bcm4329
  /usr/bin/arm-linux-gnueabi-gcc
  -Wp,-MD,drivers/net/wireless/bcm4329/.dhd_linux.o.d  -nostdinc
  -isystem /usr/lib/gcc/arm-linux-gnueabi/4.6.1/include
  -I/home/tknv/android/SuperSonic/kernels/tiamat-kernel/arch/arm/include
  -Iinclude  -include include/generated/autoconf.h -D__KERNEL__
  -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef
  -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common
  -Wno-format-security -fno-delete-null-pointer-checks -Os -marm
  -fno-dwarf2-cfi-asm -fno-omit-frame-pointer -mapcs -mno-sched-prolog
  -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7
  -march=armv7-a -mhard-float -Uarm -Wframe-larger-than=1024
  -fno-stack-protector -fno-omit-frame-pointer
  -fno-optimize-sibling-calls -Wdeclaration-after-statement
  -Wno-pointer-sign -fno-strict-overflow -fconserve-stack
  -DCC_HAVE_ASM_GOTO -DLINUX -DBCMDRIVER -DBCMDONGLEHOST -DDHDTHREAD
  -DBCMWPA2 -DUNRELEASEDCHIP -Dlinux -DDHD_SDALIGN=64 -DMAX_HDR_READ=64
  -DDHD_FIRSTREAD=64 -DDHD_GPL -DDHD_SCHED -DBDC -DTOE -DDHD_BCMEVENTS
  -DSHOW_EVENTS -DBCMSDIO -DDHD_GPL -DBCMLXSDMMC -DBCMPLATFORM_BUS -Wall
  -Wstrict-prototypes -Werror -DOOB_INTR_ONLY -DCUSTOMER_HW2
  -DDHD_USE_STATIC_BUF -DMMC_SDIO_ABORT -DDHD_DEBUG_TRAP -DSOFTAP
  -DEMBEDDED_PLATFORM -DARP_OFFLOAD_SUPPORT -DPKT_FILTER_SUPPORT
  -DGET_CUSTOM_MAC_ENABLE -DSET_RANDOM_MAC_SOFTAP -DCSCAN -DHW_OOB
  -DKEEP_ALIVE -DPNO_SUPPORT -Idrivers/net/wireless/bcm4329
  -Idrivers/net/wireless/bcm4329/include  -DMODULE -DMODULE
  -march=armv7-a -mfpu=vfpv3 -ftree-vectorize -D"KBUILD_STR(s)=#s"
  -D"KBUILD_BASENAME=KBUILD_STR(dhd_linux)"
  -D"KBUILD_MODNAME=KBUILD_STR(bcm4329)" -c -o
  drivers/net/wireless/bcm4329/dhd_linux.o
  drivers/net/wireless/bcm4329/dhd_linux.c
  drivers/net/wireless/bcm4329/dhd_linux.c: In function ‘dhd_rx_frame’
  :
  drivers/net/wireless/bcm4329/dhd_linux.c:1256:24: error: variable ‘
  save_pktbuf’ set but not used [-Werror=unused-but-set-variable]
  cc1: all warnings being treated as errors

  make[4]: *** [drivers/net/wireless/bcm4329/dhd_linux.o] Error 1
  make[3]: *** [drivers/net/wireless/bcm4329] Error 2
  make[2]: *** [drivers/net/wireless] Error 2
  make[1]: *** [drivers/net] Error 2
  make: *** [drivers] Error 2
  ^C[1]+  Exit 2                  make V=1 > build.log 2>&1

On Wed, Nov 30, 2011 at 04:13:18PM +0000, Dave Martin wrote:
> On Tue, Nov 29, 2011 at 09:43:01PM +0700, tknv wrote:
> > This issue happend,when I was compiling ARM kernel.
> > I could not get it where -Werror gets overriden in tools/perf.
> > Could you tell me where is it ?
> 
> In tools/perf/Makefile:
> 
> 34:# Define WERROR=0 to disable treating any warnings as errors.
> 69:ifneq ($(WERROR),0)
> 70:     CFLAGS_WERROR := -Werror
> 105:CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
> 
> This Makefile _only_ applies to the perf tools.  The rest of the kernel
> uses other Makefiles.
> 
> The perf tools are not built automatically, so if you are only trying to
> build a kernel image then you must have some other problem.
> 
> 
> As I suggested previously, can you please run
> 
> make V=1
> 
> and send the last few lines of output, including the error message *and*
> the command which caused it.
> 
> Without a precise indication of where the error occurs, I can't offer much
> help.
> 
> Cheers
> ---Dave
> 
> 
> 
> _______________________________________________
> linaro-toolchain mailing list
> linaro-toolchain at lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/linaro-toolchain

-- 
w.tknv/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.linaro.org/pipermail/linaro-toolchain/attachments/20111201/56c0cc64/attachment.pgp>


More information about the linaro-toolchain mailing list