Mailing List Archive

Emacs in X with toolkits?
Hi,

I've been trying to make Emacs work in X on my SGI Octane. KDE works, Emacs in
console mode works, and Emacs in X without toolkits also works, but if I
compile Emacs with either Xaw3d or Motif I get segfaults at startup.

Looking around a bit, I see this problem reported as early as December 2001[1]
and as late as April 2005[2]. Other reports (with backtraces from GDB) are at
[3] and [4].

The Debian bug report[1] claims that this is due to a bug in a new version of
binutils and that it was fixed in January 2002. I have not found any details
about this binutils bug.

Does anyone have any idea what's going on?

1: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=126918
2: http://lists.debian.org/debian-mips/2005/04/msg00036.html
3: http://lists.debian.org/debian-mips/2003/03/msg00038.html
4: http://lists.debian.org/debian-mips/2002/01/msg00075.html

--
Karl-Johan "Creideiki" Karlsson
Re: Emacs in X with toolkits? [ In reply to ]
> I've been trying to make Emacs work in X on my SGI Octane. KDE works, Emacs in
> console mode works, and Emacs in X without toolkits also works, but if I
> compile Emacs with either Xaw3d or Motif I get segfaults at startup.
>
> Looking around a bit, I see this problem reported as early as December 2001[1]
> and as late as April 2005[2]. Other reports (with backtraces from GDB) are at
> [3] and [4].
>
> The Debian bug report[1] claims that this is due to a bug in a new version of
> binutils and that it was fixed in January 2002. I have not found any details
> about this binutils bug.
>
> Does anyone have any idea what's going on?

Short answer: no idea. We should have sufficiently recent versions of
binutils. If you aren't already, try using binutils-2.16.1. I don't
use emacs (and I don't really care to try), so I've totally neglected to
bother testing it with X.

Being brutally honest, emacs doesn't even have mips keywords, which
tells me nobody has ever bothered to test, which probably means nobody
in the history of gentoo/mips has ever cared about it until you came
along. If what you say is true, we might even have to add -mips to the
KEYWORDS, since there is no way in hell I'm going to use.mask X, Xaw3d,
and motif just because they break emacs. If you find a fix, feel free
to file a bug report attach the fix, and assign it to us.

-Steve
--
gentoo-mips@gentoo.org mailing list
Re: Emacs in X with toolkits? [ In reply to ]
On Thursday 24 November 2005 19.23, Stephen P. Becker wrote:
> If you aren't already, try using binutils-2.16.1.

Now that's interesting. I built the system using binutils-2.16.90.0.3 (~mips
at the time), then downgraded to 2.16.1 to solve bug #112809. Now, Emacs
won't even emerge - the temacs binary (seems to be a semi-standalone elisp
compiler used to bootstrap Emacs) segfaults immediately upon start, and GDB
only says:

(gdb) run -batch -l loadup dump
Starting program: /var/tmp/portage/emacs-21.4-r1/work/emacs-21.4/src/temacs
-batch -l loadup dump
Warning:
Cannot insert breakpoint -2.
Error accessing memory address 0x266f3: Input/output error.

Binutils-2.16.91.0.2 gives the same error, but with 2.16.90.0.3 at least Emacs
builds, even though it doesn't run in X. Perhaps rebuilding the entire system
with 2.16.1 or 2.16.91.0.2 would make Emacs build?

> If you find a fix, feel free
> to file a bug report attach the fix, and assign it to us.

I'll try.

--
Karl-Johan "Creideiki" Karlsson
Re: Emacs in X with toolkits? [ In reply to ]
Karl-Johan 'Creideiki' Karlsson wrote:
> On Thursday 24 November 2005 19.23, Stephen P. Becker wrote:
>> If you aren't already, try using binutils-2.16.1.
>
> Now that's interesting. I built the system using binutils-2.16.90.0.3 (~mips
> at the time), then downgraded to 2.16.1 to solve bug #112809. Now, Emacs
> won't even emerge - the temacs binary (seems to be a semi-standalone elisp
> compiler used to bootstrap Emacs) segfaults immediately upon start, and GDB
> only says:
>
> (gdb) run -batch -l loadup dump
> Starting program: /var/tmp/portage/emacs-21.4-r1/work/emacs-21.4/src/temacs
> -batch -l loadup dump
> Warning:
> Cannot insert breakpoint -2.
> Error accessing memory address 0x266f3: Input/output error.
>
> Binutils-2.16.91.0.2 gives the same error, but with 2.16.90.0.3 at least Emacs
> builds, even though it doesn't run in X. Perhaps rebuilding the entire system
> with 2.16.1 or 2.16.91.0.2 would make Emacs build?

