[Should we still have bug-gcc in the CC list?]
[Warning: It is late at night here and I had a long day]
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-patches(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.
Building XEmacs with g++ is definitely Martin's thing not mine,
however I do not see some of the symptoms you see.
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"
First off, -nostdlib doesn't turn off automatic linking with crt1
in
all versions of gcc. You need -nostartfiles too.
Are you sure? I would call it a bug then. The phrase
`-nostdlib'
Do not use the standard system startup files or libraries when
linking. No startup files and only the libraries you specify will
be passed to the linker.
Is in gcc.info from gcc 2.6, egcs 1.1.2 and gcc 2.95
Anyway. I hate that stuff too (because it makes it harder to enable
profiling). However it is there for a reason, so it must have been
necessary at least in the past on some platform.
Jan
P.S. Martin. I think we need to have "--with-ordinary-link" (which
already 95% there it seems)