Problems with SGUG RSE 0.0.7 gcc and Xlibs/libGL

Dacobi

Member
Oct 13, 2021
42
5
8
Denmark
openme.gl
I'm having various problems with SGUG RSE gcc and Xlibs/libGL.
I am unable to link code with libGL and compiled X11 code will segfault with usr/sgug/lib32 in LD_LIBRARYN32_PATH

All attempts with SGUG gcc were run in sgugshell. The freeware gcc was run in default shell.

I can compile a simple glut example with freeware gcc using this command:
/usr/freeware/bin/gcc glut.c -lglut -lGL -lGLU -lXext -lX11 -lXmu -lm

But if I try the same with SGUG gcc:
/usr/sgug/bin/gcc glut.c -lglut -lGL -lGLU -lXext -lX11 -lXmu -lm

I end up with this error:

/usr/sgug/bin/ld: note: 'glColor3f' is defined in DSO //usr/lib32/libGLcore.so so try adding it to the linker command line
//usr/lib32/libGLcore.so: could not read symbols: Invalid operation

And after adding libGLcore I get this:

/usr/lib32/../lib32/libGL.so: undefined reference to `XSGIMiscQueryExtension'
/usr/lib32/../lib32/libGL.so: undefined reference to `_XSGISetSpecialDestroyHandler'
/usr/lib32/../lib32/libGL.so: undefined reference to `_XSGISetSpecialDestroyInterest'
/usr/lib32/../lib32/libGLcore.so: undefined reference to `gl_INTERPRET_END'
collect2: error: ld returned 1 exit status

It seems that XSGIMiscQueryExtension is a part of IRIX libXext but not in SGUG libXext?
But I don’t know what’s going on with gl_INTERPRET_END?


Another problem I had was with my own compile of SDL2.0.12.

I've patched SDL2.0.12 with the sgipatch in SGUG RSE git 0.0.7 and placed the lib in /usr/lib32.
I can compile a SDL2 example with
/usr/sgug/bin/gcc sdl.c -lSDL2-2.0 -lm

But when running in sgugshell I get this segfault:

Program received signal SIGSEGV, Segmentation fault.
0x041131ac in _XSend () from /usr/sgug/lib32/libX11.so.6
(gdb) bt
#0 0x041131ac in _XSend () from /usr/sgug/lib32/libX11.so.6
#1 0x04105290 in XQueryExtension () from /usr/sgug/lib32/libX11.so.6
#2 0x040f5b30 in XInitExtension () from /usr/sgug/lib32/libX11.so.6
#3 0x040b3640 in XextAddDisplay () from /usr/sgug/lib32/libXext.so
#4 0x042c152Program received signal SIGSEGV, Segmentation fault.
0x041131ac in _XSend () from /usr/sgug/lib32/libX11.so.6
(gdb) bt
#0 0x041131ac in _XSend () from /usr/sgug/lib32/libX11.so.6
#1 0x04105290 in XQueryExtension () from /usr/sgug/lib32/libX11.so.6
#2 0x040f5b30 in XInitExtension () from /usr/sgug/lib32/libX11.so.6
#3 0x040b3640 in XextAddDisplay () from /usr/sgug/lib32/libXext.so
#4 0x042c1528 in XineramaQueryExtension ()
from /usr/sgug/lib32/libXinerama.so.1
#5 0x6018913c in CheckXinerama () from /usr/lib32/libSDL2-2.0.so.0
#6 0x60189354 in X11_InitModes () from /usr/lib32/libSDL2-2.0.so.0
#7 0x6018de88 in X11_VideoInit () from /usr/lib32/libSDL2-2.0.so.0
#8 0x60144bb4 in SDL_VideoInit_REAL () from /usr/lib32/libSDL2-2.0.so.0
#9 0x5ffec9c0 in SDL_InitSubSystem_REAL () from /usr/lib32/libSDL2-2.0.so.0
#10 0x5ffecca8 in SDL_Init_REAL () from /usr/lib32/libSDL2-2.0.so.0
#11 0x60007aa4 in SDL_Init_DEFAULT () from /usr/lib32/libSDL2-2.0.so.0
#12 0x6001f070 in SDL_Init () from /usr/lib32/libSDL2-2.0.so.0
#13 0x10003798 in main (argc=1, argv=0x7ffb7f44) at rayc.c:538
8 in XineramaQueryExtension ()
from /usr/sgug/lib32/libXinerama.so.1
#5 0x6018913c in CheckXinerama () from /usr/lib32/libSDL2-2.0.so.0
#6 0x60189354 in X11_InitModes () from /usr/lib32/libSDL2-2.0.so.0
#7 0x6018de88 in X11_VideoInit () from /usr/lib32/libSDL2-2.0.so.0
#8 0x60144bb4 in SDL_VideoInit_REAL () from /usr/lib32/libSDL2-2.0.so.0
#9 0x5ffec9c0 in SDL_InitSubSystem_REAL () from /usr/lib32/libSDL2-2.0.so.0
#10 0x5ffecca8 in SDL_Init_REAL () from /usr/lib32/libSDL2-2.0.so.0
#11 0x60007aa4 in SDL_Init_DEFAULT () from /usr/lib32/libSDL2-2.0.so.0
#12 0x6001f070 in SDL_Init () from /usr/lib32/libSDL2-2.0.so.0
#13 0x10003798 in main (argc=1, argv=0x7ffb7f44) at sdl.c:538

If I remove /usr/sgug/lib32 from LD_LIBRARYN32_PATH it will run fine.

Is my install broken or am I missing something?
 

jenna64bit

Administrator
Apr 18, 2020
96
25
18
So 1, yeah the current sgug-rse SDL2 isn't accelerated so you won't have a fun time there yet.

As to:
> If I remove /usr/sgug/lib32 from LD_LIBRARYN32_PATH it will run fine.

That variable is set with the sgugshell sh script. It will definitely break non-sgugrse compiled software. That makes sense as to causing you some issues.
 
  • Like
Reactions: Elf

jenna64bit

Administrator
Apr 18, 2020
96
25
18
Ok that makes some sense. Some of the sgug rse folks have been playing with changing those libraries, as the sgug ones are (kind of) like shim libraries.
 

About us

  • Silicon Graphics User Group (SGUG) is a community for users, developers, and admirers of Silicon Graphics (SGI) products. We aim to be a friendly hobbyist community for discussing all aspects of SGIs, including use, software development, the IRIX Operating System, and troubleshooting, as well as facilitating hardware exchange.

User Menu