Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Allegro-4.1.16 under BeOS

This thread is locked; no one can reply to it. rss feed Print
Allegro-4.1.16 under BeOS
Yogesh M
Member #3,888
September 2003

Allegro-4.1.16 under BeOS R5 with gcc 2.95

I get following errors when I issue make command

.
.
.some good compilation and then
src/misc/icolconv.s: Assembler messages:
src/misc/icolconv.s:133: Error: unbalanced parenthesis in operand 1.
src/misc/icolconv.s:244: Error: unbalanced parenthesis in operand 1.
.
.
.
src/misc/icolconv.s:2945: Error: unbalanced parenthesis in operand 1.
src/misc/icolconv.s:3034: Error: unbalanced parenthesis in operand 1.
make: *** [obj/beos/alleg/icolconv.o] Error 1

-------------------------------------
http://www.yzonesoft.tk

kazzmir
Member #1,786
December 2001
avatar

I got the same error when working with Allegro in QNX. It has do with this line in icolconv.s:
Line 30

#define SLOTS_TO_BYTES(n) (((n*4+15)/16)*16)

I fixed this before, with bobs help, but I forget what the fix was. If I can find it ill post it later on, otherwise some assembler guru will have to come along and help you.

Yogesh M
Member #3,888
September 2003

Yes, Got the error in Qnx, posted it as seperate topic.

please kazzmir, you will find it.

-------------------------------------
http://www.yzonesoft.tk

ReyBrujo
Moderator
January 2001
avatar

Try downloading a newer binutils. I think yours is a bit too old.

--
RB
光子「あたしただ…奪う側に回ろうと思っただけよ」
Mitsuko's last words, Battle Royale

Evert
Member #794
November 2000
avatar

And if you find such a problem and find a fix for it, it'd be nice to share it (hint hint). ;)

Yogesh M
Member #3,888
September 2003

I am already using the latest release binutils 2.15

Quote:

And if you find such a problem and find a fix for it, it'd be nice to share it (hint hint).

Sure.

Someone should add it to allegro FAQ

-------------------------------------
http://www.yzonesoft.tk

Evert
Member #794
November 2000
avatar

Quote:

Someone should add it to allegro FAQ

I was more thinking of actually fixing the code, actually...
What's odd though is that the line kazzmir posted is perfectly legal. I'd add an extra pair of () around the n, but that's it.

Oh, note that the QNX and BeOS port have been pretty much untouched for the past year or so, since none of the developers has acces to these OSes.

Yogesh M
Member #3,888
September 2003

tried with extra paranthesis around n, no use

How about replacing icolconv.s from allegro 4.0.3,
I though it was a bad idea.

-------------------------------------
http://www.yzonesoft.tk

Evert
Member #794
November 2000
avatar

Quote:

How about replacing icolconv.s from allegro 4.0.3

No, you can't mix versions like that.
What's odd is that this sourcefile is used on other platforms as well and there it does work. I'm afraid ReyBrujo may have been right and your binutils is simply too old. I think Elias said something to that effect on the mailing list a while back, you need to find a more recent version somewhere (as in, the version that shipped with last official release of BeOS is too old).

Yogesh M
Member #3,888
September 2003

I updated binutils to 2.15(latest release) and gcc to gcc 2.95.3

-------------------------------------
http://www.yzonesoft.tk

Thomas Fjellstrom
Member #476
June 2000
avatar

heh. I dont even have binutils 2.15 :o

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Yogesh M
Member #3,888
September 2003

Got it from here for BeOS
http://www.bebits.com/app/4011

-------------------------------------
http://www.yzonesoft.tk

Evert
Member #794
November 2000
avatar

Ok, binutils 2.15 should be ok. gcc 2.95.3 is ancient though.

Anyway, I dug up the AD archives:

on 27-07-2004 Elias Pschernig said:

Unfortunately, this seems this hit some BeOS specific gcc (2.95.3) bug:

+#define SLOTS_TO_BYTES(n) (((n*4+15)/16)*16)

I get lots of this from the assembler:

Error: unbalanced parenthesis in operand 1.

Removing the / operator fixes it.

What should we do? I guess we could just require new enough tools, and
ignore it for now. I highly doubt anyone will be trying to use 4.1.15 on
BeOS. So we can postpone this for now.

and

on 27-07-2004 Eric Botcazou said:

Ok, very likely too old gas version.

> What should we do? I guess we could just require new enough tools, and
> ignore it for now. I highly doubt anyone will be trying to use 4.1.15 on
> BeOS. So we can postpone this for now.

