# [SOLVED] make kernel-3.4.9 failed

## ant1688

my gentoo x86-64 has been upgraded for years, this the fist time failed in making  kernel-3.4.9:

```
localhost linux # make && make modules_install

make[1]: Nothing to be done for `all'.

make[1]: Nothing to be done for `relocs'.

  CHK     include/linux/version.h

  CHK     include/generated/utsrelease.h

  CALL    scripts/checksyscalls.sh

  CHK     include/generated/compile.h

  CHK     kernel/config_data.h

  CC [M]  drivers/scsi/lpfc/lpfc_scsi.o

cc1: warnings being treated as errors

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_bpl’:

drivers/scsi/lpfc/lpfc_scsi.c:1900:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_bpl_prot’:

drivers/scsi/lpfc/lpfc_scsi.c:2037:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_sgl’:

drivers/scsi/lpfc/lpfc_scsi.c:2256:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_sgl_prot’:

drivers/scsi/lpfc/lpfc_scsi.c:2386:11: error: unused variable ‘rc’

make[3]: *** [drivers/scsi/lpfc/lpfc_scsi.o] Error 1

make[2]: *** [drivers/scsi/lpfc] Error 2

make[1]: *** [drivers/scsi] Error 2

make: *** [drivers] Error 2
```

how to ?

Thanks!Last edited by ant1688 on Thu Aug 30, 2012 4:57 pm; edited 1 time in total

----------

## BillWho

ant1688,

Are you in /usr/src/linux    :Question:   That looks like an error you would get if you weren't

----------

## Hu

Based on his prompt, he is in a directory named linux.  Given that it did attempt to compile, I think it is probably /usr/src/linux, which is unfortunate since that means he is compiling as root.  However, the output indicates that he is compiling with -Werror, so a relatively minor warning [-Wunused-variable] was promoted to a fatal error.

----------

## ant1688

 *Hu wrote:*   

> Based on his prompt, he is in a directory named linux.  Given that it did attempt to compile, I think it is probably /usr/src/linux, which is unfortunate since that means he is compiling as root.  However, the output indicates that he is compiling with -Werror, so a relatively minor warning [-Wunused-variable] was promoted to a fatal error.

 

Yes, I am in /usr/src/linux as root ... it is changed that the root cannot run make kernel?

----------

## Randy Andy

 *ant1688 wrote:*   

>  Yes, I am in /usr/src/linux as root ... it is changed that the root cannot run make kernel?

 

No, you can build your kernel as root of course.

Does your symlink point to the actually installed kernel sources you actually try to compile?

So please show us :

```
ls -l /usr/src/
```

or more comfortable, use eselect if installed for switching and show us the output of:

```
eselect kernel list
```

Regards, Andy.

----------

## DaggyStyle

as Hu pointed out, your problem is rather simple, notice this:

```
...

cc1: warnings being treated as errors

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_bpl’:

drivers/scsi/lpfc/lpfc_scsi.c:1900:11: error: unused variable ‘rc’

...
```

this means that you are compiling the kernel with -Werror which treats all warnings as errors.

try to understand how that flag gets into the compilation process.

----------

## ant1688

 *DaggyStyle wrote:*   

> as Hu pointed out, your problem is rather simple, notice this:
> 
> ```
> ...
> 
> ...

 

Thank to your hint, I delete the "-Werror-implicit-function-declaration " in line 369 in Makefile.

It seems now compiling kernel 3.4.9 smoothly...there is another Makefiel needs to comment the line of "-Werror" under the folder of drivers...I am adding [SOLVED] on my thread in kernel 3.4.9 now.

----------

## DaggyStyle

 *ant1688 wrote:*   

>  *DaggyStyle wrote:*   as Hu pointed out, your problem is rather simple, notice this:
> 
> ```
> ...
> 
> ...

 

I'm not sure this is solved, by default kernel compilation shouldn't fail over errors, I'd recommend to check you CFLAGS.

----------

## thienvu

 *DaggyStyle wrote:*   

> I'm not sure this is solved, by default kernel compilation shouldn't fail over errors, I'd recommend to check you CFLAGS.

 

I ran into this problem, it's an issue with gentoo-sources. I'm not sure if it's upstream or if it's a problem with genpatches.

```
CFLAGS="-march=k8-sse3 -O2 -pipe"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j3"

```

In drivers/scsi/lpfc/Makefile:

```
ccflags-y += -Werror

```

So then when you compile -

```
  CC [M]  drivers/scsi/lpfc/lpfc_scsi.o

cc1: warnings being treated as errors

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_bpl’:

drivers/scsi/lpfc/lpfc_scsi.c:1900:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_bpl_prot’:

drivers/scsi/lpfc/lpfc_scsi.c:2037:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_sgl’:

drivers/scsi/lpfc/lpfc_scsi.c:2256:11: error: unused variable ‘rc’

drivers/scsi/lpfc/lpfc_scsi.c: In function ‘lpfc_bg_setup_sgl_prot’:

drivers/scsi/lpfc/lpfc_scsi.c:2386:11: error: unused variable ‘rc’

make[3]: *** [drivers/scsi/lpfc/lpfc_scsi.o] Error 1

```

Makefile should be fixed as a workaround or driver should be fixed.

----------

## DaggyStyle

 *thienvu wrote:*   

>  *DaggyStyle wrote:*   I'm not sure this is solved, by default kernel compilation shouldn't fail over errors, I'd recommend to check you CFLAGS. 
> 
> I ran into this problem, it's an issue with gentoo-sources. I'm not sure if it's upstream or if it's a problem with genpatches.
> 
> ```
> ...

 

actually, you are wrong, it isn't gentoo sources, it is a kernel issue, see: http://lxr.linux.no/linux+v3.5.3/drivers/scsi/lpfc/Makefile

it is a bug in the kernel, I have no idea how in hell the author of the driver released that.

there are two option, upgrade to 3.5.x which seems to solve this issue or enable CONFIG_SCSI_LPFC_DEBUG_FS in the config which will hide it until you upgrade to 3.5.x

you can open a bug in gentoo and request that someone will patch this thing but I'm not sure it worth the time.

----------

