Skip to contentSkip to conversation

Kernel build fail with "Circular xxxx <- xxxx dependency dropped"

PATCH In review Mike Qiu 2 participants 8 messages Jun 11, 2014 – Jun 12, 2014

Subsystems (2)
lore
Share & tools
lore

Mike Qiu

author
#0 lore raw

Hi all,

I recently build linux next kernel in IBM Power7 platform, use default config file copy from /boot/config-3.6.10-4.fc18.ppc64p7

[root@cena01 linux-next]# uname -a
Linux cena01.austin.ibm.com 3.15.0-rc1+ #47 SMP Thu Apr 24 20:59:46 CDT 2014 ppc64 ppc64 ppc64 GNU/Linux

[root@cena01 linux-next]# cat /etc/issue
Fedora release 18 (Spherical Cow)
Kernel \r on an \m (\l)

and build error log below:

[root@cena01 linux-next]# make -j60

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  CALL    arch/powerpc/kernel/prom_init_check.sh
  CHK     include/generated/uapi/linux/version.h
  CALL    arch/powerpc/relocs_check.pl

Building modules, stage 2.
WARNING: 1 bad relocations
c000000001455040 R_PPC64_ADDR64 uprobes_fetch_type_table
make[1]: Circular arch/powerpc/boot/zImage.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.ps3.lds dependency dropped.
WRAP arch/powerpc/boot/zImage.ps3.lds.S
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot open linker script file arch/powerpc/boot/zImage.lds: No such file or directory make[1]: *** [arch/powerpc/boot/zImage.ps3.lds.S] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....
MODPOST 1853 modules

I use git bisect to find out the possible commits to lead this problem:
7e1c04779efd51154baf652e653ceb24ce68939b kbuild: Use relative path for $(objtree) 890676c65d699db3ad82e7dddd0cf8fb449031af kbuild: Use relative path when building in the source tree 9da0763bdd82572be243fcf5161734f11568960f kbuild: Use relative path when building in a subdir of the source tree

Thanks
Mike

#1 lore raw

Dne 11.6.2014 08:02, Mike Qiu napsal(a):

Quoted 51 lines

Hi all,

I recently build linux next kernel in IBM Power7 platform, use default config file copy from /boot/config-3.6.10-4.fc18.ppc64p7

[root@cena01 linux-next]# uname -a
Linux cena01.austin.ibm.com 3.15.0-rc1+ #47 SMP Thu Apr 24 20:59:46 CDT 2014 ppc64 ppc64 ppc64 GNU/Linux

[root@cena01 linux-next]# cat /etc/issue
Fedora release 18 (Spherical Cow)
Kernel \r on an \m (\l)

and build error log below:

[root@cena01 linux-next]# make -j60

  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
  CALL    arch/powerpc/kernel/systbl_chk.sh
  CALL    arch/powerpc/kernel/prom_init_check.sh
  CHK     include/generated/uapi/linux/version.h
  CALL    arch/powerpc/relocs_check.pl

Building modules, stage 2.
WARNING: 1 bad relocations
c000000001455040 R_PPC64_ADDR64 uprobes_fetch_type_table
make[1]: Circular arch/powerpc/boot/zImage.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.ps3.lds dependency dropped.
WRAP arch/powerpc/boot/zImage.ps3.lds.S
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot open linker script file arch/powerpc/boot/zImage.lds: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.ps3.lds.S] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....
MODPOST 1853 modules

Quoted 7 lines

I use git bisect to find out the possible commits to lead this problem:
7e1c04779efd51154baf652e653ceb24ce68939b kbuild: Use relative path for $(objtree)
890676c65d699db3ad82e7dddd0cf8fb449031af kbuild: Use relative path when building in the source tree 9da0763bdd82572be243fcf5161734f11568960f kbuild: Use relative path when building in a subdir of the source tree

Thanks for the report, I'll have a look. If I do not come up with a solution soon, I'll revert the series.

Michal

#2 lore raw
Quoted 32 lines · Michal Marek

Dne 11.6.2014 08:02, Mike Qiu napsal(a):

Quoted 23 lines

make[1]: Circular arch/powerpc/boot/zImage.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.ps3.lds dependency dropped.
WRAP arch/powerpc/boot/zImage.ps3.lds.S
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot open linker script file arch/powerpc/boot/zImage.lds: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.ps3.lds.S] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....
MODPOST 1853 modules

Quoted 7 lines

I use git bisect to find out the possible commits to lead this problem:
7e1c04779efd51154baf652e653ceb24ce68939b kbuild: Use relative path for $(objtree)
890676c65d699db3ad82e7dddd0cf8fb449031af kbuild: Use relative path when building in the source tree 9da0763bdd82572be243fcf5161734f11568960f kbuild: Use relative path when building in a subdir of the source tree

