Skip to contentSkip to conversation

fix gcc 3.x issue

PATCH Applied Dave Hansen 2 participants 2 messages Jul 2, 2007 – Jul 3, 2007 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix gcc 3.x issue

I've been getting compile errors lately with gcc 3.x compiling kvm 27 and 28:

gcc -I /home/dave/kvm/kvm-28/kernel/include -MMD -MF test/.access.d -g -fomit-frame-pointer -Wall -m64 -nostdlib -o test/access.flat -Wl,-T,flat.lds test/access.o test/cstart64.o test/printf.o test/print.o test/smp.o
test/print.o: In function `print':
/home/dave/kvm/kvm-28/user/test/print.S:19: undefined reference to `PSEUDO_SERIAL_PORT'
collect2: ld returned 1 exit status

Looking at 'gcc -E' output, you can see the problem:

...
.globl print
print:
push %rax
push %rsi
push %rdx

mov %rdi, %rsi
mov $PSEUDO_SERIAL_PORT, %edx

The PSEUDO_SERIAL_PORT macro isn't getting expanded for some reason. However, it works in gcc 4.1. The following patch fixes it for me.

user/test/print.S renamed from user/test/print.S.orig +1 -1
@@ -16,7 +16,7 @@
 	push %rdx
 
 	mov %rdi, %rsi
-	mov $PSEUDO_SERIAL_PORT, %edx
+	mov $(PSEUDO_SERIAL_PORT), %edx
 
 putchar:
 	cmpb $0, (%rsi)

-- Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Applied
#1 lore raw
Quoted 10 lines · Dave Hansen

I've been getting compile errors lately with gcc 3.x compiling kvm 27 and 28:

gcc -I /home/dave/kvm/kvm-28/kernel/include -MMD -MF test/.access.d -g -fomit-frame-pointer -Wall -m64 -nostdlib -o test/access.flat -Wl,-T,flat.lds test/access.o test/cstart64.o test/printf.o test/print.o test/smp.o
test/print.o: In function `print':
/home/dave/kvm/kvm-28/user/test/print.S:19: undefined reference to `PSEUDO_SERIAL_PORT'
collect2: ld returned 1 exit status

Applied, thanks.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/