The following fixes the GNU Mach 1 branch so that it can compile with recent versions of gcc (>3.x) and binutils (>2.14)
2004-01-15 Alfred M. Szmidt <[EMAIL PROTECTED] * linux/src/drivers/scsi/53c7,8xx.h (patch_dsa_32): Don't use token paste operator (##). * linux/dev/include/asm-i386/string.h (memscan): Don't use multi-line string literals for asm(). * linux/dev/include/asm-i386/segment.h (__generic_memcpy_tofs) (__generic_memcpy_fromfs): Likewise. * i386/i386/proc_reg.h (flush_instr_queue): Likewise. * i386/i386/gdt.c (gdt_init): Likewise. * Makefile.in (kernel-undef): Match new output format form nm (binutils) 2.14.x. Index: Makefile.in =================================================================== RCS file: /cvsroot/hurd/gnumach/Makefile.in,v retrieving revision 1.31 diff -u -r1.31 Makefile.in --- Makefile.in 23 May 2002 00:06:22 -0000 1.31 +++ Makefile.in 14 Jan 2004 19:28:30 -0000 @@ -312,7 +312,7 @@ kernel.o: $(objfiles) # kernel.a $(LD) -r -o $@ $^ kernel-undef: kernel.o - $(NM) -u $< | sed 's/^_*//' | sort -u > $@ + $(NM) -u $< | sed 's/ U *//;s/^_*//' | sort -u > $@ kernel-undef-bad: kernel-undef Makefile sed '$(foreach r,$(clib-routines),/^$r$$/d;)' $< > $@ clib-routines.o: kernel-undef kernel-undef-bad Index: i386/i386/gdt.c =================================================================== RCS file: /cvsroot/hurd/gnumach/i386/i386/gdt.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 gdt.c --- i386/i386/gdt.c 25 Feb 1997 21:27:09 -0000 1.1.1.1 +++ i386/i386/gdt.c 14 Jan 2004 19:28:30 -0000 @@ -72,17 +72,16 @@ We must load ds and es with 0 before loading them with KERNEL_DS because some processors will "optimize out" the loads if the previous selector values happen to be the same. */ - asm volatile(" - ljmp %0,$1f - 1: - movw %w2,%%ds - movw %w2,%%es - movw %w2,%%fs - movw %w2,%%gs - - movw %w1,%%ds - movw %w1,%%es - movw %w1,%%ss - " : : "i" (KERNEL_CS), "r" (KERNEL_DS), "r" (0)); + asm volatile("ljmp %0,$1f\n" + "1:\n" + "movw %w2,%%ds\n" + "movw %w2,%%es\n" + "movw %w2,%%fs\n" + "movw %w2,%%gs\n" + + "movw %w1,%%ds\n" + "movw %w1,%%es\n" + "movw %w1,%%ss\n" + : : "i" (KERNEL_CS), "r" (KERNEL_DS), "r" (0)); } Index: i386/i386/proc_reg.h =================================================================== RCS file: /cvsroot/hurd/gnumach/i386/i386/Attic/proc_reg.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 proc_reg.h --- i386/i386/proc_reg.h 25 Feb 1997 21:27:11 -0000 1.1.1.1 +++ i386/i386/proc_reg.h 14 Jan 2004 19:28:32 -0000 @@ -139,10 +139,8 @@ but it's often used immediately after setting one, to flush the instruction queue. */ #define flush_instr_queue() \ - asm(" - jmp 0f - 0: - ") + asm("jmp 0f\n" \ + "0:\n") #endif /* __GNUC__ */ #endif /* ASSEMBLER */ Index: linux/dev/include/asm-i386/segment.h =================================================================== RCS file: /cvsroot/hurd/gnumach/linux/dev/include/asm-i386/Attic/segment.h,v retrieving revision 1.2 diff -u -r1.2 segment.h --- linux/dev/include/asm-i386/segment.h 23 Jul 2000 00:34:12 -0000 1.2 +++ linux/dev/include/asm-i386/segment.h 14 Jan 2004 19:28:33 -0000 @@ -96,24 +96,24 @@ static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n) { __asm__ volatile - (" cld - push %%es - push %%fs - cmpl $3,%0 - pop %%es - jbe 1f - movl %%edi,%%ecx - negl %%ecx - andl $3,%%ecx - subl %%ecx,%0 - rep; movsb - movl %0,%%ecx - shrl $2,%%ecx - rep; movsl - andl $3,%0 - 1: movl %0,%%ecx - rep; movsb - pop %%es" + ("cld\n" + "push %%es\n" + "push %%fs\n" + "cmpl $3,%0\n" + "pop %%es\n" + "jbe 1f\n" + "movl %%edi,%%ecx\n" + "negl %%ecx\n" + "andl $3,%%ecx\n" + "subl %%ecx,%0\n" + "rep; movsb\n" + "movl %0,%%ecx\n" + "shrl $2,%%ecx\n" + "rep; movsl\n" + "andl $3,%0\n" + "1: movl %0,%%ecx\n" + "rep; movsb\n" + "pop %%es\n" :"=abd" (n) :"0" (n),"D" ((long) to),"S" ((long) from) :"cx","di","si"); @@ -184,24 +184,24 @@ static inline void __generic_memcpy_fromfs(void * to, const void * from, unsigned long n) { - __asm__ volatile - (" cld - cmpl $3,%0 - jbe 1f - movl %%edi,%%ecx - negl %%ecx - andl $3,%%ecx - subl %%ecx,%0 - fs; rep; movsb - movl %0,%%ecx - shrl $2,%%ecx - fs; rep; movsl - andl $3,%0 - 1: movl %0,%%ecx - fs; rep; movsb" - :"=abd" (n) - :"0" (n),"D" ((long) to),"S" ((long) from) - :"cx","di","si", "memory"); + __asm__ volatile + ("cld\n" + "cmpl $3,%0\n" + "jbe 1f\n" + "movl %%edi,%%ecx\n" + "negl %%ecx\n" + "andl $3,%%ecx\n" + "subl %%ecx,%0\n" + "fs; rep; movsb\n" + "movl %0,%%ecx\n" + "shrl $2,%%ecx\n" + "fs; rep; movsl\n" + "andl $3,%0\n" + "1:movl %0,%%ecx\n" + "fs; rep; movsb\n" + :"=abd" (n) + :"0" (n),"D" ((long) to),"S" ((long) from) + :"cx","di","si", "memory"); } static inline void __constant_memcpy_fromfs(void * to, const void * from, unsigned long n) Index: linux/dev/include/asm-i386/string.h =================================================================== RCS file: /cvsroot/hurd/gnumach/linux/dev/include/asm-i386/Attic/string.h,v retrieving revision 1.2 diff -u -r1.2 string.h --- linux/dev/include/asm-i386/string.h 23 Jul 2000 00:34:12 -0000 1.2 +++ linux/dev/include/asm-i386/string.h 14 Jan 2004 19:28:33 -0000 @@ -473,11 +473,11 @@ { if (!size) return addr; - __asm__("cld - repnz; scasb - jnz 1f - dec %%edi -1: " + __asm__("cld\n" + "repnz; scasb\n" + "jnz 1f\n" + "dec %%edi\n" + "1:\n" : "=D" (addr), "=c" (size) : "0" (addr), "1" (size), "a" (c)); return addr; Index: linux/src/drivers/scsi/53c7,8xx.h =================================================================== RCS file: /cvsroot/hurd/gnumach/linux/src/drivers/scsi/Attic/53c7,8xx.h,v retrieving revision 1.1 diff -u -r1.1 53c7,8xx.h --- linux/src/drivers/scsi/53c7,8xx.h 26 Apr 1999 05:53:41 -0000 1.1 +++ linux/src/drivers/scsi/53c7,8xx.h 14 Jan 2004 19:28:44 -0000 @@ -1569,11 +1569,11 @@ /* Patch field in dsa structure (assignment should be +=?) */ #define patch_dsa_32(dsa, symbol, word, value) \ { \ - (dsa)[(hostdata->##symbol - hostdata->dsa_start) / sizeof(u32) \ + (dsa)[(hostdata->symbol - hostdata->dsa_start) / sizeof(u32) \ + (word)] = (value); \ if (hostdata->options & OPTION_DEBUG_DSA) \ printk("scsi : dsa %s symbol %s(%d) word %d now 0x%x\n", \ - #dsa, #symbol, hostdata->##symbol, \ + #dsa, #symbol, hostdata->symbol, \ (word), (u32) (value)); \ } Index: linux/src/include/asm-i386/floppy.h =================================================================== RCS file: /cvsroot/hurd/gnumach/linux/src/include/asm-i386/Attic/floppy.h,v retrieving revision 1.1 diff -u -r1.1 floppy.h --- linux/src/include/asm-i386/floppy.h 26 Apr 1999 05:55:45 -0000 1.1 +++ linux/src/include/asm-i386/floppy.h 14 Jan 2004 19:28:44 -0000 @@ -65,36 +65,35 @@ #endif #ifndef NO_FLOPPY_ASSEMBLER - __asm__ ( - "testl %1,%1 - je 3f -1: inb %w4,%b0 - andb $160,%b0 - cmpb $160,%b0 - jne 2f - incw %w4 - testl %3,%3 - jne 4f - inb %w4,%b0 - movb %0,(%2) - jmp 5f -4: movb (%2),%0 - outb %b0,%w4 -5: decw %w4 - outb %0,$0x80 - decl %1 - incl %2 - testl %1,%1 - jne 1b -3: inb %w4,%b0 -2: " - : "=a" ((char) st), - "=c" ((long) virtual_dma_count), - "=S" ((long) virtual_dma_addr) - : "b" ((long) virtual_dma_mode), - "d" ((short) virtual_dma_port+4), - "1" ((long) virtual_dma_count), - "2" ((long) virtual_dma_addr)); + __asm__ ("testl %1,%1\n" + "je 3f\n" + "1: inb %w4,%b0\n" + "andb $160,%b0\n" + "cmpb $160,%b0\n" + "jne 2f\n" + "incw %w4\n" + "testl %3,%3\n" + "jne 4f\n" + "inb %w4,%b0\n" + "movb %0,(%2)\n" + "jmp 5f\n" + "4: movb (%2),%0\n" + "outb %b0,%w4\n" + "5: decw %w4\n" + "outb %0,$0x80\n" + "decl %1\n" + "incl %2\n" + "testl %1,%1\n" + "jne 1b\n" + "3: inb %w4,%b0\n" + "2:\n" + : "=a" ((char) st), + "=c" ((long) virtual_dma_count), + "=S" ((long) virtual_dma_addr) + : "b" ((long) virtual_dma_mode), + "d" ((short) virtual_dma_port+4), + "1" ((long) virtual_dma_count), + "2" ((long) virtual_dma_addr)); #else { register int lcount; _______________________________________________ Bug-hurd mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-hurd