Subject: Re: Shared libraries re-enabled for VAX
To: Matt Thomas <matt@3am-software.com>
From: Johnny Billquist <bqt@softjar.se>
List: port-vax
Date: 04/03/2007 18:45:45
Matt Thomas wrote:
> 
> I committed a fix for this.

Wonderful, and yes. Now cross compilation works. Next problem is native 
compiles.

A short test program:

---
#include <stdio.h>
#include <math.h>

main()
{
   double x,y,z;

   x = 0.5;
   y = log(x);
   z = sqrt(x);
   printf("log(%f) = %f\n", x, y);
   printf("sqrt(%f) = %f\n", x, z);
}
---

The resulting assembler file:
---
#NO_APP
         .file   "test.c"
         .section        .rodata
.LC0:
         .string "log(%f) = %f\n"
.LC1:
         .string "sqrt(%f) = %f\n"
         .text
         .align 1
.globl main
         .type   main, @function
main:
         .word 0x0
         subl2 $28,%sp
         movd $0d5.0e-1,-28(%fp)
         movd -28(%fp),-(%sp)
         calls $2,log
         movd %r0,-20(%fp)
         movd -28(%fp),-(%sp)
         calls $2,sqrt
         movd %r0,-12(%fp)
         movd -20(%fp),-(%sp)
         movd -28(%fp),-(%sp)
         pushab .LC0
         calls $5,printf
         movd -12(%fp),-(%sp)
         movd -28(%fp),-(%sp)
         pushab .LC1
         calls $5,printf
         ret
         .size   main, .-main
         .ident  "GCC: (GNU) 4.1.2 20070110 prerelease (NetBSD nb1 
20070110)"
---

And the result when compiling:
---
Gnat:bqt/src> cc test.c
/var/tmp//ccjYzg1e.s: Assembler messages:
/var/tmp//ccjYzg1e.s:14: Warning: Symbol used as immediate operand in 
PIC mode.
/var/tmp//ccjYzg1e.s:15: Warning: Symbol used as immediate operand in 
PIC mode.
/var/tmp//ccjYzg1e.s:17: Warning: Symbol used as immediate operand in 
PIC mode.
/var/tmp//ccjYzg1e.s:20: Warning: Symbol used as immediate operand in 
PIC mode.
/var/tmp//ccjYzg1e.s:24: Fatal error: Junk at end of expression "LC0"
---

Also, probably very unrelated. A kernel as built today is not useable. 
It goes up to about 100% system time as soon as I copy anything from an 
NFS mounted disk to a local disk on my VAX.
This is 4.99.16. I have an older build (4.99.15) where this don't 
happen, so something changed recently. But like I said, I don't think 
that is related to GCC.

	Johnny