Quoted 2 lines

Thanks for the report, I'll have a look. If I do not come up with a solution soon, I'll revert the series.

I have yet to test this, but can you try the patch below?

Thanks!
Michal

From 7f8336f4c7f2131efbe82543580dda3ec1988609 Mon Sep 17 00:00:00 2001
From: Michal Marek <[email protected]>
Date: Wed, 11 Jun 2014 13:53:48 +0200
Subject: [PATCH] powerpc: Avoid circular dependency with zImage.%

The rule to create the final images uses a zImage.% pattern. Unfortunately, this also matches the names of the zImage.*.lds linker scripts, which appear as a dependency of the final images. This somehow worked when $(srctree) used to be an absolute path, but now the pattern matches too much. List only the images from $(image-y) as the target of the rule, to avoid the circular dependency.

---
 arch/powerpc/boot/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/boot/Makefile +1 -1
index 426dce7..c60992c 100644
@@ -333,7 +333,7 @@ $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
 $(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
 	$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
 
-$(obj)/zImage.%: vmlinux $(wrapperbits)
+$(addprefix $(obj)/, $(filter zImage.%, $(image-y))): vmlinux $(wrapperbits)
 	$(call if_changed,wrap,$*)
 
 # dtbImage% - a dtbImage is a zImage with an embedded device tree blob
Signature · 1 line
1.9.2
#3 lore raw

Dne 11.6.2014 14:21, Michal Marek napsal(a):

Quoted 47 lines · Michal Marek
Quoted 32 lines

Dne 11.6.2014 08:02, Mike Qiu napsal(a):

Quoted 23 lines

make[1]: Circular arch/powerpc/boot/zImage.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.ps3.lds dependency dropped.
WRAP arch/powerpc/boot/zImage.ps3.lds.S
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot open linker script file arch/powerpc/boot/zImage.lds: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.ps3.lds.S] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....
MODPOST 1853 modules

Quoted 7 lines

I use git bisect to find out the possible commits to lead this problem:
7e1c04779efd51154baf652e653ceb24ce68939b kbuild: Use relative path for $(objtree)
890676c65d699db3ad82e7dddd0cf8fb449031af kbuild: Use relative path when building in the source tree 9da0763bdd82572be243fcf5161734f11568960f kbuild: Use relative path when building in a subdir of the source tree

Quoted 2 lines

Thanks for the report, I'll have a look. If I do not come up with a solution soon, I'll revert the series.

I have yet to test this, but can you try the patch below?

Thanks!
Michal

From 7f8336f4c7f2131efbe82543580dda3ec1988609 Mon Sep 17 00:00:00 2001
From: Michal Marek <[email protected]>
Date: Wed, 11 Jun 2014 13:53:48 +0200
Subject: [PATCH] powerpc: Avoid circular dependency with zImage.%

Quoted 7 lines

The rule to create the final images uses a zImage.% pattern. Unfortunately, this also matches the names of the zImage.*.lds linker scripts, which appear as a dependency of the final images. This somehow worked when $(srctree) used to be an absolute path, but now the pattern matches too much. List only the images from $(image-y) as the target of the rule, to avoid the circular dependency.

If merged, this should of course have a Reported-by: Mike Qiu <[email protected]>

Michal

author
#4 lore raw

Hi Michal,

after ally you patch, it also has some issue, see below:

