Skip to contentSkip to conversation

Use $(LD) -V for NEW_GAS check [4/4]

PATCH Applied Joshua Kwan 2 participants 10 messages May 6, 2004 – May 9, 2004 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use $(LD) -V for NEW_GAS check [4/4]

patch 4: use $(LD) -V for NEW_GAS check.

This bug crept up because I have a bi-architecture (32/64) binutils, and unreasonable defaults sent my build to hell.

Signature · 1 line
Joshua Kwan
arch/sparc/Makefile renamed from arch/sparc/Makefile~ +1 -1
@@ -16,7 +16,7 @@
 # debugging of the kernel to get the proper debugging information.
 
 IS_EGCS := $(shell if $(CC) -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; )
-NEW_GAS := $(shell if $(LD) --version 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
+NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
 
 ifeq ($(NEW_GAS),y)
 AS              := $(AS) -32
#1 lore raw
Quoted 4 lines · On Thu, 6 May 2004 15:40:26 -0700 [email protected] (Joshua Kwan) wrote:

patch 4: use $(LD) -V for NEW_GAS check.

This bug crept up because I have a bi-architecture (32/64) binutils, and unreasonable defaults sent my build to hell.

Applied, how did this ever work? '-V' is what you need to use regardless of how binutils was configured.

#2 lore raw
In reply to Joshua Kwan
Quoted 5 lines · David S. Miller
Quoted 2 lines

This bug crept up because I have a bi-architecture (32/64) binutils, and unreasonable defaults sent my build to hell.

Applied, how did this ever work? '-V' is what you need to use regardless of how binutils was configured.

I have no idea. Isn't the bug in 2.6 as well?

FYI, on my i386 box, without this fix, it would link sparc32 kernels correctly, but die when linking together 64-bit .o files. So I guess 'sparc-linux-ld' was really 'sparc-linux-ld -m elf32_sparc'. Perhaps the binutils on a real sparc machine make the right decision based on the current system architecture?

Signature · 1 line
Joshua Kwan
#3 lore raw
In reply to Joshua Kwan
Quoted 8 lines · On Fri, 7 May 2004 16:33:54 -0700 [email protected] (Joshua Kwan) wrote:
Quoted 5 lines · David S. Miller
Quoted 2 lines

This bug crept up because I have a bi-architecture (32/64) binutils, and unreasonable defaults sent my build to hell.

Applied, how did this ever work? '-V' is what you need to use regardless of how binutils was configured.

I have no idea. Isn't the bug in 2.6 as well?

I was about to ask you to make and test 2.6.x versions of your fixed.

#4 lore raw
In reply to Joshua Kwan
Quoted 2 lines · David S. Miller

I was about to ask you to make and test 2.6.x versions of your fixed.

These fixes already made it into 2.6, it seems:
- source "drivers/i2c/Kconfig" for arch/sparc64
- use $(LD) -V
- pgalloc.h (which you made, heh)

so the only other fix is for the arch/sparc64/Makefile CC definition; diff attached. However, it does not seem to build, for unrelated reasons:

sparc-linux-gcc -Wp,-MD,init/.main.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow -ffixed-g4 -fcall-used-g5 -fcall-used-g7 -Wno-sign-compare -Wa,--undeclared-regs -finline-limit=100000 -O2 -fomit-frame-pointer -DKBUILD_BASENAME=main -DKBUILD_MODNAME=main -c -o init/.tmp_main.o init/main.c
In file included from include/linux/unistd.h:7,

                 from init/main.c:44:

include/asm/unistd.h: In function `setsid':
include/asm/unistd.h:433: error: parse error before '}' token include/asm/unistd.h:434: error: redeclaration of __g1' include/asm/unistd.h:433: error: __g1' previously declared here include/asm/unistd.h:434: error: `fd' undeclared (first use in this function) include/asm/unistd.h:434: error: (Each undeclared identifier is reported only once (and so on)

include/asm is indeed symlinked to include/asm-sparc64, FWIW.

Signature · 1 line
Joshua Kwan
arch/sparc64/Makefile +1 -1
@@ -10,7 +10,7 @@
 
 AFLAGS_vmlinux.lds.o += -Usparc
 
-CC		:= $(shell if gcc -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo gcc; else echo sparc64-linux-gcc; fi )
+CC		:= $(shell if $(CC) -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo $(CC); else echo sparc64-linux-gcc; fi )
 
 NEW_GCC := $(shell if $(CC) -m64 -mcmodel=medlow -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo y; else echo n; fi; )
 NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then echo y; else echo n; fi)