A solution could be to conditionally define the macro for BeOS to:

#define SLOTS_TO_BYTES(n) (n*4)

This would require src/i386/asmdef.c to propagate the ALLEGRO_BEOS define.

Now the problem may occur on other platforms (e.g. QNX) with old gas
versions. It doesn't with gas 2.13 for DJGPP or gas 2.12.90 for MinGW, but
the build instructions for DJGPP only require binutils 2.9.x for example.
So let's simply not overalign the stack pointer for now, this has worked
so far. Patch attached.

The patch is this:

1--- cvs/allegro/src/misc/icolconv.s 2004-07-26 21:48:38.000000000 +0000
2+++ src/allegro/src/misc/icolconv.s 2004-07-27 15:59:46.000000000 +0000
3@@ -26,8 +26,12 @@
4 #include "src/i386/asmdefs.inc"
5
6 
7+#if 0 /* FIXME: the '/' is rejected by old versions of gas. */
8 /* Better keep the stack pointer 16-byte aligned on modern CPUs */
9 #define SLOTS_TO_BYTES(n) (((n*4+15)/16)*16)
10+#else
11+#define SLOTS_TO_BYTES(n) (n*4)
12+#endif
13 
14 
15 .text

It was applied, apparently (I don't keep the CVS commit messages that long so I have to check the repository to see what went wrong in applying it), but somehow it isn't in current CVS. Can you try applying the patch and see if it indeed fixes the problem for you?

Kitty Cat
Member #2,815
October 2002
avatar

Quote:

I updated binutils to 2.15(latest release) and gcc to gcc 2.95.3

GCC is up to 3.4...

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Daniel Schlyder
Member #257
April 2000
avatar

Quote:

GCC is up to 3.4...

I think BeOS is stuck with 2.x because of binary compatibility. :( I'd love to be proven wrong.

Yogesh M
Member #3,888
September 2003

changed (((n*4+15)/16)*16) to (n*4) in icoconv.s
test 1:pass :D

test 2: :'(

gcc -nostart -o lib/beos/liballeg-4.1.16.so obj/beos/alleg/allegro.o obj/beos/alleg/blit.o obj/beos/alleg/bmp.o obj/beos/alleg/clip3d.o obj/beos/alleg/clip3df.o obj/beos/alleg/colblend.o obj/beos/alleg/color.o obj/beos/alleg/config.o obj/beos/alleg/datafile.o obj/beos/alleg/dataregi.o obj/beos/alleg/digmid.o obj/beos/alleg/dither.o obj/beos/alleg/dispsw.o obj/beos/alleg/drvlist.o obj/beos/alleg/file.o obj/beos/alleg/fli.o obj/beos/alleg/flood.o obj/beos/alleg/font.o obj/beos/alleg/fsel.o obj/beos/alleg/gfx.o obj/beos/alleg/glyph.o obj/beos/alleg/graphics.o obj/beos/alleg/gsprite.o obj/beos/alleg/gui.o obj/beos/alleg/guiproc.o obj/beos/alleg/inline.o obj/beos/alleg/joystick.o obj/beos/alleg/keyboard.o obj/beos/alleg/lbm.o obj/beos/alleg/libc.o obj/beos/alleg/math.o obj/beos/alleg/math3d.o obj/beos/alleg/midi.o obj/beos/alleg/mixer.o obj/beos/alleg/modesel.o obj/beos/alleg/mouse.o obj/beos/alleg/pcx.o obj/beos/alleg/poly3d.o obj/beos/alleg/polygon.o obj/beos/alleg/quantize.o obj/beos/alleg/quat.o obj/beos/alleg/readbmp.o obj/beos/alleg/readsmp.o obj/beos/alleg/rle.o obj/beos/alleg/rotate.o obj/beos/alleg/scene3d.o obj/beos/alleg/sound.o obj/beos/alleg/spline.o obj/beos/alleg/stream.o obj/beos/alleg/text.o obj/beos/alleg/tga.o obj/beos/alleg/timer.o obj/beos/alleg/unicode.o obj/beos/alleg/vtable.o obj/beos/alleg/vtable15.o obj/beos/alleg/vtable16.o obj/beos/alleg/vtable24.o obj/beos/alleg/vtable32.o obj/beos/alleg/vtable8.o obj/beos/alleg/iblit16.o obj/beos/alleg/iblit24.o obj/beos/alleg/iblit32.o obj/beos/alleg/iblit8.o obj/beos/alleg/icpu.o obj/beos/alleg/icpus.o obj/beos/alleg/icsprite.o obj/beos/alleg/igfx15.o obj/beos/alleg/igfx16.o obj/beos/alleg/igfx24.o obj/beos/alleg/igfx32.o obj/beos/alleg/igfx8.o obj/beos/alleg/imisc.o obj/beos/alleg/iscan.o obj/beos/alleg/iscanmmx.o obj/beos/alleg/ispr15.o obj/beos/alleg/ispr16.o obj/beos/alleg/ispr24.o obj/beos/alleg/ispr32.o obj/beos/alleg/ispr8.o obj/beos/alleg/istretch.o obj/beos/alleg/izbuf.o obj/beos/alleg/icolconv.o obj/beos/alleg/baccel.o obj/beos/alleg/bdispsw.o obj/beos/alleg/bdwindow.o obj/beos/alleg/bgfx.o obj/beos/alleg/bgfxapi.o obj/beos/alleg/bgfxdrv.o obj/beos/alleg/bjoy.o obj/beos/alleg/bjoydrv.o obj/beos/alleg/bjoyapi.o obj/beos/alleg/bkey.o obj/beos/alleg/bkeyapi.o obj/beos/alleg/bkeydrv.o obj/beos/alleg/bmidi.o obj/beos/alleg/bmidiapi.o obj/beos/alleg/bmididrv.o obj/beos/alleg/bmousapi.o obj/beos/alleg/bmousdrv.o obj/beos/alleg/bmouse.o obj/beos/alleg/boverlay.o obj/beos/alleg/bsnd.o obj/beos/alleg/bsndapi.o obj/beos/alleg/bsnddrv.o obj/beos/alleg/bswitch.o obj/beos/alleg/bsysapi.o obj/beos/alleg/bsysdrv.o obj/beos/alleg/bsystem.o obj/beos/alleg/btimeapi.o obj/beos/alleg/btimedrv.o obj/beos/alleg/btimer.o obj/beos/alleg/bwindow.o obj/beos/alleg/bwscreen.o obj/beos/alleg/ufile.o obj/beos/alleg/colconv.o obj/beos/alleg/pckeys.o -lbe -lgame -ldevice -lmidi -lmedia
obj/beos/alleg/bsysapi.o(.text+0x386): In function `be_sys_init':
: undefined reference to `uname'
collect2: ld returned 1 exit status
make: *** [lib/beos/liballeg-4.1.16.so] Error 1

-------------------------------------
http://www.yzonesoft.tk

Evert
Member #794
November 2000
avatar

Try changing

   uname(&os_name);
   os_type = OSTYPE_BEOS;
   os_multitasking = TRUE;
   os_version = atoi(strtok(os_name.release, "."));
   os_revision = atoi(strtok(NULL, "."));

to

   os_type = OSTYPE_BEOS;
   os_multitasking = TRUE;

The rest shouldn't matter that much anyway... not that I understand why it doesn't work though.

Elias
Member #358
May 2000

Oh, nice, someone who is using BeOS :) I want to try BeOS again as soon as that open version has a first runnable release.

I guess, we should put #ifdef ALLEGRO_BEOS around uname.

--
"Either help out or stop whining" - Evert

Evert
Member #794
November 2000
avatar

Yeah, but it's a BeOS-only file... so I'd expect it to not be nescessary in this case...

Elias
Member #358
May 2000

Oh. Could just apply your change then, or look up the proper BeOS function in the bebook to get this kind of information..

--
"Either help out or stop whining" - Evert

Evert
Member #794
November 2000
avatar

Yeah... it needs looking into anyway. I uname is Posix according to my manpage, and as far as I know, BeOS is Posix complient.

lillo
Member #303
April 2000
avatar

This is weird. I never experienced this uname() problem when I used to work on BeOS... Anyway, I've had a go at fixing the BeOS Allegro current problems, and fixed this issue too. uname() appears to be defined into libnet.so, so let's just link against it, it doesn't hurt :)
The port also had a problem with gfx drivers not up to date with recent modifications of the GFX_VTABLE structure...

Fixed in CVS.

--
Angelo Mottola
lillo AT users DOT sourceforge DOT net
Enhanced Creations++

Yogesh M
Member #3,888
September 2003

added -lnet to makefile.be and

voila, Allegro-4.1.16 compiled succesfully.

-------------------------------------
http://www.yzonesoft.tk

Go to: