# Build errors on mainline kernel

- Subsystems: LINUX FOR POWERPC (32-BIT AND 64-BIT), LINUX FOR POWERPC EMBEDDED PPC85XX, THE REST
- Maintainers: Madhavan Srinivasan, Scott Wood, Linus Torvalds
- List: linuxppc-dev
- 6 messages, 3 authors
- Page: https://ratatoskr.run/linuxppc-dev/2013/08/9475781/t

## Build errors on mainline kernel

- From: Sukadev Bhattiprolu \<hidden\>
- Date: 2013-08-09 18:25:19 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475781.md

```text

I am tryng to compile clean mainline kernel with a few different config files
and running into errors with some configs.

I am building on RHEL6.3 with following binaries:

	gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
	GNU ld version 2.20.51.0.2-5.34.el6 20100205
	binutils-2.20.51.0.2-5.34.el6.ppc64
	binutils-devel-2.20.51.0.2-5.34.el6.ppc64

I am getting the error with several files and configs, but other configs 
(eg: ppc64_defconfig, pmac32_defconfig) build fine.

For instance, with latest mainline kernel (commit 6c2580c) and ppc64_defconfig, I get:

	make O=linux-obj mrproper
	make O=linux-obj ppc64e_defconfig
	make O=linux-obj arch/powerpc/platforms/85xx/smp.o
	  ...

	CC      arch/powerpc/platforms/85xx/smp.o
	{standard input}: Assembler messages:
	{standard input}:240: Error: junk at end of line: `1'
	make[2]: *** [arch/powerpc/platforms/85xx/smp.o] Error 1
	make[1]: *** [arch/powerpc/platforms/85xx/smp.o] Error 2

Not sure if 240 is a line number in smp.c, but looking through the function
containing line 240, I was able to compile the smp.c after commenting out
the two WARN_ON() messages.

diff --git a/arch/powerpc/platforms/85xx/smp.c b/arch/powerpc/platforms/85xx/smp
index 5ced4f5..9705850 100644
--- a/arch/powerpc/platforms/85xx/smp.c
+++ b/arch/powerpc/platforms/85xx/smp.c
@@ -151,8 +151,10 @@ static int smp_85xx_kick_cpu(int nr)
        int ioremappable;
        int ret = 0;
 
+#if 0
        WARN_ON(nr < 0 || nr >= NR_CPUS);
        WARN_ON(hw_cpu < 0 || hw_cpu >= NR_CPUS);
+#endif
 
        pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);

---

The pre-processor output for the first WARN_ON() is:

 ---
 ({ int __ret_warn_on = !!(nr < 0 || nr >= 32); if (__builtin_constant_p(__ret_warn_on)) { if (__ret_warn_on) do { __asm__ __volatile__( "1:    twi 31,0,0\n" ".section __bug_table,\"a\"\n" "2:\t" ".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previous\n" : : "i" ("/root/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c"), "i" (154), "i" (((1 << 0) | ((9) << 8))), "i" (sizeof(struct bug_entry))); } while (0); } else { __asm__ __volatile__( "1:      ""tdnei" " ""   %4,0\n" ".section __bug_table,\"a\"\n" "2:\t" ".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previous\n" : : "i" ("/root/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c"), "i" (154), "i" (((1 << 0) | ((9) << 8))), "i" (sizeof(struct bug_entry)), "r" (__ret_warn_on)); } __builtin_expect(!!(__ret_warn_on), 0); });

---


Should I be doing something different to build with these configs ?
```

## Re: Build errors on mainline kernel

- From: Kumar Gala \<hidden\>
- Date: 2013-08-09 23:47:11 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475782.md

```text

On Aug 9, 2013, at 1:24 PM, Sukadev Bhattiprolu wrote:

