>>>> "ZW" == Zack Weinberg
<zack(a)wolery.cumb.org> writes:
ZW> On Sat, Feb 05, 2000 at 01:48:20AM +0100, Jan Vroonhof wrote:
> Zack Weinberg <zack(a)wolery.cumb.org> writes:
> > A lot of the code in the lib-src directory needed to be worked over
> > before it would compile. I can send the patch if anyone cares.
>
> Please send the patch to xemacs-review(a)xemacs.org anyway, if it isn't
> much trouble. I am not sure whether it would be possible to apply it
> all (at least some of the lib-src stuff is third part maintained). It
> would be a waste to loose any work that you have already done.
ZW> I shall do so under separate cover.
ZW> Also, I recompiled with g++ in current CVS (roughly the 20000204
ZW> snapshot), and both temacs and the xemacs it dumps work correctly
ZW> (well, I didn't do anything with xemacs except start it up).
ZW> Given that Martin was running temacs under the debugger in batch
ZW> mode, I think the actual miscompilation was that message_internal was
ZW> calling echo_area_append when it should have been calling
ZW> write_string_to_stdio_stream.
ZW> Odds are that the bug was fixed by this patch:
ZW> 2000-02-04 Richard Henderson <rth(a)cygnus.com>
ZW> * function.c (diddle_return_value): Rework to use a callback function.
ZW> Use current_function_return_rtx if it's been set up.
ZW> (do_clobber_return_reg, clobber_return_register): New.
ZW> (do_use_return_reg, use_return_register): New.
ZW> (expand_function_end): Use them.
ZW> * stmt.c (expand_null_return): Likewise.
ZW> * function.h: Declare them.
ZW> * flow.c (mark_regs_live_at_end): Use diddle_return_value.
ZW> (mark_reg): Change arguments as appropriate for callback.
ZW> * integrate.c (expand_inline_function): Revert 19 Jan change.
I will test again when the next snapshot is released. That patch sure
looks close.
> > The makefile attempts to link temacs by hand and gets it
horribly
> > wrong, causing the built temacs to crash inside libc startup code.
> >
> > You're doing something like gcc -nostdlib pre-crt0.o /usr/lib/crt1.o
> > /usr/lib/crti.o <objects> <X libraries> -ldl -lgcc /usr/lib/crtn.o
>
> For me the link looks like (plain Redhat 6.0 with egcs 1.1.2)
>
> gcc -nostdlib -L/usr/X11R6/lib -o temacs pre-crt0.o /usr/lib/crt1.o
/usr/lib/crti.o <objects> ../lwlib/liblw.a -lXaw3d -ltiff -lpng -ljpeg -lz
-lcompface -lXpm -lXmu -lXt -lXext -lX11 -lSM -lICE -ldl -ldb -lgpm -lncurses -L/usr/lib
-lesd -laudiofile -lm -lm -lgcc -lc -lgcc /usr/lib/crtn.o `gcc -print-libgcc-file-name`
>
> Note the ugly "-lm -lm -lgcc -lc -lgcc" part. I am fairly sure the -lc
> comes explicitly from
>
> dnl Non-ordinary link usually requires -lc
> test "$ordinary_link" = "no" -a -z "$libs_standard"
&& libs_standard="-lc"
Sometime in the past, I changed linking on Linux to use
ORDINARY_LINK. We then had a patch-of-war, with me and Steve Baur
reversing each other's changes. He prevailed.
I recommend just leaving the current dumping mechanism. Olivier
Galibert's new portable dumper promises to let us use a consistent
mechanism across systems that doesn't involve calling ld directly or
knowing the guts of the object file format on the system.
ZW> Hrm. ORDINARY_LINK should be safe for LINUX_ELF, provided you define
ZW> DATA_START as well... My suggested patch follows.
Zack, I like your spirit, and I like this kind of patch, and I've
created a similar one myself, but I'll veto it anyways, because we
have a better way out of this quagmire.
Martin