This tells me it's some super-funky binutils b0rkage going on. Try
binutils-2.16.91.0.3 and 2.16.91.0.4 if you can (they're not keyworded, so
you'll have to employ an overlay or the files in /etc/portage to unmask them).
I know that 2.16.91.0.3 acts funny on glibc (iirc), but I haven't tested
2.16.91.0.4 on anything.

That all said, looks like a binutils thing, which are usually tricky to track
down. This will probably mean that emacs will remain unkeyworded for mips until
the bug is ever found and nailed.


--Kumba

--
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands
do them because they must, while the eyes of the great are elsewhere." --Elrond
--
gentoo-mips@gentoo.org mailing list
Re: Emacs in X with toolkits? [ In reply to ]
On Friday 25 November 2005 04.42, Kumba wrote:
> Try binutils-2.16.91.0.3 and 2.16.91.0.4 if you can (they're not keyworded,
> so you'll have to employ an overlay or the files in /etc/portage to unmask
> them). I know that 2.16.91.0.3 acts funny on glibc (iirc), but I haven't
> tested 2.16.91.0.4 on anything.

The temacs binary built with either of them breaks in the same way as before.
I'm currently rebuilding glibc and GCC with binutils-2.16.91.0.4, since:
1) The system is built with binutils-2.16.90.0.3.
2) Emacs built with binutils-2.16.90.0.3 works (sort of).
3) Emacs doesn't build with any other binutils version.

Hypothesis: Emacs needs to be built with the same binutils as something else.
Check: Rebuild system with 2.16.91.0.4, rebuilding Emacs works.

Hypothesis: Emacs only builds with 2.16.90.0.3 (of those versions >= 2.16.1
available in Portage).
Check: Rebuild system with 2.16.91.0.4, rebuilding Emacs fails, downgrade to
binutils-2.16.90.0.3, rebuilding Emacs works.

Hmm. While I was writing that, the build of glibc with binutils-2.16.91.0.4
failed with:

{standard input}: Assembler messages:
{standard input}:765: Error: symbol `__divdi3' is already defined
{standard input}:830: Error: symbol `__moddi3' is already defined
{standard input}:905: Error: symbol `__udivdi3' is already defined
{standard input}:934: Error: symbol `__umoddi3' is already defined
make[2]: *** [/var/tmp/portage/glibc-2.3.5-r2/work/build-default-
mips-unknown-linux-gnu-linuxthreads/csu/divdi3.os] Error 1

New plan: Rebuild everything with binutils-2.16.1 instead of 2.16.91.0.4. That
should only take a week...

--
Karl-Johan "Creideiki" Karlsson
Re: Emacs in X with toolkits? [ In reply to ]
Karl-Johan 'Creideiki' Karlsson wrote:
>
> The temacs binary built with either of them breaks in the same way as before.
> I'm currently rebuilding glibc and GCC with binutils-2.16.91.0.4, since:
> 1) The system is built with binutils-2.16.90.0.3.
> 2) Emacs built with binutils-2.16.90.0.3 works (sort of).
> 3) Emacs doesn't build with any other binutils version.
>
> Hypothesis: Emacs needs to be built with the same binutils as something else.
> Check: Rebuild system with 2.16.91.0.4, rebuilding Emacs works.
>
> Hypothesis: Emacs only builds with 2.16.90.0.3 (of those versions >= 2.16.1
> available in Portage).
> Check: Rebuild system with 2.16.91.0.4, rebuilding Emacs fails, downgrade to
> binutils-2.16.90.0.3, rebuilding Emacs works.
>
> Hmm. While I was writing that, the build of glibc with binutils-2.16.91.0.4
> failed with:
>
> {standard input}: Assembler messages:
> {standard input}:765: Error: symbol `__divdi3' is already defined
> {standard input}:830: Error: symbol `__moddi3' is already defined
> {standard input}:905: Error: symbol `__udivdi3' is already defined
> {standard input}:934: Error: symbol `__umoddi3' is already defined
> make[2]: *** [/var/tmp/portage/glibc-2.3.5-r2/work/build-default-
> mips-unknown-linux-gnu-linuxthreads/csu/divdi3.os] Error 1
>
> New plan: Rebuild everything with binutils-2.16.1 instead of 2.16.91.0.4. That
> should only take a week...