>=20
> I am tryng to compile clean mainline kernel with a few different =
config files
> and running into errors with some configs.
>=20
> I am building on RHEL6.3 with following binaries:
>=20
> 	gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> 	GNU ld version 2.20.51.0.2-5.34.el6 20100205
> 	binutils-2.20.51.0.2-5.34.el6.ppc64
> 	binutils-devel-2.20.51.0.2-5.34.el6.ppc64
>=20
> I am getting the error with several files and configs, but other =
configs=20
> (eg: ppc64_defconfig, pmac32_defconfig) build fine.
>=20
> For instance, with latest mainline kernel (commit 6c2580c) and =
ppc64_defconfig, I get:
>=20
> 	make O=3Dlinux-obj mrproper
> 	make O=3Dlinux-obj ppc64e_defconfig
> 	make O=3Dlinux-obj arch/powerpc/platforms/85xx/smp.o
> 	  ...
>=20
> 	CC      arch/powerpc/platforms/85xx/smp.o
> 	{standard input}: Assembler messages:
> 	{standard input}:240: Error: junk at end of line: `1'
> 	make[2]: *** [arch/powerpc/platforms/85xx/smp.o] Error 1
> 	make[1]: *** [arch/powerpc/platforms/85xx/smp.o] Error 2
>=20
> Not sure if 240 is a line number in smp.c, but looking through the =
function
> containing line 240, I was able to compile the smp.c after commenting =
out
> the two WARN_ON() messages.
>=20
> diff --git a/arch/powerpc/platforms/85xx/smp.c =
b/arch/powerpc/platforms/85xx/smp
> index 5ced4f5..9705850 100644
> --- a/arch/powerpc/platforms/85xx/smp.c
> +++ b/arch/powerpc/platforms/85xx/smp.c
> @@ -151,8 +151,10 @@ static int smp_85xx_kick_cpu(int nr)
>        int ioremappable;
>        int ret =3D 0;
>=20
> +#if 0
>        WARN_ON(nr < 0 || nr >=3D NR_CPUS);
>        WARN_ON(hw_cpu < 0 || hw_cpu >=3D NR_CPUS);
> +#endif
>=20
>        pr_debug("smp_85xx_kick_cpu: kick CPU #%d\n", nr);
>=20
> ---
>=20
> The pre-processor output for the first WARN_ON() is:
>=20
> ---
> ({ int __ret_warn_on =3D !!(nr < 0 || nr >=3D 32); if =
(__builtin_constant_p(__ret_warn_on)) { if (__ret_warn_on) do { __asm__ =
__volatile__( "1:    twi 31,0,0\n" ".section __bug_table,\"a\"\n" "2:\t" =
".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previous\n" =
: : "i" ("/root/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c"), "i" =
(154), "i" (((1 << 0) | ((9) << 8))), "i" (sizeof(struct bug_entry))); } =
while (0); } else { __asm__ __volatile__( "1:      ""tdnei" " ""   =
%4,0\n" ".section __bug_table,\"a\"\n" "2:\t" ".llong" " " "1b, %0\n" =
"\t.short %1, %2\n" ".org 2b+%3\n" ".previous\n" : : "i" =
("/root/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c"), "i" (154), =
"i" (((1 << 0) | ((9) << 8))), "i" (sizeof(struct bug_entry)), "r" =
(__ret_warn_on)); } __builtin_expect(!!(__ret_warn_on), 0); });
>=20
> ---
>=20
>=20
> Should I be doing something different to build with these configs ?
>=20

Hmm, that is odd.

How about doing:

$ make V=3D1

so we can see what compiler flags are being passed around.

- k=
```

## Re: Build errors on mainline kernel

- From: Sukadev Bhattiprolu \<hidden\>
- Date: 2013-08-10 01:01:51 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475783.md

