CLIB
Zack Weinberg
zackw@Stanford.EDU
Thu May 3 22:47:00 GMT 2001
On Thu, May 03, 2001 at 06:19:42PM -0700, Zack Weinberg wrote:
> On Thu, May 03, 2001 at 03:09:04PM -0400, Richard Kenner wrote:
> > > (1) You sometimes need to specify additional libs manually.
> > > For example, to build a VMS cross-compiler from Dec Unix,
> > > you need to add -lm to CLIB.
> >
> > This really shouldn't be necessary. What causes it?
> >
> > I've never really been certain. I assume it has something to do with
> > floating-point emulation.
>
> It must cause some sort of undefined symbol error?
>
> I actually have access to a Dec Unix box, I'll try building a VMS
> cross-compiler and see what happens.
It seems that ldexp is in libm, not libc, on Dec Unix, and a
cross-compiler to VMS wants to use the system ldexp. This is because
/* no floating emulation. */
#undef REAL_ARITHMETIC
is in config/alpha/vms.h. I don't know why that would be done. (Is
it ever correct not to define REAL_ARITHMETIC these days?)
Taking it out *seems* to produce a functional cc1 binary - in fact,
comparing assembly dumps from compiling the HOST_FLOAT_FORMAT tester
program from aclocal.m4, it looks like the version with
REAL_ARITHMETIC on is more correct than the one without:
--- test.s.IEEE,RA Thu May 3 22:02:35 2001
+++ test.s.IEEE,lm Thu May 3 22:23:39 2001
@@ -6,19 +6,19 @@
.align 3
table:
.ascii "\12format:"
- .quad 0x40 40 49 45 45 45 46 50
+ .quad 0x045454650
.ascii ":tamrof\12"
.ascii "\12format:"
- .quad 0x43c88ccbeded8e8c
+ .quad 0x0eded8e8c
.ascii ":tamrof\12"
.ascii "\12format:"
- .quad 0x3c23a28111405a31
+ .quad 0x011405a31
.ascii ":tamrof\12"
.ascii "\12format:"
- .quad 0x4210935211561194
+ .quad 0x011561194
.ascii ":tamrof\12"
.ascii "\12format:"
- .quad 0xc2285a9918bcf8db
+ .quad 0x018bcf8db
.ascii ":tamrof\12"
.rdata
.align 3
-mfloat-vax has no effect on the content of this file in either mode.
Either way, cc1 crashes in ASM_FILE_END:
Program received signal SIGSEGV, Segmentation fault.
0x1201eaf0c in splay_tree_foreach (sp=0x0,
fn=0x120259880 <alpha_write_one_linkage>, data=0x3ffc0080348)
at splay-tree.c:448
448 return splay_tree_foreach_helper (sp, sp->root, fn, data);
(gdb) bt
#0 0x1201eaf0c in splay_tree_foreach (sp=0x0,
fn=0x120259880 <alpha_write_one_linkage>, data=0x3ffc0080348)
at splay-tree.c:448
#1 0x120259a20 in alpha_write_linkage (stream=0x3ffc0080348)
at ../../gcc/gcc/config/alpha/alpha.c:6511
#2 0x1200d9ca4 in compile_file (name=0x14012d8da "test.c")
at ../../gcc/gcc/toplev.c:2421
#3 0x1200e1cec in toplev_main (argc=2, argv=0x11ffff908)
at ../../gcc/gcc/toplev.c:4946
#4 0x1200d1c08 in main (argc=2, argv=0x11ffff908) at ../../gcc/gcc/main.c:34
(gdb) frame 1
#1 0x120259a20 in alpha_write_linkage (stream=0x3ffc0080348)
at ../../gcc/gcc/config/alpha/alpha.c:6511
6511 splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
(gdb) l
6506 alpha_write_linkage (stream)
6507 FILE *stream;
6508 {
6509 readonly_section ();
6510 fprintf (stream, "\t.align 3\n");
6511 splay_tree_foreach (alpha_links, alpha_write_one_linkage, stream);
6512 }
6513
6514 #else
6515
(gdb) p alpha_links
$1 = 0x0
$ ./cc1 --version
GNU C version 3.1 20010503 (experimental) (OpenVMS/Alpha)
compiled by GNU C version 2.95.2 19991024 (release).
GNU CPP version 3.1 20010503 (experimental) (cpplib) (OpenVMS/Alpha)
zw
More information about the Gcc
mailing list