WARNING: 1 bad relocations
c000000001455040 R_PPC64_ADDR64 uprobes_fetch_type_table
arch/powerpc/boot/Makefile:336: target `arch/powerpc/boot/zImage.pseries' given more than once in the same rule.
gcc -m32 -Wp,-MD,arch/powerpc/boot/.zImage.lds.d -nostdinc -isystem /usr/lib/gcc/ppc64-redhat-linux/4.7.2/include -I./arch/powerpc/include -Iarch/powerpc/include/generated -Iinclude -I./arch/powe
rpc/include/uapi -Iarch/powerpc/include/generated/uapi -I./include/uapi -Iinclude/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -Iarch/powerpc -E -Wp,-MD,arch/powerpc/boot/.zI
mage.lds.d -P -Upowerpc \
-D__ASSEMBLY__ -DLINKER_SCRIPT -o arch/powerpc/boot/zImage.lds
arch/powerpc/boot/zImage.lds.S
WRAP arch/powerpc/boot/zImage.pseries
WRAP arch/powerpc/boot/zImage.epapr
MODPOST 1853 modules
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot find arch/powerpc/boot/vmlinux.o: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.pseries] Error 1
make[1]: *** Waiting for unfinished jobs....
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot find arch/powerpc/boot/vmlinux.o: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.epapr] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....

Thanks
Mike

Quoted 59 lines · Michal Marek

Dne 11.6.2014 14:21, Michal Marek napsal(a):

Quoted 45 lines · Michal Marek
Quoted 31 lines

Dne 11.6.2014 08:02, Mike Qiu napsal(a):

Quoted 23 lines

make[1]: Circular arch/powerpc/boot/zImage.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.coff.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.lds dependency dropped.
make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.coff.lds dependency dropped. make[1]: Circular arch/powerpc/boot/zImage.ps3.lds.S <- arch/powerpc/boot/zImage.ps3.lds dependency dropped.
WRAP arch/powerpc/boot/zImage.ps3.lds.S
INFO: Uncompressed kernel (size 0x14d0db8) overlaps the address of the wrapper(0x400000)
INFO: Fixing the link_address of wrapper to (0x1500000)
ld: cannot open linker script file arch/powerpc/boot/zImage.lds: No such file or directory
make[1]: *** [arch/powerpc/boot/zImage.ps3.lds.S] Error 1
make: *** [zImage] Error 2
make: *** Waiting for unfinished jobs....
MODPOST 1853 modules

Quoted 7 lines

I use git bisect to find out the possible commits to lead this problem:
7e1c04779efd51154baf652e653ceb24ce68939b kbuild: Use relative path for $(objtree)
890676c65d699db3ad82e7dddd0cf8fb449031af kbuild: Use relative path when building in the source tree 9da0763bdd82572be243fcf5161734f11568960f kbuild: Use relative path when building in a subdir of the source tree

Quoted 2 lines

Thanks for the report, I'll have a look. If I do not come up with a solution soon, I'll revert the series.

I have yet to test this, but can you try the patch below?

Thanks!
Michal

From 7f8336f4c7f2131efbe82543580dda3ec1988609 Mon Sep 17 00:00:00 2001
From: Michal Marek <[email protected]>
Date: Wed, 11 Jun 2014 13:53:48 +0200
Subject: [PATCH] powerpc: Avoid circular dependency with zImage.%

Quoted 7 lines

The rule to create the final images uses a zImage.% pattern. Unfortunately, this also matches the names of the zImage.*.lds linker scripts, which appear as a dependency of the final images. This somehow worked when $(srctree) used to be an absolute path, but now the pattern matches too much. List only the images from $(image-y) as the target of the rule, to avoid the circular dependency.

If merged, this should of course have a Reported-by: Mike Qiu <[email protected]>

Michal

#5 lore raw

PATCH v2 1/1 powerpc: Avoid circular dependency with zImage.%

The rule to create the final images uses a zImage.% pattern. Unfortunately, this also matches the names of the zImage.*.lds linker scripts, which appear as a dependency of the final images. This somehow worked when $(srctree) used to be an absolute path, but now the pattern matches too much. List only the images from $(image-y) as the target of the rule, to avoid the circular dependency.

---
v2:
- Filter out duplicates in the target list
- fix the platform argument to cmd_wrap

 arch/powerpc/boot/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/Makefile +2 -2
index 426dce7..ccc25ed 100644
@@ -333,8 +333,8 @@ $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
 $(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
 	$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
 
-$(obj)/zImage.%: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,$*)
+$(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperbits)
+	$(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
 
 # dtbImage% - a dtbImage is a zImage with an embedded device tree blob
 $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
Signature · 1 line
1.9.2
author Tested-by on v2 1/1
#6 lore raw

Re: [PATCH v2] powerpc: Avoid circular dependency with zImage.%

This v2 patch is good,

Quoted 31 lines · Michal Marek

The rule to create the final images uses a zImage.% pattern. Unfortunately, this also matches the names of the zImage.*.lds linker scripts, which appear as a dependency of the final images. This somehow worked when $(srctree) used to be an absolute path, but now the pattern matches too much. List only the images from $(image-y) as the target of the rule, to avoid the circular dependency.

---
v2:
- Filter out duplicates in the target list
- fix the platform argument to cmd_wrap

  arch/powerpc/boot/Makefile | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/Makefile +2 -2
index 426dce7..ccc25ed 100644
@@ -333,8 +333,8 @@ $(addprefix $(obj)/, $(initrd-y)): $(obj)/ramdisk.image.gz
  $(obj)/zImage.initrd.%: vmlinux $(wrapperbits)
  	$(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz)
 
-$(obj)/zImage.%: vmlinux $(wrapperbits)
-	$(call if_changed,wrap,$*)
+$(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperbits)
+	$(call if_changed,wrap,$(subst $(obj)/zImage.,,$@))
 
  # dtbImage% - a dtbImage is a zImage with an embedded device tree blob
  $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
#7 lore raw

Re: [PATCH v2] powerpc: Avoid circular dependency with zImage.%

Dne 12.6.2014 04:07, Mike Qiu napsal(a):

Quoted 3 lines

This v2 patch is good,

Thanks. In kbuild.git it goes.

Michal