```text
Kumar Gala [galak@kernel.crashing.org] wrote:
|=20
| >=20
| > The pre-processor output for the first WARN_ON() is:
| >=20
| > ---
| > ({ int __ret_warn_on =3D !!(nr < 0 || nr >=3D 32); if (__builtin_consta=
nt_p(__ret_warn_on)) { if (__ret_warn_on) do { __asm__ __volatile__( "1:   =
 twi 31,0,0\n" ".section __bug_table,\"a\"\n" "2:\t" ".llong" " " "1b, %0\n=
" "\t.short %1, %2\n" ".org 2b+%3\n" ".previous\n" : : "i" ("/root/tmp/linu=
x.git/arch/powerpc/platforms/85xx/smp.c"), "i" (154), "i" (((1 << 0) | ((9)=
 << 8))), "i" (sizeof(struct bug_entry))); } while (0); } else { __asm__ __=
volatile__( "1:      ""tdnei" " ""   %4,0\n" ".section __bug_table,\"a\"\n"=
 "2:\t" ".llong" " " "1b, %0\n" "\t.short %1, %2\n" ".org 2b+%3\n" ".previo=
us\n" : : "i" ("/root/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c"), "i=
" (154), "i" (((1 << 0) | ((9) << 8))), "i" (sizeof(struct bug_entry)), "r"=
 (__ret_warn_on)); } __builtin_expect(!!(__ret_warn_on), 0); });
| >=20
| > ---
| >=20
| >=20
| > Should I be doing something different to build with these configs ?
| >=20
|=20
| Hmm, that is odd.
|=20
| How about doing:
|=20
| $ make V=3D1
|=20
| so we can see what compiler flags are being passed around.

Sure.=20

make -f /root/tmp/linux.git/scripts/Makefile.build obj=3Darch/powerpc/platf=
orms/85xx arch/powerpc/platforms/85xx/smp.o
  gcc -m64 -Wp,-MD,arch/powerpc/platforms/85xx/.smp.o.d  -nostdinc -isystem=
 /usr/lib/gcc/ppc64-redhat-linux/4.4.6/include -I/root/tmp/linux.git/arch/p=
owerpc/include -Iarch/powerpc/include/generated  -I/root/tmp/linux.git/incl=
ude -Iinclude -I/root/tmp/linux.git/arch/powerpc/include/uapi -Iarch/powerp=
c/include/generated/uapi -I/root/tmp/linux.git/include/uapi -Iinclude/gener=
ated/uapi -include /root/tmp/linux.git/include/linux/kconfig.h  -I/root/tmp=
/linux.git/arch/powerpc/platforms/85xx -Iarch/powerpc/platforms/85xx -D__KE=
RNEL__  -I/root/tmp/linux.git/arch/powerpc -Iarch/powerpc -Wall -Wundef -Ws=
trict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-im=
plicit-function-declaration -Wno-format-security -fno-delete-null-pointer-c=
hecks -O2 -msoft-float -pipe  -I/root/tmp/linux.git/arch/powerpc -Iarch/pow=
erpc -mtraceback=3Dno -mcall-aixdesc -mcmodel=3Dmedium -mtune=3Dpower7 -mno=
-altivec -mno-vsx -mno-spe -mspe=3Dno -funit-at-a-time -fno-dwarf2-cfi-asm =
-mno-string -Wa,-me500 -Wframe-larger-than=3D2048 -fno-stack-protector -Wno=
-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement=
 -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO=
    -D"KBUILD_STR(s)=3D#s" -D"KBUILD_BASENAME=3DKBUILD_STR(smp)"  -D"KBUILD=
_MODNAME=3DKBUILD_STR(smp)" -c -o arch/powerpc/platforms/85xx/.tmp_smp.o /r=
oot/tmp/linux.git/arch/powerpc/platforms/85xx/smp.c
{standard input}: Assembler messages:
{standard input}:244: Error: junk at end of line: `1'
make[2]: *** [arch/powerpc/platforms/85xx/smp.o] Error 1
make[1]: *** [arch/powerpc/platforms/85xx/smp.o] Error 2
make: *** [sub-make] Error 2
```

## Re: Build errors on mainline kernel

- From: Michael Ellerman \<hidden\>
- Date: 2013-08-12 05:42:03 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475803.md

```text
On Fri, 2013-08-09 at 11:24 -0700, Sukadev Bhattiprolu wrote:
> I am tryng to compile clean mainline kernel with a few different config files
> and running into errors with some configs.
> 
> I am building on RHEL6.3 with following binaries:
> 
> 	gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> 	GNU ld version 2.20.51.0.2-5.34.el6 20100205
> 	binutils-2.20.51.0.2-5.34.el6.ppc64
> 	binutils-devel-2.20.51.0.2-5.34.el6.ppc64
> 
> I am getting the error with several files and configs, but other configs 
> (eg: ppc64_defconfig, pmac32_defconfig) build fine.
> 
> For instance, with latest mainline kernel (commit 6c2580c) and ppc64_defconfig, I get:

