Skip to contentSkip to conversation

MIPS: VDSO: Fix build error with binutils 2.24 and earlier

PATCH In review Guenter Roeck 3 participants 7 messages Dec 24, 2015 – Jan 5, 2016 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS: VDSO: Fix build error with binutils 2.24 and earlier

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

 arch/mips/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +1 -1
index 018f8c7b94f2..14568900fc1d 100644
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
 # the comments on that file.
 #
 ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)
     $(warning MIPS VDSO requires binutils >= 2.25)
     obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
     ccflags-vdso += -DDISABLE_MIPS_VDSO
Signature · 1 line
2.1.4
#1 lore raw

Hi Guenter,

Quoted 26 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

 arch/mips/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +0 -0
index 018f8c7b94f2..14568900fc1d 100644

arch/mips/vdso/Makefile aflags-vdso := $(ccflags-vdso) \ · line 29

Quoted 5 lines
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
 # the comments on that file.
 #
 ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)

I agree this is semantically correct, but there is something more evil going on here.

Originally the check was version <= 2.24
Qais' patch changed it to version >= 2.25 (intending version < 2.25) Your patch changes it to version < 2.25

I think the reason this fixed the problem for Qais is actually that he probably had a similar toolchain version to what I'm using:

GNU ld (Codescape GNU Tools 2015.06-05 for MIPS MTI Linux) 2.24.90

./scripts/ld-version.sh does this:

print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];

which changes that version number into:
20000000
+ 2400000
+ 900000 = 23300000

I.e. it doesn't expect a[3] to be >= 10.

Should we do something like this (increase multipliers on a[1] and a[2])?:

scripts/ld-version.sh +1 -1
index 198580d245e0..0b67edc5bc6f 100755
@@ -3,6 +3,6 @@
 	{
 	gsub(".*)", "");
 	split($1,a, ".");
-	print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
 	exit
 	}

which gives 2.24.90 => 224900000.

All call sites would need updating too to add the extra 0, but a quick git grep isn't showing any other ones than this one.

Cheers
James

Quoted 7 lines
arch/mips/vdso/Makefile +0 -0
     $(warning MIPS VDSO requires binutils >= 2.25)
     obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
     ccflags-vdso += -DDISABLE_MIPS_VDSO
Signature · 1 line
2.1.4
#2 lore raw
Quoted 74 lines · James Hogan

Hi Guenter,

Quoted 26 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

 arch/mips/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +0 -0
index 018f8c7b94f2..14568900fc1d 100644

arch/mips/vdso/Makefile aflags-vdso := $(ccflags-vdso) \ · line 29

Quoted 5 lines
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
 # the comments on that file.
 #
 ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)

I agree this is semantically correct, but there is something more evil going on here.

Originally the check was version <= 2.24
Qais' patch changed it to version >= 2.25 (intending version < 2.25) Your patch changes it to version < 2.25

I think the reason this fixed the problem for Qais is actually that he probably had a similar toolchain version to what I'm using:

GNU ld (Codescape GNU Tools 2015.06-05 for MIPS MTI Linux) 2.24.90

./scripts/ld-version.sh does this:

print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];

which changes that version number into:
20000000
+ 2400000
+ 900000 = 23300000

I.e. it doesn't expect a[3] to be >= 10.

Should we do something like this (increase multipliers on a[1] and a[2])?:

scripts/ld-version.sh +1 -1
index 198580d245e0..0b67edc5bc6f 100755
@@ -3,6 +3,6 @@
 	{
 	gsub(".*)", "");
 	split($1,a, ".");
-	print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
 	exit
 	}
Quoted 4 lines

which gives 2.24.90 => 224900000.

All call sites would need updating too to add the extra 0, but a quick git grep isn't showing any other ones than this one.

Actually, linux-next includes this commit which uses ld-ifversion too:

19a3cc83353e3bb4bc28769f8606139a3d350d2d "Kbuild, lto: Add Link Time Optimization support v3"

Cheers
James