Well, that confirms 2.16.91.0.[34] is h0rked. That's the same error (iirc) that
I saw w/ .3. 2.16.91.0.2 was the only one that built glibc correctly.

Whether this is a glibc or binutils bug, is, however, uncertain. There's a new
glibc-2.3.6 in portage -- that might be worth a shot if you're feeling brave. I
haven't gotten to testing that yet as I'm still tweaking some new kernel
releases, probably followed by newer mips-headers.


--Kumba

--
Gentoo/MIPS Team Lead
Gentoo Foundation Board of Trustees

"Such is oft the course of deeds that move the wheels of the world: small hands
do them because they must, while the eyes of the great are elsewhere." --Elrond
--
gentoo-mips@gentoo.org mailing list
Re: Emacs in X with toolkits? [ In reply to ]
On Saturday 26 November 2005 04.36, Kumba wrote:
> Karl-Johan 'Creideiki' Karlsson wrote:
> > New plan: Rebuild everything with binutils-2.16.1 instead of 2.16.91.0.4.
> > That should only take a week...
>
> Whether this is a glibc or binutils bug, is, however, uncertain. There's a
> new glibc-2.3.6 in portage -- that might be worth a shot if you're feeling
> brave. I haven't gotten to testing that yet as I'm still tweaking some new
> kernel releases, probably followed by newer mips-headers.

I'm almost done rebuilding the world with binutils-2.16.1, and will try
glibc-2.3.6 with binutils-2.16.91.0.[34] then.

Until then, while rebuilding I've found:

1. mips-headers still has bug #94256 ("extern int errno;" instead of "#include
<errno.h>"), which was fixed in linux-headers in May. Changing that allows me
to build sys-apps/sysvinit-2.86-r3 (see also bug #113232 (which was for
linux-headers-2.4)).

2. while using FEATURES="maketest", a couple of packages don't pass their
testsuites (but I haven't had any problems using any of them). I'll return
with a full list when I have rebuilt everything, and after checking if they
break on other arches too.

--
Karl-Johan "Creideiki" Karlsson
Re: Emacs in X with toolkits? [ In reply to ]
On Saturday 26 November 2005 04.36, Kumba wrote:
> Karl-Johan 'Creideiki' Karlsson wrote:
> > Hmm. While I was writing that, the build of glibc with
> > binutils-2.16.91.0.4 failed with:
> >
> > {standard input}: Assembler messages:
> > {standard input}:765: Error: symbol `__divdi3' is already defined
> > {standard input}:830: Error: symbol `__moddi3' is already defined
> > {standard input}:905: Error: symbol `__udivdi3' is already defined
> > {standard input}:934: Error: symbol `__umoddi3' is already defined
> > make[2]: *** [/var/tmp/portage/glibc-2.3.5-r2/work/build-default-
> > mips-unknown-linux-gnu-linuxthreads/csu/divdi3.os] Error 1
> [...]
> Whether this is a glibc or binutils bug, is, however, uncertain. There's a
> new glibc-2.3.6 in portage -- that might be worth a shot if you're feeling
> brave.

This bug seems to have been fixed in glibc-2.3.6-r1 (see
5090_all_divdi3-asm-fix.patch in
<http://dev.gentoo.org/~azarah/glibc/glibc-2.3.6-patches-1.2.tar.bz2>).

glibc-2.3.6-r1 tried to apply a broken patch (reported for 2.3.5.20050722 in
bug #105136), but with that patch removed it built using
binutils-2.16.91.0.4. The self tests failed immediately, though. It seems to
be binutils' fault:
ld: BFD 2.16.91.0.4 assertion fail
binutils-2.16.91.0.4/bfd/elfxx-mips.c:2349
(whole self test log attached)
Installation also fails, with a segfault in
glibc-2.3.6-r1/work/build-default-mips-unknown-linux-gnu-linuxthreads/elf/sln
(see the other attached log).

--
Karl-Johan "Creideiki" Karlsson