#5 lore raw
In reply to Joshua Kwan
Quoted 2 lines · On Fri, 7 May 2004 18:18:16 -0700 [email protected] (Joshua Kwan) wrote:

However, it does not seem to build, for unrelated
reasons:

It is using "-m64" so a sparc64 build, but for some reason the include/asm symlink is being set to the sparc32 header directory include/asm-sparc instead of the correct include/asm-sparc64

Quoted 1 line

include/asm is indeed symlinked to include/asm-sparc64, FWIW.

I really don't think so, line 433 is only a place where a compile error like that can occur in the sparc32 unistd.h not the sparc64 one.

#6 lore raw
In reply to Joshua Kwan
Quoted 3 lines · David S. Miller

It is using "-m64" so a sparc64 build, but for some reason the include/asm symlink is being set to the sparc32 header directory include/asm-sparc instead of the correct include/asm-sparc64

Line 433 in include/asm-sparc/unistd.h is a comment. Remember, I'm talking 2.6 here.

Quoted 5 lines
Quoted 1 line

include/asm is indeed symlinked to include/asm-sparc64, FWIW.

I really don't think so, line 433 is only a place where a compile error like that can occur in the sparc32 unistd.h not the sparc64 one.

We-ell, ok. Let's see then:

$ make ARCH=sparc64 CROSS_COMPILE=sparc-linux- mrproper defconfig image
[...]
(Failure ensues)
$ ls -l include/asm
lrwxrwxrwx    1 joshk    joshk          11 2004-05-08 14:02 include/asm -> asm-sparc64

I'm absolutely positive it is using that directory and that unistd.h.

Signature · 1 line
Joshua Kwan
#7 lore raw
In reply to Joshua Kwan
Quoted 2 lines · On Sat, 8 May 2004 14:04:43 -0700 [email protected] (Joshua Kwan) wrote:

Line 433 in include/asm-sparc/unistd.h is a comment. Remember, I'm talking 2.6 here.

No, it's part of a macro definition in 2.6.x:

#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \
	  type5,arg5) \

type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \
{ \
long __res; \
register long __g1 __asm__ ("g1") = __NR_##name; \
register long __o0 __asm__ ("o0") = (long)(arg1); \
register long __o1 __asm__ ("o1") = (long)(arg2); \
register long __o2 __asm__ ("o2") = (long)(arg3); \
register long __o3 __asm__ ("o3") = (long)(arg4); \
register long __o4 __asm__ ("o4") = (long)(arg5); \

__asm__ __volatile__ ("t 0x10\n\t" \
		      "bcc 1f\n\t" \
		      "mov %%o0, %0\n\t" \
		      "sub %%g0, %%o0, %0\n\t" \
		      "1:\n\t" \
		      : "=r" (__res), "=&r" (__o0) \
		      : "1" (__o0), "r" (__o1), "r" (__o2), "r" (__o3), "r" (__o4), "r" (__g1) \
		      : "cc"); \
if (__res < -255 || __res>=0) \
	return (type) __res; \

errno = -__res; \
return -1; \
}
^^^^^ this is line 433

#8 lore raw
In reply to Joshua Kwan
Quoted 4 lines · David S. Miller

errno = -__res; \
return -1; \
}
^^^^^ this is line 433

Er, well - I'm using 2.6.6-rc3-mm2, line 433 of asm-sparc64/unistd.h contains:

static __inline__ _syscall0(pid_t,setsid)

Well, fancy that, 2.6.6-rc3 stock does build... good to hear, huh? :)

Either way it's your changes that messed it up, so now consider this a report against the changes made in 2.6.6-rc3-mm2. :D

Signature · 1 line
Joshua Kwan
#9 lore raw
In reply to Joshua Kwan
Quoted 2 lines · On Sat, 8 May 2004 17:49:15 -0700 [email protected] (Joshua Kwan) wrote:

Either way it's your changes that messed it up, so now consider this a report against the changes made in 2.6.6-rc3-mm2. :D

I didn't make the changes you mention to the sparc port, someone else added that sparc changes to the -mm patch series not me :-)

Since Andrew Morton ([email protected]) maintains that patch set, probably you should send him a note about it.