Here you say ppc64_defconfig ..

> 	make O=linux-obj mrproper
> 	make O=linux-obj ppc64e_defconfig

But here you say ppc64e_defconfig ?

> 	make O=linux-obj arch/powerpc/platforms/85xx/smp.o
> 	  ...
> 
> 	CC      arch/powerpc/platforms/85xx/smp.o
> 	{standard input}: Assembler messages:
> 	{standard input}:240: Error: junk at end of line: `1'
> 	make[2]: *** [arch/powerpc/platforms/85xx/smp.o] Error 1
> 	make[1]: *** [arch/powerpc/platforms/85xx/smp.o] Error 2

So I'm not clear which config you're building.

cheers
```

## Re: Build errors on mainline kernel

- From: Sukadev Bhattiprolu \<hidden\>
- Date: 2013-08-12 06:02:59 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475804.md

```text
Michael Ellerman [michael@ellerman.id.au] wrote:
| On Fri, 2013-08-09 at 11:24 -0700, Sukadev Bhattiprolu wrote:
| > I am tryng to compile clean mainline kernel with a few different config files
| > and running into errors with some configs.
| > 
| > I am building on RHEL6.3 with following binaries:
| > 
| > 	gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
| > 	GNU ld version 2.20.51.0.2-5.34.el6 20100205
| > 	binutils-2.20.51.0.2-5.34.el6.ppc64
| > 	binutils-devel-2.20.51.0.2-5.34.el6.ppc64
| > 
| > I am getting the error with several files and configs, but other configs 
| > (eg: ppc64_defconfig, pmac32_defconfig) build fine.
| > 
| > For instance, with latest mainline kernel (commit 6c2580c) and ppc64_defconfig, I get:
| 
| Here you say ppc64_defconfig ..

That was a stupid typo. ppc64_defconfig works.

| 
| > 	make O=linux-obj mrproper
| > 	make O=linux-obj ppc64e_defconfig
| 
| But here you say ppc64e_defconfig ?

ppc64e_defconfig fails (checked again now).
```

## Re: Build errors on mainline kernel

- From: Michael Ellerman \<hidden\>
- Date: 2013-08-13 02:23:50 
- Message: https://ratatoskr.run/linuxppc-dev/2013/08/9475829.md

```text
On Sun, Aug 11, 2013 at 11:02:28PM -0700, Sukadev Bhattiprolu wrote:
> Michael Ellerman [michael@ellerman.id.au] wrote:
> | On Fri, 2013-08-09 at 11:24 -0700, Sukadev Bhattiprolu wrote:
> | > I am tryng to compile clean mainline kernel with a few different config files
> | > and running into errors with some configs.
> | > 
> | > I am building on RHEL6.3 with following binaries:
> | > 
> | > 	gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
> | > 	GNU ld version 2.20.51.0.2-5.34.el6 20100205
> | > 	binutils-2.20.51.0.2-5.34.el6.ppc64
> | > 	binutils-devel-2.20.51.0.2-5.34.el6.ppc64
> | > 
> | > I am getting the error with several files and configs, but other configs 
> | > (eg: ppc64_defconfig, pmac32_defconfig) build fine.
> | > 
> | > For instance, with latest mainline kernel (commit 6c2580c) and ppc64_defconfig, I get:
> | 
> | Here you say ppc64_defconfig ..
> 
> That was a stupid typo. ppc64_defconfig works.
> 
> | 
> | > 	make O=linux-obj mrproper
> | > 	make O=linux-obj ppc64e_defconfig
> | 
> | But here you say ppc64e_defconfig ?
> 
> ppc64e_defconfig fails (checked again now).

OK. I don't have a RHEL 6 system around. But I can build
ppc64e_defconfig on debian with gcc 4.4.7-2.

So not sure what's going on.
 
cheers
```