Quoted 11 lines

Cheers
James

Quoted 7 lines
arch/mips/vdso/Makefile +0 -0
     $(warning MIPS VDSO requires binutils >= 2.25)
     obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
     ccflags-vdso += -DDISABLE_MIPS_VDSO
Signature · 1 line
2.1.4
#3 lore raw
Quoted 77 lines · James Hogan
Quoted 76 lines · James Hogan

Hi Guenter,

Quoted 26 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

 arch/mips/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +0 -0
index 018f8c7b94f2..14568900fc1d 100644

arch/mips/vdso/Makefile aflags-vdso := $(ccflags-vdso) \ · line 29

Quoted 5 lines
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
 # the comments on that file.
 #
 ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)

I agree this is semantically correct, but there is something more evil going on here.

Originally the check was version <= 2.24
Qais' patch changed it to version >= 2.25 (intending version < 2.25) Your patch changes it to version < 2.25

I think the reason this fixed the problem for Qais is actually that he probably had a similar toolchain version to what I'm using:

GNU ld (Codescape GNU Tools 2015.06-05 for MIPS MTI Linux) 2.24.90

./scripts/ld-version.sh does this:

print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];

which changes that version number into:
20000000
+ 2400000
+ 900000 = 23300000

I.e. it doesn't expect a[3] to be >= 10.

Should we do something like this (increase multipliers on a[1] and a[2])?:

scripts/ld-version.sh +1 -1
index 198580d245e0..0b67edc5bc6f 100755
@@ -3,6 +3,6 @@
 	{
 	gsub(".*)", "");
 	split($1,a, ".");
-	print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
 	exit
 	}

which gives 2.24.90 => 224900000.

Quoted 7 lines
Quoted 2 lines

All call sites would need updating too to add the extra 0, but a quick git grep isn't showing any other ones than this one.

Actually, linux-next includes this commit which uses ld-ifversion too:

19a3cc83353e3bb4bc28769f8606139a3d350d2d "Kbuild, lto: Add Link Time Optimization support v3"

That commit needs updating for other reasons, so feel free to fix ld-ifversion and its usage in arch/mips.

Michal

#4 lore raw
Quoted 83 lines · Michal Marek
Quoted 82 lines · James Hogan
Quoted 74 lines · James Hogan

Hi Guenter,

Quoted 26 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

 arch/mips/vdso/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +0 -0
index 018f8c7b94f2..14568900fc1d 100644

arch/mips/vdso/Makefile aflags-vdso := $(ccflags-vdso) \ · line 29

Quoted 5 lines
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
 # the comments on that file.
 #
 ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)

I agree this is semantically correct, but there is something more evil going on here.

Originally the check was version <= 2.24
Qais' patch changed it to version >= 2.25 (intending version < 2.25) Your patch changes it to version < 2.25

I think the reason this fixed the problem for Qais is actually that he probably had a similar toolchain version to what I'm using:

GNU ld (Codescape GNU Tools 2015.06-05 for MIPS MTI Linux) 2.24.90

./scripts/ld-version.sh does this:

print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];

which changes that version number into:
20000000
+ 2400000
+ 900000 = 23300000

I.e. it doesn't expect a[3] to be >= 10.

Should we do something like this (increase multipliers on a[1] and a[2])?:

scripts/ld-version.sh +1 -1
index 198580d245e0..0b67edc5bc6f 100755
@@ -3,6 +3,6 @@
 	{
 	gsub(".*)", "");
 	split($1,a, ".");
-	print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
 	exit
 	}
Quoted 4 lines

which gives 2.24.90 => 224900000.

All call sites would need updating too to add the extra 0, but a quick git grep isn't showing any other ones than this one.

Actually, linux-next includes this commit which uses ld-ifversion too:

Quoted 5 lines
Quoted 2 lines

19a3cc83353e3bb4bc28769f8606139a3d350d2d "Kbuild, lto: Add Link Time Optimization support v3"

That commit needs updating for other reasons, so feel free to fix ld-ifversion and its usage in arch/mips.

