DJGPP gpp 4.4.1 and 4.4.2 fail under dosemu 1.4.0+svn.1828-2ubuntu2

Bug #512611 reported by zub
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
dosemu (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: dosemu

Trying to compile a trivial hello world C++ program using DJGPP's gpp (g++) version 4.4.1 or 4.4.2 fails under dosemu 1.4.0+svn.1828-2ubuntu2.

The issue is not reproducible with svn r. 1998, so it was probably fixed upstream already.

Maybe it has to do with the CPU emu used by DOSEMU on x86_86?

Release: Ubuntu 9.10 karmic
Package: 1.4.0+svn.1828-2ubuntu2
CPU: Intel(R) Core(TM)2 Duo CPU T9300 @ 2.50GHz
kernel: Linux 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 17:01:44 UTC 2009 x86_64 GNU/Linux

To trigger the bug: Install DJGPP with GPP 4.4.2 or 4.4.1 (you only need bnu219b.zip djdev203.zip gcc442b.zip gpp442b.zip), set up DJGPP environment as mentioned in DJGPP readme. Create a simple C++ source -- including iostream is enough:

#incluide <iostream>

Then try to compile it inside DOSEMU: gpp test.cc

You get a host of complaints about stdlib headers:

In file included from c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/bits/ios_base.h:41,

                 from c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/ios:43,

                 from c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/ostream:40,

                 from c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/iostream:40,

                 from c:/test/test2.cc:1:

c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/ext/atomicity.h:54: error: expected constructor, destructor, or type conversion before '__exchange_and_add'

...

but the issue is not really caused by the headers, because:
1) it works with different versions of DOSEMU (e.g. DOSEMU svn rev. 1998) and the same version of DJGPP GPP
2) if you add an "#error blah" somewhere to the top of include/cxx/4.42/djgpp/bits/atomic_word.h, which is included by include/cxx/4.42/ext/atomicity.h and which defines _Atomic_word (the type that gpp complains about in the above excerpt), you see the file is included without the #error being triggered => gpp is just terribly confused

Revision history for this message
zub (zub-linux) wrote :
Revision history for this message
zub (zub-linux) wrote :

I tracked the issue down in the upstream svn. It was fixed in change 1897. The log entry says:

r1897 | bartoldeman | 2009-07-12 23:44:28 +0200 | 3 lines
Changed paths:
   M /trunk/src/dosext/mfs/mangle.c
   M /trunk/src/dosext/mfs/mangle.h

Use a base-43 instead of a base-36 hash, like Samba does since version 2.0.4.
This reduces the collision chance by a factor 1.43.

Not sure how is this change relevant, but I was able to reproduce the bug in revisions <= 1896, while the bug doesn't manifest in revisions >= 1897.

Revision history for this message
zub (zub-linux) wrote :

A bit more digging reveals the cause and sheds light on the commit log meaning:

Adding #warning "compiling bits/atomicfwd_c.h" at the top of djgpp/include/cxx/4.42/bits/atomicfwd_c.h and compiling a simple source that includes <iostream> leads to this interesting result:

c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/bits/atomic_word.h:1:2: warning: #warning "compiling bits/atomicfwd_c.h"

So it seems gpp is looking for "atomic_word.h" (that is present in djgpp/include/cxx/4.42/djgpp/bits), but searching for it in more paths, it's told by DOSEMU that the file is present in djgpp/include/cxx/4.42/bits and it's given the contents of atomicfwd_c.h instead. This in turn breaks the compilation.

With dosemu r. 1999 I get instead:

c:/djgpp/bin/../lib/gcc/djgpp/4.42/../../../../include/cxx/4.42/djgpp/bits/atomic_word.h:1:2: warning: #warning "compiling djgpp/bits/atomic_word.h"

Anyway the bug would be resolved by bumping up the svn revision the dosemu package is based on.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in dosemu (Ubuntu):
status: New → Confirmed
Revision history for this message
zub (zub-linux) wrote :

The bug is now fixed in all non-obsolete Ubuntu releases with the exception of Hardy Heron, as the fix in upstream was made in svn revision 1897.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.