Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1676623 > unrolled thread
| Started by | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| First post | 2017-06-28 14:40 +0200 |
| Last post | 2017-06-29 19:00 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
Build failure in -next due to 'sh: thin archives fix linking' Guenter Roeck <linux@roeck-us.net> - 2017-06-28 14:40 +0200
Re: Build failure in -next due to 'sh: thin archives fix linking' Nicholas Piggin <npiggin@gmail.com> - 2017-06-28 15:00 +0200
Re: Build failure in -next due to 'sh: thin archives fix linking' Guenter Roeck <linux@roeck-us.net> - 2017-06-28 16:10 +0200
Re: Build failure in -next due to 'sh: thin archives fix linking' Masahiro Yamada <yamada.masahiro@socionext.com> - 2017-06-29 17:40 +0200
Re: Build failure in -next due to 'sh: thin archives fix linking' Nicholas Piggin <npiggin@gmail.com> - 2017-06-29 19:00 +0200
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-06-28 14:40 +0200 |
| Subject | Build failure in -next due to 'sh: thin archives fix linking' |
| Message-ID | <tXkqd-6Nm-5@gated-at.bofh.it> |
Hi, I see the following build error in -next when building sh:rts7751r2dplus_defconfig. sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: compiled for a big endian system and target is little endian sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: uses instructions which are incompatible with instructions used in previous modules sh4-linux-ld: failed to merge target specific data of file arch/sh/kernel/vsyscall/vsyscall-dummy.o make[2]: *** [arch/sh/kernel/vsyscall/vsyscall-syms.o] Error 1 Bisect points to 'sh: thin archives fix linking' as the culprit. Bisect log is attached. I tried with gcc 4.8.3 and 6.3.0, both built with buildroot for sh4eb. After reverting the offending patch, I get the following error. arch/sh/kernel/signal_32.o: In function `do_signal': signal_32.c:(.text+0x5c4): undefined reference to `__kernel_sigreturn' signal_32.c:(.text+0x724): undefined reference to `__kernel_rt_sigreturn' Makefile:989: recipe for target 'vmlinux' failed Guenter --- # bad: [89a39f3c7086301342175c461c4db43c68d34cc7] Add linux-next specific files for 20170627 # good: [c0bc126f97fb929b3ae02c1c62322645d70eb408] Linux 4.12-rc7 git bisect start 'HEAD' 'v4.12-rc7' # bad: [32e240e33387e1c3dcf302518d4420e7f19d51e2] Merge remote-tracking branch 'crypto/master' git bisect bad 32e240e33387e1c3dcf302518d4420e7f19d51e2 # bad: [5fa6b60a63a80c0d1adc4a7d2478fc7d22593493] Merge remote-tracking branch 'printk/for-next' git bisect bad 5fa6b60a63a80c0d1adc4a7d2478fc7d22593493 # bad: [99f4c8ff2a80c7c39dfd5558bda9f125313fc7ef] Merge remote-tracking branch 'arm-soc/for-next' git bisect bad 99f4c8ff2a80c7c39dfd5558bda9f125313fc7ef # good: [fff3affce6cd166063a56528e42eaf16c6a901b8] Merge branch 'next/dt' into for-next git bisect good fff3affce6cd166063a56528e42eaf16c6a901b8 # good: [88ad71aab1a7931ac3d35c3acaa431c3dc05afd9] [media] vimc: sen: Support several image formats git bisect good 88ad71aab1a7931ac3d35c3acaa431c3dc05afd9 # bad: [2bbc45806045b005f6a0f6db22a341f52622aca8] Merge remote-tracking branch 'asm-generic/master' git bisect bad 2bbc45806045b005f6a0f6db22a341f52622aca8 # bad: [fd47ada97a68d8be20dbdc115343f9d51bdf3714] Merge remote-tracking branch 'kbuild/for-next' git bisect bad fd47ada97a68d8be20dbdc115343f9d51bdf3714 # good: [1887a40b8699a8bde4a0b2883a1381c0a6e119e6] Merge remote-tracking branch 'net/master' git bisect good 1887a40b8699a8bde4a0b2883a1381c0a6e119e6 # bad: [39be5eac380dabc761c47358cdf8036bb5090f6b] Merge branches 'misc', 'kbuild' and 'thin-ar' into for-next git bisect bad 39be5eac380dabc761c47358cdf8036bb5090f6b # bad: [e7238f4fac14967bba823ef4b4b77ee928a4860a] kbuild: thin archives make default for all archs git bisect bad e7238f4fac14967bba823ef4b4b77ee928a4860a # good: [9fc5b7bc3c905ad207f21e8478659f4b935407c4] kbuild: handle libs-y archives separately from built-in.o archives git bisect good 9fc5b7bc3c905ad207f21e8478659f4b935407c4 # bad: [11690a748f62365890a9a9f9abf56ada9b7d5c40] ia64: thin archives fix linking git bisect bad 11690a748f62365890a9a9f9abf56ada9b7d5c40 # bad: [e2c99c9125c39eb43960da79f5691126b55d4b6c] sh: thin archives fix linking git bisect bad e2c99c9125c39eb43960da79f5691126b55d4b6c # first bad commit: [e2c99c9125c39eb43960da79f5691126b55d4b6c] sh: thin archives fix linking
[toc] | [next] | [standalone]
| From | Nicholas Piggin <npiggin@gmail.com> |
|---|---|
| Date | 2017-06-28 15:00 +0200 |
| Message-ID | <tXkJA-6TW-17@gated-at.bofh.it> |
| In reply to | #1676623 |
On Wed, 28 Jun 2017 05:38:50 -0700 Guenter Roeck <linux@roeck-us.net> wrote: > Hi, > > I see the following build error in -next when building sh:rts7751r2dplus_defconfig. > > sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: compiled for a big endian system and target is little endian > sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: uses instructions which are incompatible with instructions used in previous modules > sh4-linux-ld: failed to merge target specific data of file arch/sh/kernel/vsyscall/vsyscall-dummy.o > make[2]: *** [arch/sh/kernel/vsyscall/vsyscall-syms.o] Error 1 > > Bisect points to 'sh: thin archives fix linking' as the culprit. Bisect log is attached. > I tried with gcc 4.8.3 and 6.3.0, both built with buildroot for sh4eb. Thanks for the report. In arch/sh/kernel/vsyscall/Makefile, the line: cmd_syscall_syms = $(LD) -r -o $@ -R $< Can you try adding $(LDFLAGS), e.g. change it to: cmd_syscall_syms = $(LD) $(LDFLAGS) -r -o $@ -R $< Thanks, Nick
[toc] | [prev] | [next] | [standalone]
| From | Guenter Roeck <linux@roeck-us.net> |
|---|---|
| Date | 2017-06-28 16:10 +0200 |
| Message-ID | <tXlPl-7Na-33@gated-at.bofh.it> |
| In reply to | #1676639 |
On 06/28/2017 05:58 AM, Nicholas Piggin wrote: > On Wed, 28 Jun 2017 05:38:50 -0700 > Guenter Roeck <linux@roeck-us.net> wrote: > >> Hi, >> >> I see the following build error in -next when building sh:rts7751r2dplus_defconfig. >> >> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: compiled for a big endian system and target is little endian >> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: uses instructions which are incompatible with instructions used in previous modules >> sh4-linux-ld: failed to merge target specific data of file arch/sh/kernel/vsyscall/vsyscall-dummy.o >> make[2]: *** [arch/sh/kernel/vsyscall/vsyscall-syms.o] Error 1 >> >> Bisect points to 'sh: thin archives fix linking' as the culprit. Bisect log is attached. >> I tried with gcc 4.8.3 and 6.3.0, both built with buildroot for sh4eb. > > Thanks for the report. In arch/sh/kernel/vsyscall/Makefile, the line: > > cmd_syscall_syms = $(LD) -r -o $@ -R $< > > Can you try adding $(LDFLAGS), e.g. change it to: > > cmd_syscall_syms = $(LD) $(LDFLAGS) -r -o $@ -R $< > That fixes the problem (including the missing symbols seen after reverting the offending patch). Thanks, Guenter
[toc] | [prev] | [next] | [standalone]
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2017-06-29 17:40 +0200 |
| Message-ID | <tXJHX-Sn-1@gated-at.bofh.it> |
| In reply to | #1676697 |
Hi.
2017-06-28 23:02 GMT+09:00 Guenter Roeck <linux@roeck-us.net>:
> On 06/28/2017 05:58 AM, Nicholas Piggin wrote:
>>
>> On Wed, 28 Jun 2017 05:38:50 -0700
>> Guenter Roeck <linux@roeck-us.net> wrote:
>>
>>> Hi,
>>>
>>> I see the following build error in -next when building
>>> sh:rts7751r2dplus_defconfig.
>>>
>>> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: compiled for a
>>> big endian system and target is little endian
>>> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: uses instructions
>>> which are incompatible with instructions used in previous modules
>>> sh4-linux-ld: failed to merge target specific data of file
>>> arch/sh/kernel/vsyscall/vsyscall-dummy.o
>>> make[2]: *** [arch/sh/kernel/vsyscall/vsyscall-syms.o] Error 1
>>>
>>> Bisect points to 'sh: thin archives fix linking' as the culprit. Bisect
>>> log is attached.
>>> I tried with gcc 4.8.3 and 6.3.0, both built with buildroot for sh4eb.
>>
>>
>> Thanks for the report. In arch/sh/kernel/vsyscall/Makefile, the line:
>>
>> cmd_syscall_syms = $(LD) -r -o $@ -R $<
>>
>> Can you try adding $(LDFLAGS), e.g. change it to:
>>
>> cmd_syscall_syms = $(LD) $(LDFLAGS) -r -o $@ -R $<
>>
>
> That fixes the problem (including the missing symbols seen after reverting
> the offending patch).
Thanks!
Instead of adding $(LDFLAGS), how about using cmd_ld?
Please see line 260 of scripts/Makefile.lib
quiet_cmd_ld = LD $@
cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \
$(filter-out FORCE,$^) -o $@
We can reuse it and $(LDFLAGS) is already there.
I also noticed redundant "targets += gate-syms.o"
I see "obj-y += gate-syms.o" and $(obj-y) is automatically
added to "targets".
The following diff is my proposal.
If it is OK, I will squash it and update the thin-ar branch.
diff --git a/arch/ia64/kernel/Makefile.gate b/arch/ia64/kernel/Makefile.gate
index 8cd125a..263ab51 100644
--- a/arch/ia64/kernel/Makefile.gate
+++ b/arch/ia64/kernel/Makefile.gate
@@ -1,6 +1,6 @@
# The gate DSO image is built using a special linker script.
-targets += gate.so gate-syms.o gate-dummy.o
+targets += gate.so gate-dummy.o
obj-y += gate-syms.o
@@ -16,16 +16,13 @@ GATECFLAGS_gate.so = -shared -s
-Wl,-soname=linux-gate.so.1 \
$(obj)/gate.so: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)
-# create an object file to resolve gate symbols
-quiet_cmd_gate_syms = GATESYM $@
- cmd_gate_syms = $(LD) -r -o $@ -R $<
-
GATECFLAGS_gate-dummy.o = -r
$(obj)/gate-dummy.o: $(obj)/gate.lds $(obj)/gate.o FORCE
$(call if_changed,gate)
+LDFLAGS_gate-syms.o := -r -R
$(obj)/gate-syms.o: $(obj)/gate-dummy.o FORCE
- $(call if_changed,gate_syms)
+ $(call if_changed,ld)
# gate-data.o contains the gate DSO image as data in section .data..gate.
# We must build gate.so before we can assemble it.
diff --git a/arch/sh/kernel/vsyscall/Makefile b/arch/sh/kernel/vsyscall/Makefile
index 99685e5..6ab108f 100644
--- a/arch/sh/kernel/vsyscall/Makefile
+++ b/arch/sh/kernel/vsyscall/Makefile
@@ -31,8 +31,6 @@ $(obj)/vsyscall-dummy.o: $(src)/vsyscall.lds \
$(obj)/vsyscall-trapa.o $(obj)/vsyscall-note.o FORCE
$(call if_changed,syscall)
-quiet_cmd_syscall_syms = SYSCALL $@
- cmd_syscall_syms = $(LD) -r -o $@ -R $<
-
+LDFLAGS_vsyscall-syms.o := -r -R
$(obj)/vsyscall-syms.o: $(obj)/vsyscall-dummy.o FORCE
- $(call if_changed,syscall_syms)
+ $(call if_changed,ld)
diff --git a/arch/tile/kernel/vdso/Makefile b/arch/tile/kernel/vdso/Makefile
index c615ec0..0603ce6 100644
--- a/arch/tile/kernel/vdso/Makefile
+++ b/arch/tile/kernel/vdso/Makefile
@@ -55,11 +55,9 @@ SYSCFLAGS_vdso_dummy.o = -r
$(obj)/vdso-dummy.o: $(src)/vdso.lds $(obj)/vrt_sigreturn.o FORCE
$(call if_changed,vdsold)
-quiet_cmd_vdso_sym = VDSOSYM $@
- cmd_vdso_sym = $(LD) -r -o $@ -R $<
-
+LDFLAGS_vdso-syms.o := -r -R
$(obj)/vdso-syms.o: $(obj)/vdso-dummy.o FORCE
- $(call if_changed,vdso_sym)
+ $(call if_changed,ld)
# strip rule for the .so file
$(obj)/%.so: OBJCOPYFLAGS := -S
--
Best Regards
Masahiro Yamada
[toc] | [prev] | [next] | [standalone]
| From | Nicholas Piggin <npiggin@gmail.com> |
|---|---|
| Date | 2017-06-29 19:00 +0200 |
| Message-ID | <tXKXp-1AK-49@gated-at.bofh.it> |
| In reply to | #1677872 |
On Fri, 30 Jun 2017 00:36:42 +0900 Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > Hi. > > 2017-06-28 23:02 GMT+09:00 Guenter Roeck <linux@roeck-us.net>: > > On 06/28/2017 05:58 AM, Nicholas Piggin wrote: > >> > >> On Wed, 28 Jun 2017 05:38:50 -0700 > >> Guenter Roeck <linux@roeck-us.net> wrote: > >> > >>> Hi, > >>> > >>> I see the following build error in -next when building > >>> sh:rts7751r2dplus_defconfig. > >>> > >>> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: compiled for a > >>> big endian system and target is little endian > >>> sh4-linux-ld: arch/sh/kernel/vsyscall/vsyscall-dummy.o: uses instructions > >>> which are incompatible with instructions used in previous modules > >>> sh4-linux-ld: failed to merge target specific data of file > >>> arch/sh/kernel/vsyscall/vsyscall-dummy.o > >>> make[2]: *** [arch/sh/kernel/vsyscall/vsyscall-syms.o] Error 1 > >>> > >>> Bisect points to 'sh: thin archives fix linking' as the culprit. Bisect > >>> log is attached. > >>> I tried with gcc 4.8.3 and 6.3.0, both built with buildroot for sh4eb. > >> > >> > >> Thanks for the report. In arch/sh/kernel/vsyscall/Makefile, the line: > >> > >> cmd_syscall_syms = $(LD) -r -o $@ -R $< > >> > >> Can you try adding $(LDFLAGS), e.g. change it to: > >> > >> cmd_syscall_syms = $(LD) $(LDFLAGS) -r -o $@ -R $< > >> > > > > That fixes the problem (including the missing symbols seen after reverting > > the offending patch). > > > Thanks! > > Instead of adding $(LDFLAGS), how about using cmd_ld? > > > Please see line 260 of scripts/Makefile.lib > > quiet_cmd_ld = LD $@ > cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ > $(filter-out FORCE,$^) -o $@ > > We can reuse it and $(LDFLAGS) is already there. > > > > I also noticed redundant "targets += gate-syms.o" > I see "obj-y += gate-syms.o" and $(obj-y) is automatically > added to "targets". > > > The following diff is my proposal. > If it is OK, I will squash it and update the thin-ar branch. Yes, I think this is much better. Thank you! Please squash it in. Thanks, Nick
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web