Thanks. This change is now in linux-next, and will hopefully be included in v4.4:
http://patchwork.linux-mips.org/patch/11931/

Cheers
James

#5 lore raw
In reply to James Hogan
Quoted 38 lines · James Hogan

Hi Guenter,

Quoted 26 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")
Cc Qais Yousef <[email protected]>

---
Tested with binutils 2.25 and 2.22.

  arch/mips/vdso/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +0 -0
index 018f8c7b94f2..14568900fc1d 100644

arch/mips/vdso/Makefile aflags-vdso := $(ccflags-vdso) \ · line 29

Quoted 5 lines
arch/mips/vdso/Makefile +1 -1
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
  # the comments on that file.
  #
  ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)

I agree this is semantically correct, but there is something more evil going on here.

Quoted 9 lines

Originally the check was version <= 2.24
Qais' patch changed it to version >= 2.25 (intending version < 2.25) Your patch changes it to version < 2.25

I think the reason this fixed the problem for Qais is actually that he probably had a similar toolchain version to what I'm using:

GNU ld (Codescape GNU Tools 2015.06-05 for MIPS MTI Linux) 2.24.90

My toolchains are yocto 1.3 (2.22) and yocto 2.0 (2.25).

Quoted 27 lines

./scripts/ld-version.sh does this:

print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];

which changes that version number into:
20000000

(quoted diff) +2 -0
+  2400000
+   900000 = 23300000

I.e. it doesn't expect a[3] to be >= 10.

Should we do something like this (increase multipliers on a[1] and a[2])?:

scripts/ld-version.sh +1 -1
index 198580d245e0..0b67edc5bc6f 100755
@@ -3,6 +3,6 @@
  	{
  	gsub(".*)", "");
  	split($1,a, ".");
-	print a[1]*10000000 + a[2]*100000 + a[3]*10000 + a[4]*100 + a[5];
+	print a[1]*100000000 + a[2]*1000000 + a[3]*10000 + a[4]*100 + a[5];
  	exit
  	}
Quoted 2 lines

which gives 2.24.90 => 224900000.

Yes, that makes sense, and from your description will be necessary.

Thanks,
Guenter

#6 lore raw
In reply to Guenter Roeck
Quoted 13 lines · Guenter Roeck

Commit 2a037f310bab ("MIPS: VDSO: Fix build error") tries to fix a build error seen with binutils 2.24 and earlier. However, the fix does not work, and again results in the already known build errors if the kernel is built with an earlier version of binutils.

CC arch/mips/vdso/gettimeofday.o
/tmp/ccnOVbHT.s: Assembler messages:
/tmp/ccnOVbHT.s:50: Error: can't resolve _start' {*UND* section} - L0 {.text section} /tmp/ccnOVbHT.s:374: Error: can't resolve _start' {*UND* section} - L0 {.text section} scripts/Makefile.build:258: recipe for target 'arch/mips/vdso/gettimeofday.o' failed make[2]: *** [arch/mips/vdso/gettimeofday.o] Error 1

Quoted 1 line
Fixes 2a037f310bab ("MIPS: VDSO: Fix build error")

The above patch, and thus the build error with binutils 2.24 and earlier introduced by it, has now made it into the mainline kernel.

Guenter

Quoted 22 lines

---
Tested with binutils 2.25 and 2.22.

  arch/mips/vdso/Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/vdso/Makefile +1 -1
index 018f8c7b94f2..14568900fc1d 100644
@@ -26,7 +26,7 @@ aflags-vdso := $(ccflags-vdso) \
  # the comments on that file.
  #
  ifndef CONFIG_CPU_MIPSR6
-  ifeq ($(call ld-ifversion, -lt, 22500000, y),)
+  ifeq ($(call ld-ifversion, -lt, 22500000, y),y)
      $(warning MIPS VDSO requires binutils >= 2.25)
      obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
      ccflags-vdso += -DDISABLE_MIPS_VDSO